SimplePortal

Support => English Support => Topic started by: Normally on February 24, 2009, 04:12:21 AM

Title: message
Post by: Normally on February 24, 2009, 04:12:21 AM
I get this messages in the log:
Quote
                              http://www.kaartenleggen.nl/zigeunerkaarten/index.php?action=forum (http://www.kaartenleggen.nl/zigeunerkaarten/index.php?action=forum)                                                     
                                                        8: Undefined offset:  158                         
                                                        Bestand: /home/kaarten/domains/kaartenleggen.nl/public_html/zigeunerkaarten/cache/lang_Post_dutch_zigeunerkaarten.php (portal_above sub template - eval?)
                               Regel: 266                           

I use:
SimplePortal 2.1.1 (http://www.simpleportal.net/)
SMF 2.0 RC1 (http://www.simplemachines.org/)

Does anyone know what the problem is?

Stef.
Title: Re: message
Post by: [SiNaN] on February 24, 2009, 06:19:38 AM
It probably is not related to SimplePortal. But to make sure:

Try disabling template eval using the instructions here:

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

Then check error logs agin. You will see the exact file and line giving error.
Title: Re: message
Post by: Normally on February 24, 2009, 06:28:43 AM
Now i get this message in the log:
http://www.kaartenleggen.nl/zigeunerkaarten/index.php?action=admin;area=logs;e5722a888a0c=d5fdb371eb1c819b89e5b30b5c01b36 (http://www.kaartenleggen.nl/zigeunerkaarten/index.php?action=admin;area=logs;e5722a888a0c=d5fdb371eb1c819b89e5b30b5c01b363)                                                     
                                                       8: Undefined offset:  15                         
                                                       Bestand: /home/kaarten/domains/kaartenleggen.nl/public_html/zigeunerkaarten/Sources/SPortal2.php(1862) : eval()'d code (http://www.kaartenleggen.nl/zigeunerkaarten/index.php?action=admin;area=logs;sa=errorlog;file=L2hvbWUva2FhcnRlbi9kb21haW5zL2thYXJ0ZW5sZWdnZW4ubmwvcHVibGljX2h0bWwvemlnZXVuZXJrYWFydGVuL1NvdXJjZXMvU1BvcnRhbDIucGhwKDE4NjIpIDogZXZhbCgpJ2QgY29kZQ==;line=266)
Regel: 266                            
Title: Re: message
Post by: [SiNaN] on February 24, 2009, 06:32:52 AM
Okay, I see. You have a PHP block and it causes an undefined index error. Would paste the codes of your PHP blocks here?

BTW, do not forget to enable the template eval back. You can see how to do that from the same topic linked above.
Title: Re: message
Post by: Normally on February 24, 2009, 06:43:37 AM
PHP block:
Code: [Select]
{

   global $smcFunc, $memberContext, $context, $user_info, $txt, $scripturl, $modSettings, $settings, $sc;

   global $color_profile;

   if($context['user']['is_logged'])

   {

      $member_id = $user_info['id'];

      loadMemberData($member_id);

      loadMemberContext($member_id);

      //If you install the Membercolor Link the colors will be autmaticly set.

      if(empty($modSettings['MemberColorLinkInstalled']) && sp_loadColors($member_id) !== false)

         $memberContext[$member_id]['colored_name'] = $color_profile[$member_id]['colored_name'];



      $memberContext[$member_id]['karma']['total'] = $memberContext[$member_id]['karma']['good'] - $memberContext[$member_id]['karma']['bad'];

   }

      echo '<div align="center">';



   if ($context['user']['is_guest'])

   {

      echo '<form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '">

         <table border="0" cellspacing="1" cellpadding="0" class="ssi_table">

            <tr>

               <td align="right"><label for="user">', $txt['username'], ':</label></td>

               <td><input type="text" id="sp_user" name="user" size="9" value="', !empty($user_info['username']) ? $user_info['username'] : '', '" /></td>

            </tr><tr>

               <td align="right"><label for="passwrd">', $txt['password'], ':</label></td>

               <td><input type="password" name="passwrd" id="sp_passwrd" size="9" /></td>

            </tr><tr>

               <td>

                  <select name="cookielength">

                     <option value="60">', $txt['one_hour'], '</option>

                     <option value="1440">', $txt['one_day'], '</option>

                     <option value="10080">', $txt['one_week'], '</option>

                     <option value="43200">', $txt['one_month'], '</option>

                     <option value="-1" selected="selected">', $txt['forever'], '</option>

                  </select>

               </td>

               <td><input type="submit" value="', $txt['login'], '" /></td>

            </tr>

         </table>

      </form>', sprintf($txt['welcome_guest'], $txt['guest_title']);

   }

   else

   {

      echo $txt['hello_member'], ' <b>', (!empty($memberContext[$member_id]['colored_name']) ? $memberContext[$member_id]['colored_name'] : $context['user']['name']), '</b><br /><br />';



      if (!empty($context['user']['avatar']))

         echo $context['user']['avatar']['image'], '<br /><br />';



      if (!empty($memberContext[$member_id]['group']))

         echo $memberContext[$member_id]['group'];

      else

         echo $memberContext[$member_id]['post_group'];

     

      echo '<br />', $memberContext[$member_id]['group_stars'], '<hr /></div>';

 if ($context['user']['is_logged'])
   {
      echo '
                        <span style="font-size: 100%;"> <a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a> <br />
                        <a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br /></span><br>';

}       
echo '
       
         ', $txt['posts'], ': ',$memberContext[$member_id]['posts'],'<br />';



      if(!empty($modSettings['karmaMode']))

         echo '

          ', $txt['sp-userkarma'], ': ';

     

      if($modSettings['karmaMode'] == '1')

         echo $memberContext[$member_id]['karma']['total'],'<br />';

      elseif($modSettings['karmaMode'] == '2')

         echo '+', $memberContext[$member_id]['karma']['good'],'/-', $memberContext[$member_id]['karma']['bad'], '<br />';



   }


   if(allowedTo('pm_read'))

      echo '

      ', $txt['sp-usertmessage'], ': <a href="' . $scripturl . '?action=pm">' . $context['user']['messages'], '</a><br />

       ', $txt['sp-usernmessage'], ': ' . $context['user']['unread_messages'], '<hr />';

if (!empty($context['user']['total_time_logged_in']))

      {

   echo '

   <span style="font-size: 100%;">            ', $txt['totalTimeLogged1'];
echo'
         <br>';
// If days is just zero, don't bother to show it.
                            if ($context['user']['total_time_logged_in']['days'] > 0)

   echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];


// Same with hours - only show it if it's above zero.

         if ($context['user']['total_time_logged_in']['hours'] > 0)

            echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];



         // But, let's always show minutes - Time wasted here: 0 minutes.

         echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'], '<br /></span>';

      }   

   if (!$context['user']['is_guest'])

      echo '

      <div align="center"><img src="' . $settings['images_url'] . '/arrow.gif" alt="', $txt['sp-arrow'], '" /> <a href="'.$scripturl.'?action=profile">', $txt['profile'], '</a>   <img src="' . $settings['images_url'] . '/arrow.gif" alt="', $txt['sp-arrow'], '" /> <a href="', $scripturl, '?action=logout;sesc=', $sc, '">', $txt['logout'], '</a>';

   echo '</div><hr />';



   $totals = array(

      'members' => $modSettings['totalMembers'],

      'posts' => $modSettings['totalMessages'],

      'topics' => $modSettings['totalTopics']

   );



   $request = $smcFunc['db_query']('','

      SELECT COUNT(*)

      FROM {db_prefix}boards'

   );

   list ($totals['boards']) = $smcFunc['db_fetch_row']($request);

   $smcFunc['db_free_result']($request);



   $request = $smcFunc['db_query']('','

      SELECT COUNT(*)

      FROM {db_prefix}categories'

   );

   list ($totals['categories']) = $smcFunc['db_fetch_row']($request);

   $smcFunc['db_free_result']($request);;


// Statistieken
   echo '
   
<div class="normaltext">
<img src="http://www.kaartenleggen.nl/zigeunerkaarten/Themes/zigeunerkaarten/images/icons/info.gif" alt="" title="statistieken">
<a href="http://www.kaartenleggen.nl/zigeunerkaarten/index.php?action=stats"><strong>Statistieken</strong></a>
</div>
     <br />
          ', $txt['total_members'], ': <a href="', $scripturl . '?action=mlist">', $totals['members'], '</a>
      <br />
          ', $txt['total_posts'], ': ', $totals['posts'],'
      <br />
          ', $txt['total_topics'], ': ', $totals['topics'],'
      <br />
          ', $txt['total_cats'], ': ', $totals['categories'],'
      <br />
          ', $txt['total_boards'], ': ', $totals['boards'],'
      <hr />';




// Members online
   echo '

<div class="normaltext">
<img src="http://www.kaartenleggen.nl/zigeunerkaarten/Themes/zigeunerkaarten/images/icons/online.gif" alt="" title="online leden">
<a href="http://www.kaartenleggen.nl/zigeunerkaarten/index.php?action=who"><strong>Leden online</strong></a>
    </div>';

      global $txt, $scripturl;
      require_once('SSI.php');

     $limit = 20; // Limited number of users shown.

      // add online users
      echo '
      <h5 class="online"><a href="'.$scripturl.'?action=who">'.$txt[158].'</a></h5>
     
         ';
     
      $online = ssi_whosOnline('array');
      echo $txt['sp-onlineuser'].': '.$online['num_users']. '
         
         <br />'.$txt['sp-onlineguest'].': '.$online['guests'].'
         <br />'.$txt['sp-onlinetuser'].': '.$online['total_users'].'
         <br /><br />
         <width: 100%; ' , $online['num_users']>14 ? 'height: 23ex;overflow: auto;' : '' ,'">';

      foreach($online['users'] as $user)
      {
         if ($limit <= 0)
               break;
         echo '
            <img src="' . $settings['images_url'] . '/useron.gif" alt="', $txt['user'], '" /> ', $user['hidden'] ? '<em>' . $user['link'] . '</em>' : $user['link'];
         echo '<br />';
         $limit--;
      }
      echo '
<br />
<div class="smalltext">
                     ', $txt['most_online_today'], ': <b>', $modSettings['mostOnlineToday'], '</b>.
                     ', $txt['most_online_ever'], ': ', $modSettings['mostOnline'], ' (' , timeformat($modSettings['mostDate']), ')
                  </div>

         '; 
      }
 

