8: Use of undefined constant scripturl - assumed 'scripturl'

Started by api101, October 14, 2007, 07:16:07 AM

Previous topic - Next topic

api101

Dear All,
  I'm really new for SMF. I got the error shown as:-
"
8: Use of undefined constant scripturl - assumed 'scripturl'
/home/httpd/....................../Themes/default/Admin.template.php (eval?)
line 248 "

This error dump up my error log. I also got the same error with other php scripts .........../rt_smf_sporticus/BoardIndex.template.php (eval?)

and many php-files.

I don't know where to solve this error and how.

Thank you.

Windy

open Admin.template.php and go to that line, then just scroll up until you reach the start of the function, up there there's usually a line that goes something like
global $***, $***, $***;
at the end of that line just before the semi-colon add another coma and type in $scripturl

repeat for the boardindex template as well.
All unsolicited PM's will be ignored.  Any support requests should go in their topics.

My Mods


Image Zoom Tag
Image Quote Removal
Color Picker
Additional Polls
Simple Awards System

Mods are only updated to the latest same major version of smf on request.

metallica48423

This shouldn't happen if things are set up correctly.

SMF version?
Mods installed?
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

api101

Dera Windy,
  Thank you very much. I'll try and report later.

Dear metallica48423,
  It's SMF 1.1.4.
There is no extra Mods. (I'm not sure, I answer your question.)

metallica48423

How did you install the boards?  Can you reupload all the files to make sure they were properly uploaded?

also, ensure all of your path settings are correct.  you can use repair_settings.php to do this. (What is repair_settings.php?)
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

api101

Dear metallica48423,

I tried using repair_settings and click all recommended value.
There are still error in
  -Themes/rt_smf_sporticus/BoardIndex.template.php(eval?)
  -Themes/default/Errors.template.php (eval?)

   line 248 all.

Thanks.

api101

Quote from: Windy on October 14, 2007, 09:35:18 AM
open Admin.template.php and go to that line, then just scroll up until you reach the start of the function, up there there's usually a line that goes something like
global $***, $***, $***;
at the end of that line just before the semi-colon add another coma and type in $scripturl

repeat for the boardindex template as well.

Dear Windy,
  I went to Admin.php in  /sources and found that

// The main administration section.
function Admin()
{
   global $sourcedir, $db_prefix, $forum_version, $txt, $scripturl, $context, $modSettings;
   global $user_info, $_PHPA, $boardurl;
.......

And I, also go in Admin.template.php and Boardindex under /Themes

I found that, there are many functions, some already have $scripturl in global stmt, but some have not.

What should I do.






Windy

Quote from: api101 on October 14, 2007, 09:40:18 PM
Quote from: Windy on October 14, 2007, 09:35:18 AM
open Admin.template.php and go to that line, then just scroll up until you reach the start of the function, up there there's usually a line that goes something like
global $***, $***, $***;
at the end of that line just before the semi-colon add another coma and type in $scripturl

repeat for the boardindex template as well.

Dear Windy,
  I went to Admin.php in  /sources and found that

// The main administration section.
function Admin()
{
   global $sourcedir, $db_prefix, $forum_version, $txt, $scripturl, $context, $modSettings;
   global $user_info, $_PHPA, $boardurl;
.......

And I, also go in Admin.template.php and Boardindex under /Themes

I found that, there are many functions, some already have $scripturl in global stmt, but some have not.

What should I do.
that's why I suggested to go to the actual line the error is occurring and just keep scrolling up until you're able to tell what function the code is erroring in.
All unsolicited PM's will be ignored.  Any support requests should go in their topics.

My Mods


Image Zoom Tag
Image Quote Removal
Color Picker
Additional Polls
Simple Awards System

Mods are only updated to the latest same major version of smf on request.

metallica48423

This is an eval error too, the error might not even be in that file.

you'll have to disable template eval temporarily to get the real file and error line.

To do this, run this query in PHPmyAdmin (What is phpMyAdmin?)

INSERT INTO smf_settings VALUES ('disableTemplateEval', 1);

Once that's done, get the error again and copy it (the file and line may have changed), then run this query to re-enable it:

DELETE FROM smf_settings WHERE variable = 'disableTemplateEval';
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool


api101

 Dear metallica48423,

  You're the man.

After I tried disable template eval, as you suggested, I found that the error is in file name
        " ../rt_smf_sporticus/index.template.php"  line no. 248

I went there and found that: on that line

<a href="'. scripturl .'" class="nounder"><img src="' . $settings['theme_url']

The word scripturl has no '$' in front of it,
   so I just simply add '$' to it.

And the error had gone.


Thank you very much.

metallica48423

Glad to hear you figured it out :)

make sure you turn back on template eval unless you're using a php accellerator :)
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool


Advertisement: