Welcome, Guest. Please Login or Register.
May 07, 2024, 01:29:48 AM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Completed mods  |  [Done] Another useless MOD - Include file in body « previous next »
Pages: [1] Reply Ignore Print
Author Topic: [Done] Another useless MOD - Include file in body  (Read 3929 times)
vorapoap (vory)
Sr. Member
****
Posts: 424


Not considered either a living or death

WWW
[Done] Another useless MOD - Include file in body
« on: April 22, 2002, 09:07:53 AM »
Reply with quote

but it is very useful to me
I have been using this for a while. If you are an admin who has the FTP access, you may feel lazy to edit your announcement on the board.. now you can just upload the text file. The body of the message should say

!@#$%filename.txt

You can change this !@#$% to whatever secret word (5 chars), if you need more char, you have to change the "5" on parameter of two substr(s).

Put below code at the beginning of DoUBBC function in Subs.php
if (substr($message, 0, 5)  == '!@#$%') {
      $ifilename = rtrim( substr ($message, 5));
      if (file_exists($ifilename)) {
         $extfile = fopen ($ifilename, "r");
         if ($extfile) {
            $message = fread ($extfile, filesize ($ifilename));
          }
          fclose($extfile);
      }
   }

 8)
« Last Edit: April 22, 2002, 09:15:20 AM by vorapoap » Logged

On the route to hell...
vorapoap (vory)
Sr. Member
****
Posts: 424


Not considered either a living or death

WWW
Re:[Done] Another useless MOD - Include file in body
« Reply #1 on: April 22, 2002, 09:39:36 AM »
Reply with quote

I just need new feature today.. so now I can include multiple files :D

The new body should be
!@#$%file1.txt,file2.txt,file3.txt

The new code in the same place.
   if (substr($message, 0, 5)  == '!@#$%') {
      $message = rtrim( substr ($message, 5));
      $ifilelist = explode(',', $message);
      $message='';
      foreach($ifilelist as $ifilename) {
         if (file_exists($ifilename)) {
            $extfile = fopen ($ifilename, "r");
            if ($extfile) {
               $message .= fread ($extfile, filesize ($ifilename));
             }
             fclose($extfile);
         }
      }
   }
« Last Edit: April 22, 2002, 09:40:09 AM by vorapoap » Logged

On the route to hell...
Delinquently insane
Foolish One
YaBB God
*****
Posts: 529


The One Surpassed By God!!!!

Re:[Done] Another useless MOD - Include file in body
« Reply #2 on: April 22, 2002, 05:03:26 PM »
Reply with quote

Cool  :)... This Will Come In Handy  ;D
Logged

ALL MODS Cancelled projected terminated
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Completed mods  |  [Done] Another useless MOD - Include file in body « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.029 seconds with 19 queries.