TinyPortal

Development => Support => Topic started by: Goad on February 03, 2010, 03:24:07 PM

Title: Errors in SMF Log
Post by: Goad on February 03, 2010, 03:24:07 PM
getting the following error:

2: Invalid argument supplied for foreach()
File: /home/socaljet/public_html/scjb/Themes/default/languages/TPShout.english.php (main sub template - eval?)
Line: 15

line 15 from TPShout.english.php

$txt['tp-show_profile_shouts'] = 'Hide shouts in the profile?';

SMF version: 1.1.11
TP version: 1.0 Beta 4
Theme name and version: Default
Browser Name and Version: IE/FF
Mods installed: TP
Related Error messages: see above
Title: Re: Errors in SMF Log
Post by: ccbtimewizard on February 03, 2010, 04:00:49 PM
Disable template evaluation please.
Title: Re: Errors in SMF Log
Post by: Goad on February 03, 2010, 04:08:00 PM
please explain what that is and where i can find the setting. i searched this site for "template evaluation" and found nothing
Title: Re: Errors in SMF Log
Post by: ccbtimewizard on February 03, 2010, 04:12:42 PM
http://custom.simplemachines.org/mods/index.php?mod=2054
Title: Re: Errors in SMF Log
Post by: Goad on February 03, 2010, 04:29:53 PM
ok, its been disabled. error is still happening. now what?
Title: Re: Errors in SMF Log
Post by: ccbtimewizard on February 03, 2010, 04:33:06 PM
The error should still be happening, but it should be returning the real line.

Can you copy/paste the new error?
Title: Re: Errors in SMF Log
Post by: Goad on February 03, 2010, 04:35:07 PM
2: Invalid argument supplied for foreach()
File: /home/socaljet/public_html/scjb/Themes/default/TPortal.template.php
Line: 15
Title: Re: Errors in SMF Log
Post by: ccbtimewizard on February 03, 2010, 04:36:58 PM
What is the line of code there? Can you show me a small blurb?
Title: Re: Errors in SMF Log
Post by: Goad on February 03, 2010, 04:39:00 PM
Line 15 is in bold...

   // show the linktree?

   $context['TPortal']['linktree_show']=false;

   $nolayer=false;

   if($context['TPortal']['front_type']!='frontblock')

   {

      foreach($context['TPortal']['boardnews'] as $bb)

      {

         if(isset($bb['options']['nolayer']))

            $nolayer=true;

         elseif(isset($bb['options']['linktree']))

            $context['TPortal']['linktree_show']=true;

      }

   }

   if($nolayer)

      template_main_nolayer();

   else

      template_main_tportal();

}
Title: Re: Errors in SMF Log
Post by: ccbtimewizard on February 03, 2010, 04:54:04 PM
This:

   if($context['TPortal']['front_type']!='frontblock')

   {

      foreach($context['TPortal']['boardnews'] as $bb)

      {

         if(isset($bb['options']['nolayer']))

            $nolayer=true;

         elseif(isset($bb['options']['linktree']))

            $context['TPortal']['linktree_show']=true;

      }

   }


Make it:

   if($context['TPortal']['front_type']!='frontblock')

   {

if (!empty($context['TPortal']['boardnews']) && is_array($context['TPortal']['boardnews']))
{
      foreach($context['TPortal']['boardnews'] as $bb)

      {

         if(isset($bb['options']['nolayer']))

            $nolayer=true;

         elseif(isset($bb['options']['linktree']))

            $context['TPortal']['linktree_show']=true;

      }
}

   }
Title: Re: Errors in SMF Log
Post by: Goad on February 03, 2010, 06:58:32 PM
that has cleared that error. i had so many of them coming in....5 to 6 a second

thanks!  ;)