TinyPortal

Development => Support => Topic started by: Racenut on October 07, 2005, 07:51:06 PM

Title: errors
Post by: Racenut on October 07, 2005, 07:51:06 PM
anyone know what this error means?

8: Undefined variable: scripturl
File: c:\inetpub\wwwroot\forum\Themes\default\TPortalBlocks.template.php (eval?)
Line: 17

I have 200 pages of this same error
Title: Re: errors
Post by: ontap on October 08, 2005, 12:08:56 AM

are you using the calendar block?, i had an error like that before and it was something to do with that block.
Title: Re: errors
Post by: bloc on October 08, 2005, 12:33:29 PM
A phpblock needs a "global $scripturl;" I assume.
Title: Re: errors
Post by: Sakuragi on October 15, 2005, 11:24:33 PM
me too, how can i fixe this?
Title: Re: errors
Post by: ontap on October 16, 2005, 12:29:20 AM
add global $scripturl; to the calendar script....

(http://www.tinyportal.net/smf/index.php?topic=700.msg5720#msg5720)
Title: Re: errors
Post by: Sakuragi on October 16, 2005, 03:48:04 AM
i see already global $scripturl on the calendar script?? in TPortalBlocks.template.php
   global $context, $settings, $options, $scripturl, $txt, $modSettings;
       echo '
                  <div style="padding: 5px;" class="smalltext">';
       if($context['TPortal']['ssifunction']=='recentpoll')
           ssi_recentPoll();
       elseif($context['TPortal']['ssifunction']=='toppoll')
           ssi_topPoll();
       elseif($context['TPortal']['ssifunction']=='topboards')
           ssi_topBoards();
       elseif($context['TPortal']['ssifunction']=='topposters')
           ssi_topPoster(5);
       elseif($context['TPortal']['ssifunction']=='topreplies')
           ssi_topTopicsReplies();
       elseif($context['TPortal']['ssifunction']=='topviews')
           ssi_topTopicsViews();
       elseif($context['TPortal']['ssifunction']=='calendar')
          ssi_todaysCalendar();
Title: Re: errors
Post by: bloc on October 16, 2005, 10:26:44 AM
Yes..but as soon as you insert something, especially a function, it need more global declaration. A good indication that it MUST have it, is of course the error itself.
Title: Re: errors
Post by: IchBin on October 24, 2005, 07:24:54 PM
Is this something that should be done in all phpblock scripts? I'm receiving quite a few of these errors and am unable to find out why. In fact, I cleared the errors, then went into TP admin. After that I refreshed the error log page and I had 5 pages of errors after one page view (the TPadmin page). Any thoughts?

http://www.tmrules.com/index.php?action=tpadmin
Apply Filter: Only show the errors with the same message
8: Undefined variable: scripturl
File: /home/username/www/Themes/default/TPortalBlocks.template.php (main_below sub template - eval?)
Line: 5
Title: Re: errors
Post by: bloc on October 25, 2005, 01:03:12 PM
Mostly..I will try to add it in the function that execute the php code(its not now), maybe that will help. You could try it as well:

in TPortalBlocks.template.php, find:
// php blocktype
function TPortal_phpbox()
{
    global $context, $settings, $options, $txt;
    // execute what is in the block, no echoing
    if(!empty($context['TPortal']['phpboxbody']));
      eval($context['TPortal']['phpboxbody']);
}


and just add it there like:
// php blocktype
function TPortal_phpbox()
{
    global $context, $settings, $options, $txt , $scripturl;
    // execute what is in the block, no echoing
    if(!empty($context['TPortal']['phpboxbody']));
      eval($context['TPortal']['phpboxbody']);
}
Title: Re: errors
Post by: IchBin on October 25, 2005, 03:55:34 PM
hmmm... that seemed to help. But now I'm getting this error.

8: Undefined index: tp-pathtothumbs2
File: /home/username/www/Themes/default/TPortalBlocks.template.php (main sub template - eval?)
Line: 341
Title: Re: errors
Post by: ontap on October 25, 2005, 04:34:52 PM

http://www.tinyportal.net/smf/index.php?topic=1109.msg8679#msg8679