The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Simple Page.... no working!!!
Hi,
I'm using some code to pull out a custom template to display in a page with the vBulletin header (no navbar).... I'm trying to pass in themplate name with a querystring... Here is the code PHP Code:
Warning: Division by zero in /includes/functions.php(4314) : eval()'d code on line 10 I know it's failing on the last line, and I've tried others like:- PHP Code:
What am I doing wrong? Thanks. |
#2
|
||||
|
||||
Have you looked at this tutorial?
https://vborg.vbsupport.ru/showthread.php?t=98009 But from looking over the tutorial I posted above... try this. Code:
<?php // ######################## SET PHP ENVIRONMENT ########################### error_reporting(E_ALL & ~E_NOTICE); // ##################### DEFINE IMPORTANT CONSTANTS ####################### // change the line below to the actual filename without ".php" extention. // the reason for using actual filename without extention as a value of this constant is to ensure uniqueness of the value throughout every PHP file of any given vBulletin installation. define('THIS_SCRIPT', 'CHANGE_THIS_TO_YOUR_FILE_NAME'); // #################### PRE-CACHE TEMPLATES AND DATA ###################### // get special phrase groups $phrasegroups = array(); // get special data templates from the datastore $specialtemplates = array(); // pre-cache templates used by all actions $globaltemplates = array( // change the lines below to the list of actual templates used in the script 'reqpage', ); // pre-cache templates used by specific actions $actiontemplates = array(); // ########################## REQUIRE BACK-END ############################ require_once('./global.php'); // #################### HARD CODE JAVASCRIPT PATHS ######################## $headinclude = str_replace('clientscript', $vbulletin->options['bburl'] . '/clientscript', $headinclude); // ######################################################################## // ######################### START MAIN SCRIPT ############################ // ######################################################################## $navbits = array(); // change the line below to contain whatever you want to show in the navbar (title of your custom page) $navbits[$parent] = 'Test Page'; // change the line below to contain the name of the actual main output template used in your script eval('print_output("' . fetch_template('reqpage') . '");'); ?> |
#3
|
|||
|
|||
Some of your code is wrong.
I don't know what this is: PHP Code:
That part should be deleted to this: PHP Code:
Then the eval should be: PHP Code:
|
#4
|
|||
|
|||
try
Code:
eval('print_output("' . fetch_template('reqpage') . '");'); Code:
$globaltemplates = array( reqpage, ); [edit] Damn, everyone pounced at once! |
#5
|
|||
|
|||
Ah why is my font green.
|
#6
|
|||
|
|||
Quote:
|
#7
|
||||
|
||||
Quote:
Post your actual template here. |
#8
|
|||
|
|||
Hi and thanks everyone above for trying to help.
This php page is a one-size fits all page for static pages. You pass it the name of the template (via querystring) and the script should grab the template and display it! Basically, it's called like this:- pagecontent.php?reqpage=Static_SEO In this case, Static_SEO is the template name. SirAdrian, all the templates I've tested this with are certified error free... non of the templates are a problem.... it's this code. Can I ask everyone to refer back to my original code above and just note that $reqpage is a string variable pulled in from the querystring. I'm sure the last line is where the error is (maybe?) because the value of $reqpage definitly comes through. Any ideas? |
#9
|
||||
|
||||
Your php code works fine for me.
Why not humor me and post it (my guess is line 10 of your template)? Also, which version of vBulletin is this? |
#10
|
|||
|
|||
Here is the page I'm requesting with that EXACT php code:-
http://www.webforumz.com/pagecontent...page=STATICSEO Here is the template which is there as a test:- Product: vBulletin Style: Default Style Title: STATICSEO Template: PHP Code:
Here is the php again just for my sanity:- PHP Code:
I can't understand why this is not working. Ok.... this is really weird.. If I change the last line so it doesnt use a variable, eg:- PHP Code:
Yet if I use it like this:- PHP Code:
The last line is obviously screwing things up a little. Any ideas? |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|