The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Anyway to detect current page in template?
I want to let a template detect whether current page is "forumdisplay" or "index".
|
#3
|
||||
|
||||
Quote:
HTML Code:
PHP Warning: Use of undefined constant THIS_SCRIPT - assumed 'THIS_SCRIPT' (this will throw an Error in a future version of PHP) in ..../includes/adminfunctions_template.php(3959) : eval()'d code on line 36 P.S.: I already tried this trick prior to creating this thread here. Wondering whether I messed up with something else. My board runs on PHP 7.4 . ------------ Update: Similar issue happens with MyBB: https://github.com/mybb/mybb/issues/3017 https://github.com/mybb/mybb/pull/3092 Looks like some php files in the 'includes' folder needs modification to declare the "THIS_SCRIPT". ------------ Following-up: This warning can be dismissed. It won't cause template rendering error as it does not generate any similar error message in forumdisplay, index, etc. These php files already have "THIS_SCRIPT" defined. My conclusing is that the template system of vBulletin 3.8.11 needs some fix. Solution: Editing "template.php" and add the following to "DEFINE IMPORTANT CONSTANTS": HTML Code:
define('THIS_SCRIPT', 'template'); |
Благодарность от: | ||
PinkMilk |
#4
|
||||
|
||||
Quote:
I had the same warning in the Navbar template for the responsive style of Sultantheme : Quote:
|
Благодарность от: | ||
ShikiSuen |
#5
|
|||
|
|||
I'm running php 5.6.32 on my local vb version so probably can't recreate the error if you think its higher php related,
HOWEVER... I noticed I missed the closing " (previous post fixed). Code:
<if condition="THIS_SCRIPT == 'index'"> // do something </if> |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|