The Arcive of vBulletin Modifications Site. |
|
Template warning, variable conflict? Details »»
|
|||||||||||||||||||||||||
Hello,
I recently started a postnuke+vbulletin project for my website. Till now I just hacked register.php to update pn's edited tables as well. To do so I had to call pnInit(). Although the registration proceeds fine, I get a warning. Warning: Use of undefined constant template - assumed 'template' in /home/everwick/public_html/project/forums/admin/functions.php on line 974 I thought that some variable of my hack is conflicting with vB but looking at my code over and over, can't find anything. Any suggestions? PS: I could post the code I added but I don't think it will be of any use. Just let me know if it does though. PS2: I modified templates register_adult and register_stylecell Cheers Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
||||
|
||||
|
What's line 974 of functions.php?
The warning isn't about templates, it's about using an undefined constant ('template'). It should probably be a string / variable, I'll need to see the line in order to tell. |
|
#3
|
|||
|
|||
|
Pasting from the file, the line is the one in bold
Code:
// ###################### Start gettemplate #######################
function gettemplate($templatename,$escape=1,$gethtmlcomments=1) {
// gets a template from the db or from the local cache
global $templatecache,$DB_site,$templatesetid,$addtemplatename;
if (isset($templatecache[$templatename])) {
$template=$templatecache[$templatename];
} else {
$gettemp=$DB_site->query_first("SELECT template FROM template WHERE title='".addslashes($templatename)."' AND (templatesetid=-1 OR templatesetid='$templatesetid') ORDER BY templatesetid DESC LIMIT 1");
$template=$gettemp[template];
$templatecache[$templatename]=$template;
}
if ($escape==1) {
$template=addslashes($template);
$template=str_replace("\\'","'",$template);
}
if ($gethtmlcomments and $addtemplatename) {
return "<!-- BEGIN TEMPLATE: $templatename -->\n$template\n<!-- END TEMPLATE: $templatename -->";
}
return $template;
}
|
|
#4
|
||||
|
||||
|
I see, looks like PostNuke or whatever is using functions.php has a high level of error reporting. Fixing that instance won't solve the problem because you will just get another error in a different place.
Find a line in your files that contains "error_reporting()" (not a vBulletin file, a custom file), and change whatever there is in there to 7, so it would look like this: Code:
error_reporting(7); |
|
#5
|
|||
|
|||
|
I hope that works
![]() There was only one error_reporting(E_ALL) in pnInit() I'll get back to u if it doesn't work. Thanks
|
|
#6
|
||||
|
||||
|
Yeah that's the problem. E_ALL means report all errros, including warnings.
|
![]() |
|
|