News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

convert a lil code from old subs.php to new subs.php

Started by Gandalf, November 04, 2005, 06:26:15 PM

Previous topic - Next topic

Gandalf

Hello there,

I have this code i want to convert it to the new parse_bbs function in SMF 1.1, the code came from a mod (hide) designed for 1.0.5


                // Hide Tag... [hide]Hide Tag[/hide]

                $codefromcache[] = '~\[hide\](.+?)\[/hide\]~i';

                if (isset($disabled['hide']) || $user_info['is_admin']){

                      $codetocache[] =  $txt['hide_tag'] . '<br><div class="code"><b> $1</b></div>';

                   }

                else

                   {

                      if (!empty($context['current_topic']) && !$user_info['is_guest']){

                           $request = mysql_query("

                                                   SELECT ID_MSG FROM {$db_prefix}messages

                                                   WHERE ID_MEMBER = $ID_MEMBER

                                                   AND ID_TOPIC = $context[current_topic]

                                                   LIMIT 1");



                           if (mysql_num_rows($request)){

                               $codetocache[] = ' ' . $txt['hide_tag'] . '<br><div class="code"><b> $1</b></div>';

                               }

                           else

                              {

                               $codetocache[] = $txt['hide_tag'] . '<br><div class="code"><b>' . $txt['hide_tag_a'] . '</b></div>';

                              }

                         mysql_free_result($request);

                          }

                      else

                      {

                          $codetocache[] = $txt['hide_tag'] . '<br><div class="code"><b>' . $txt['hide_tag_b'] . '</b></div>';

                      }

                   }





I appreciate it if someone give me the code so i can convert this modification
Siemens-mobiles.org Visit it and you won't regret it :D

Advertisement: