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.
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.
This shouldn't happen if things are set up correctly.
SMF version?
Mods installed?
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.)
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? (http://www.simplemachines.org/community/index.php?topic=18096.0))
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.
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.
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.
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? (http://www.simplemachines.org/community/index.php?topic=21919.0))
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';
Thank you, I'll try it.
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.
Glad to hear you figured it out :)
make sure you turn back on template eval unless you're using a php accellerator :)
Yes, I did.
Thank you.