Quote:
Originally Posted by djohn
Here's a better description of what i need.
Forum address: www.site.com/forums/index.php
Image gallery main page address: www.site.com/forums/gallery/index.php
Needed address: www.site.com/forums/gallery.php
Previously, i've used invision, and there i could do this simply by adding the required entry in www.site.com/forums/index.php. For example, if my file was gallery.php, i would add the folowing:
"gal" => "gallery",
And then if I called www.site.com/forums/index.php?act=gal I'd see my gallery. Contents of the gallery.php would be as follows:
Code:
<?php
$idx = new gallery;
class gallery {
var $output = "";
var $page_title = "";
var $nav = array();
var $html = "";
var $base_url = "";
function Articles()
{
global $ibforums, $DB, $std, $print;
require('/home/site/public_html/forums/gallery/index.php');
$print->add_output('');
$print->do_output( array( 'TITLE' => "Gallery", 'JS' => 0, NAV => array( "Gallery" ) ) );
}
}
?>
That would do it in invision, no skin modification would even be required.
The quiestion is, how can i do this in vBulletin, still having it's design, footer and header?
|
Not sure if the above post would do exactly what he wants it to do. This is just a tried and tested way, it works and it works well (see PHP code in attachment, it works).
VB has been built in a way where its very easy to expand upon it and make use of functions while keeping performance at an optimum.
Just try this... put the following code in a PHP file called integrate.php, upload it to your forum directory and run it.
You will be presented with a custom page, using the vbulletin template. header, footer everything.
PHP Code:
<?php
// #######################################################################
// ####################### SET PHP ENVIRONMENT ###########################
// #######################################################################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'gallery');
// #######################################################################
// ######################### PRE-CACHE TEMPLATES #########################
// #######################################################################
$globaltemplates = array(
'GENERIC_SHELL',
'agallery',
'navbar'
);
$specialtemplates = array(
'smiliecache',
'bbcodecache'
);
// #######################################################################
// ######################### REQUIRE BACKEND #############################
// #######################################################################
require_once('./global.php');
// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################
$navbits = array();
$navbits = construct_navbits($navbits);
// Do your processing here (thats the code to get the gallery images into a table
// or whatever it does).
// BTW, the code to parse a template is:
// eval('$HTML = "' . fetch_template('agallery') . '";');
// $HTML is your main content area (the middle bit)
// ### ALL DONE! SPIT OUT THE HTML AND LET'S GET OUTA HERE... ###
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('GENERIC_SHELL') . '");');
?>
Very simple, very powerful, very effective.
Just try it.