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
are you using the calendar block?, i had an error like that before and it was something to do with that block.
A phpblock needs a "global $scripturl;" I assume.
me too, how can i fixe this?
add global $scripturl; to the calendar script....
(http://www.tinyportal.net/smf/index.php?topic=700.msg5720#msg5720)
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();
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.
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
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']);
}
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
http://www.tinyportal.net/smf/index.php?topic=1109.msg8679#msg8679