Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
Go Team Barry!

 
Post new topic   Reply to topic Printable version
 View previous topic  mouse/keyboard problem Post :: Post Real DDoS on a thread  View next topic  
Author Message
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:42
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3615
Location: Las Vegas
Offline

PostPosted: Sat Nov 19, 2005 11:14 pm   Post maybe stupid    Post subject: Go Team Barry! Reply to topic Reply with quote

Yet another reason why phpbb code is horrible:

After running the code through indent because half of it was on one line, I finally found the double [code] problem, and why it didn't effect me nor some others. Apparently, the smilie parsing code was written by someone who learned php 10 minutes ago. I like the spelling of pieces too.

Code: Show/Hide
//
// Smilies code ... would this be better tagged on to the end of bbcode.php?
// Probably so and I'll move it before B2
//
function smilies_pass ($message)
{
  static $orig, $repl;
  if (!isset ($orig))
    {
      global $db, $board_config, $bbcode_tpl;
      $orig = $repl = array ();
      $sql = 'SELECT code, smile_url FROM '.SMILIES_TABLE;
      if (!$result = $db->sql_query ($sql))
   {
     message_die (GENERAL_ERROR, "Couldn't obtain smilies data", "", __LINE__, __FILE__, $sql);
   }
      $smilies = $db->sql_fetchrowset ($result);
      usort ($smilies, 'smiley_sort');
      for ($i = 0; $i < count ($smilies); $i++)
   {
     $orig[] = "/(?<=.\W|\W.|^\W)" . phpbb_preg_quote ($smilies[$i]['code'], "/") . "(?=.\W|\W.|\W$)/";
     $repl[] = '<img src="' . $board_config['smilies_path'] . '/' . $smilies[$i]['smile_url'] . '" alt="' . $smilies[$i]['smile_url'] . '" border="0" />';
   }
    }

  if (count ($orig))
    {
      $peaces = array ();
      if (isset ($bbcode_tpl))
   {
     // bbcode_tlp is present, make split pattern
     $code_start_html = preg_quote ($bbcode_tpl['code_open']);
     $code_split_pattern = "#(".$code_start_html.")#s";
     $peaces = preg_split ($code_split_pattern, $message, -1);
   }
      if (count ($peaces) <= 1)
   {
     // no code block, parse all smilies
     $message = preg_replace ($orig, $repl, ' '.$message.' ');
     $message = substr ($message, 1, -1);
   }
      else
   {
     // code block detected...
     $message = "";
     for ($i = 0; $i < count ($peaces); $i++)
       {
//         if (($i % 2 == 0))
//MGB HACK: Fix smilie parsing out [ code ] html
      if ($i == 0)
      {
        // normal text, parse for smilies
        $peaces[$i] =
          preg_replace ($orig, $repl, ' '.$peaces[$i].' ');
        $peaces[$i] = substr ($peaces[$i], 1, -1);
        $message .= $peaces[$i];
      }
         else
      {
        // code block, do not do smilie parsing for code

        // find position of code close HTML
        $pos = strpos($peaces[$i], $bbcode_tpl['code_close']);
        $len = strlen($bbcode_tpl['code_close']);

        // split this peace in code text and normal text
        $code_text = substr($peaces[$i], 0, $pos);
        $normal_text = substr($peaces[$i], $pos + $len);

        // parse normal text for smilies
        $normal_text = preg_replace($orig, $repl, ' ' . $normal_text . ' ');
        $normal_text = substr($normal_text, 1, -1);

        // put boundries, code text and normal text together and add to message
        $message .= $bbcode_tpl['code_open'] . $code_text . $bbcode_tpl['code_close'] . $normal_text;
      }
       }
   }
    }
  return $message;
}


Apparently, they thought that when you split around a specific block, it would somehow magically split around the ending block. Thus, they loop over the peaces (SIC) array. Well, the final code doesn't bother with that stupid checking, and instead just starts the for loop at 1.

Once Team Barry finishes his new forums software and makes it public, I'm so switching...
Back to top
View users profile Send private message Add User to Ignore List Send email
Confess
Zone Hoster


Joined: Feb 10 2004
Posts: 532
Offline

PostPosted: Sun Nov 20, 2005 12:30 am   Post maybe stupid    Post subject: Reply to topic Reply with quote

Why not go to IPB 1.3?
_________________
I know that I myself cannot do anything, that I will fall, and that I am a sinful man, but I know that I can do ANYTHING through God Almighty, whom strengthens me.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
Guest



Offline

PostPosted: Sun Nov 20, 2005 1:09 am   Post maybe stupid    Post subject: Reply to topic Reply with quote

Get UBB5 and run the perl/cgi ver.
Back to top
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Sun Nov 20, 2005 1:28 am   Post maybe stupid    Post subject: Reply to topic Reply with quote

Yep, there's a reason I switched to SMF (without a hitch).
_________________
This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:42
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3615
Location: Las Vegas
Offline

PostPosted: Sun Nov 20, 2005 1:55 am   Post maybe stupid    Post subject: Reply to topic Reply with quote

Confess wrote:
Why not go to IPB 1.3?

Because I want to upgrade the forums, not just change to someone else. Got too many damn hacks in here already, might as well keep them.
Back to top
View users profile Send private message Add User to Ignore List Send email
D1st0rt
Miss Directed Wannabe


Age:37
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Sun Nov 20, 2005 8:26 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

Cyan, I can't ignore Spyed on SMF
_________________

Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Purge
Episode I > Eposide III
Jar-Jar is kool


Age:36
Gender:Gender:Male
Joined: Sep 08 2004
Posts: 2019
Offline

PostPosted: Sun Nov 20, 2005 11:04 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

D1st0rt wrote:
Cyan, I can't ignore Spyed on SMF


Because 1st is using an open Beta version of SMF 1.1.
Back to top
View users profile Send private message Add User to Ignore List
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Sun Nov 20, 2005 11:05 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

You can't ignore Spyed on a non-modded phpbb either.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Trash Talk All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 59 page(s) served in previous 5 minutes.

phpBB Created this page in 0.522627 seconds : 32 queries executed (89.0%): GZIP compression disabled