error: Undefined variable: disabled

Started by edi67, December 31, 2004, 03:29:31 AM

Previous topic - Next topic

edi67

i was using this mod from kirby and worked perfectly with SMF RC2:

http://www.simplemachines.org/community/index.php?topic=20652.0

now i upgraded to SMF1.0 and i reinstalled mod:
QuoteOpen: Subs.php

Look for:
Copy to clipboardCode:
   global $modSettings, $scripturl, $txt, $settings, $context;
Add after:
Copy to clipboardCode:
   global $ID_MEMBER, $db_prefix, $user_info;
Look for:
Copy to clipboardCode:
      // Moving text...
stuff
Add before:
Copy to clipboardCode:
      // [hide]Guests cannot see this! Mwahaha![/hide]
      $codefromcache[] = '~\[hide\](.+?)\[/hide\]~i';   
      if ($disabled['hide'] || $user_info['is_admin'])
            $codetocache[] = '$1';
         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[] = '<b>$1</b>';
               else
                  $codetocache[] = $txt['hide_tag_a'];
            mysql_free_result($request);
            }
            else
               $codetocache[] = $txt['hide_tag_b'];
        }


but i have a lot of errors for every user that tell me so:

Quote8: Undefined variable: disabled
File: /home/forumzo7/public_html/Sources/Subs.php
Linea: 973

line 973 is this: if ($disabled['hide'] || $user_info['is_admin'])

somebody can understand why i have this error ? in 10 minutes over 800 errors
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

[Unknown]

It should be isset($disabled['hide']) not just $disabled['hide'].

-[Unknown]

edi67

CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

edi67

making in your way unknown i have this error now:

QuoteParse error: parse error in /home/forumzo7/public_html/Sources/Subs.php on line 973
2: session_start(): Cannot send session cookie - headers already sent by (output started at /home/forumzo7/public_html/Sources/Subs.php:973)
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

[Unknown]

So you replaced this:

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

With:

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

-[Unknown]

Advertisement: