The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
Hi,
Since the past two days, the only thing I'm trying to do with vBulletin is to display a login form or a user information box (when the user is logged in) on every pages of the site, including those not in vBulletin. That's it -- nothing fancy. I do not need or want full integration capabilities -- just display a user information box or a login box whether the user is logged in or not. I followed a tutorial I found on this site and tried to make a page outside of vBulletin's directory and still use vBulletin's API. Even though I followed the instructions to the letter, I can't make a page outside vBulletin. I get the following error message: Quote:
Any help will be appreciated. Thanks in advance! |
#2
|
||||
|
||||
![]()
You should post the code so people can see it.
|
#3
|
|||
|
|||
![]()
Here it is:
Code:
<?php // https://vborg.vbsupport.ru/showthread.php?t=98009 // ######################## 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', 'test'); // #################### 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 'pn_test', ); // pre-cache templates used by specific actions $actiontemplates = array(); // ########################## REQUIRE BACK-END ############################ $forumdir = $pnsite->getConfig('forumdir'); chdir($forumdir); require_once('./global.php'); // I checked the "forumdir" above and the path is correct // since the file "global.php" gets loaded. // #################### 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'; $navbits = construct_navbits($navbits); eval('$navbar = "' . fetch_template('navbar') . '";'); print_output($navbar); // change the line below to contain the name of the actual main output template used in your script eval('print_output("' . fetch_template('pn_test') . '");'); Quote:
|
#4
|
||||
|
||||
![]()
What are you spitting out though? I see you eval your template pn_test, but nothing is there to go into pn_test - perhaps post that template. Also, I hope you have a closing php tag at the end ("?>")? And, I don't think you need the line "print_output($navbar);"
|
#5
|
|||
|
|||
![]()
I usually don't put closing tags when I only have PHP code in my file. See "Instruction separation" in PHP documentation.
Execution errs at "global.php". Anything after that is not executed. --------------- Added [DATE]1218043772[/DATE] at [TIME]1218043772[/TIME] --------------- I forgot to mention the custom template "pn_test" simply contains "TEST". |
#6
|
||||
|
||||
![]()
Does it work if you do the following:
PHP Code:
|
#7
|
|||
|
|||
![]()
No. Still the same happens -- no different.
|
#8
|
||||
|
||||
![]()
What version of VB are you running ?
|
#9
|
||||
|
||||
![]()
Um, I just noticed something.... you didn't really create a template that only has the word "TEST" in it, did you? It needs to be html compliant. ie:
HTML Code:
$stylevar[htmldoctype] <html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]"> <head> <title>$vboptions[bbtitle]</title> $headinclude </head> <body> $header $navbar <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center"> <tr> <td class="tcat" colspan="2">Title</td> </tr> <tr> <td class="alt1" colspan="2">Text</td> </tr> </table> $footer </body> </html> |
#10
|
|||
|
|||
![]()
I really don't see how the following can work:
PHP Code:
|
![]() |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|