Maksim.Zaikin
09-05-2016, 04:30 AM
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.
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.