View Full Version : How to include vbulletin EXTERNALLY?
jacksony
12-22-2009, 04:21 AM
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!
ExTincTi0N
12-22-2009, 05:17 AM
So are you trying to make a page thats run off of vbulletin?
Vaupell
12-22-2009, 06:41 AM
create a php page
myphppage.php
<?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. :D
jacksony
12-22-2009, 06:44 AM
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 1261472610 at 1261472610 ---------------
"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 1261515902 at 1261515902 ---------------
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');?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.