The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
I know it has been discussed, however I am still quite doubtful about this.. How do I correctly include a vbulletin into an external php page?
I tried adding this in the external script: chdir ('/var/www/vhosts/*******.com/httpdocs/forums'); require_once('./global.php'); include('./index.php'); But it is just showing a white screen, with error: <b>Fatal error</b>: Cannot redeclare class vB_Bootstrap_Forum in <b>/var/www/vhosts/nanzinc.com/httpdocs/forums/includes/class_bootstrap.php</b> on line <b>1443</b><br /> Even if i remove global.php line, it don't shows ![]() Pls advise! Thanks! |
|
#2
|
|||
|
|||
|
So are you trying to make a page thats run off of vbulletin?
|
|
#3
|
||||
|
||||
|
create a php page
myphppage.php Code:
<?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('MYTEMPLATE',
);
// pre-cache templates used by specific actions
$actiontemplates = array();
// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################
$navbits = construct_navbits(array('' => 'MYTEMPLATE'));
$navbar = render_navbar_template($navbits);
// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'MYTITLE';
// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######
$templater = vB_Template::create('MYTEMPLATE');
$templater->register_page_templates();
$templater->register('navbar', $navbar);
$templater->register('pagetitle', $pagetitle);
print_output($templater->render());
?>
Upload and go into admincp > styles &.....> Add new template call it MYTEMPLATE write your page, html, head, body, content. and save it.. then www.yoursite.link/myphppage.php will show and run the content of your template, and include vb around it. same as usual. almost a direct copy of the article on it.
|
|
#4
|
|||
|
|||
|
yes i am trying to have a page to run vbulletin off it.
Thanks Vau I will try it now. I tried the article ones, but it showed a blank page ![]() --------------- Added [DATE]1261472610[/DATE] at [TIME]1261472610[/TIME] --------------- "include vb around it." what do you mean by above? what is the line that includes VBulletin into the php page? I can't seem to locate it. --------------- Added [DATE]1261515902[/DATE] at [TIME]1261515902[/TIME] --------------- thanks I finally got it to work. However the link i am using is a wordpress permlink: http://***.com/forum/ What do I define for define('THIS_SCRIPT', 'test');? |
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|