PHP Block:
Code: [Select]
global $context, $memberContext, $modSettings, $color_profile,$smcFunc;

//Edit the number of last members you want to show
$number_to_display = 5;

echo '
<div style="text-align: center;">
   <table>';

$request = $smcFunc['db_query']('','
   SELECT
      id_member, member_name
   FROM smf_members
   ORDER BY id_member DESC LIMIT 0,'.$number_to_display
);
while ($row = $smcFunc['db_fetch_assoc']($request)){
   loadMemberData($row['id_member']);
   loadMemberContext($row['id_member']);
   echo '
      <tr><td>';

   if (!empty($memberContext[$row['id_member']]['avatar']['href']))
      echo '
      <img src="'.$memberContext[$row['id_member']]['avatar']['href'].'" alt="" width="50" />';
   else
      echo '
      <img src="avatars/noavatar.gif" alt="" width="30" />';

   echo '
      </td><td>', $memberContext[$row['id_member']]['link'], '</td></tr>';
}

echo '
</table></div>';

And some standard blocks:
Recent Posts Block
Quick Search Block
Calendar Block

Thanks for helping.

Stef.
Title: Re: message
Post by: [SiNaN] on February 24, 2009, 07:33:07 AM
In the first codes;

Find:

Code: [Select]
$txt[158]
Replace:

Code: [Select]
$txt['who_title']
Title: Re: message
Post by: Normally on February 24, 2009, 08:13:09 AM
This fixt the problem.

Thanks for all your help.

Stef.
SimplePortal 2.3.8 © 2008-2024, SimplePortal