vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Custom Page (https://vborg.vbsupport.ru/showthread.php?t=63136)

djohn 03-29-2004 05:03 PM

Custom Page
 
I have a little fancy gallery script, that I would like to be part of my board (3.0 Gold). All I need is somehow include() the script in a custom vB page, that has the usual menu, and footer. I want the gallery to open up in vb, when i call forums/gallery.php. I can add the link in the navigation bar myself, but i've no ide how can I make the gallery look like part of vB (with navbar, footer, etc), just on a separate page.

Any ideas?

RGSerge 03-30-2004 05:32 AM

Quote:

Originally Posted by djohn
I have a little fancy gallery script, that I would like to be part of my board (3.0 Gold). All I need is somehow include() the script in a custom vB page, that has the usual menu, and footer. I want the gallery to open up in vb, when i call forums/gallery.php. I can add the link in the navigation bar myself, but i've no ide how can I make the gallery look like part of vB (with navbar, footer, etc), just on a separate page.

Any ideas?


I haven't tested this, but it should in logic work, I have tried to make variables and things respective to your problem.

PHP Code:

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS'1);
define('THIS_SCRIPT''gallery');

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups (add which ones you want)
$phrasegroups = array(

);

// get special data templates from the datastore (add what ones you want)
$specialtemplates = array(

);

// pre-cache templates used by all actions (add the templates you are using)
$globaltemplates = array(
    
'GALLERYHOME',
        
'gallery_table',
        
'gallery_row'
);


// pre-cache templates used by specific actions
$actiontemplates = array();



// ######################### REQUIRE BACK-END ############################
require_once('./global.php'); // always needed

// Plus any others you need


// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################



// Do your processing here
// Parse templates you need like this:
eval('$template_handle = "' fetch_template('template_name') . '";');

// There must be a matching $template_handle in your 
// "base template", "GALLERYHOME" for these templates to show
// Construct GALLERYHOME using something like FORUMHOME as a guide,
// it will give you your basic vbulletin layout. There are some generic 
// plage layout templates, I *think* you could use these.


// Print out the page
eval('$navbar = "' fetch_template('navbar') . '";');
eval(
'print_output("' fetch_template('GALLERYHOME') . '");'); 


djohn 03-30-2004 12:21 PM

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?

Velocd 03-30-2004 05:48 PM

You want to route the address ./forums/gallery/index.php to ./forums/gallery.php?

This could be done easily enough through your server's Cpanel url redirects.

As for integrating the gallery, just use the template above in Serge's post and place the object declaration ($idx = new gallery) below:

PHP Code:

require_once('./global.php'); 

You should place the class in a separate file.

You'll have to configure the vB PHP file to then contain:

PHP Code:

require_once('./class_gallery.php');

chdir('../');
require_once(
'./global.php'); 


RGSerge 03-30-2004 05:50 PM

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.

djohn 03-31-2004 01:03 PM

After some stress found this topic: https://vborg.vbsupport.ru/showthrea...4&page=1&pp=15 where I found everything i needed. Thanks, everyone!

Zachery 03-31-2004 02:36 PM

Quote:

Originally Posted by djohn
After some stress found this topic: https://vborg.vbsupport.ru/showthrea...4&page=1&pp=15 where I found everything i needed. Thanks, everyone!

Garys isnt exactly the best ;) try my sig

Dean C 03-31-2004 02:56 PM

There's nothing wrong with Gary's code at all Zachery :)

Boofo 03-31-2004 03:04 PM

Nothing wrong with it at all execpt Zach came up with it first. ;)

13th_Disciple 03-31-2004 04:20 PM

pissin contests are now cut off for you since you have become a mod, boofo.. leave that to us nobodies down here with our bellies to the floor..


All times are GMT. The time now is 10:15 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01199 seconds
  • Memory Usage 1,774KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (4)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete