The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
VB5 create custom php with design
Hi,
have a problems with custom php pages. I did create a page by using a built in options, drop here php module, and put int here following code (for test and see what happens) <?php // ####################### SET PHP ENVIRONMENT ########################### error_reporting(E_ALL & ~E_NOTICE); // #################### DEFINE IMPORTANT CONSTANTS ####################### define('THIS_SCRIPT', 'test'); define('CSRF_PROTECTION', true); // change this depending on your filename // ################### 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('TEST', ); // pre-cache templates used by specific actions $actiontemplates = array(); // ######################### REQUIRE BACK-END ############################ // if your page is outside of your normal vb forums directory, you should change directories by uncommenting the next line // chdir ('/path/to/your/forums'); require_once('./global.php'); // ################################################## ##################### // ######################## START MAIN SCRIPT ############################ // ################################################## ##################### $navbits = construct_navbits(array('' => 'Test Page')); $navbar = render_navbar_template($navbits); // ###### YOUR CUSTOM CODE GOES HERE ##### $pagetitle = 'My Page Title'; // ###### NOW YOUR TEMPLATE IS BEING RENDERED ###### $templater = vB_Template::create('TEST'); $templater->register_page_templates(); $templater->register('navbar', $navbar); $templater->register('pagetitle', $pagetitle); print_output($templater->render()); ?> after that page become broken with following error : Warning: require_once(/volume1/web/sakhdrc.com/includes/vb5/frontend/controller/global.php): failed to open stream: No such file or directory in /volume1/web/sakhdrc.com/includes/vb5/frontend/controller/bbcode.php(210) : eval()'d code on line 27 Fatal error: require_once(): Failed opening required '/volume1/web/sakhdrc.com/includes/vb5/frontend/controller/global.php' (include_path='.') in /volume1/web/sakhdrc.com/includes/vb5/frontend/controller/bbcode.php(210) : eval()'d code on line 27 Now i don't understand how to edit this page and delete custom php code. Besides that i do not understand how to create pages, i mean i want to build main page so when user is visiting my site www.site.org, it automatically open mainpage.php, with it's own design. Any help is highly appreciated. |
#2
|
||||
|
||||
It's looking forbthe global.php in /includes/vb5/frontend/controller directory which is not correct, right? I suggest you use absolute path instead of relative path.
And when you use PHP module, you don't need to use <? ?> tags. |
Благодарность от: | ||
MarkFL |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|