TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,004
  • Total Topics: 21,330
  • Online today: 141
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 118
  • Total: 118

errors

Started by Racenut, October 07, 2005, 07:51:06 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Racenut

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

ontap


are you using the calendar block?, i had an error like that before and it was something to do with that block.

bloc

A phpblock needs a "global $scripturl;" I assume.

Sakuragi

me too, how can i fixe this?

ontap


Sakuragi

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();

bloc

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.

IchBin

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

bloc

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']);
}

IchBin

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

This website is proudly hosted on Crocweb Cloud Website Hosting.