Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-29-2004, 05:03 PM
djohn djohn is offline
 
Join Date: Feb 2004
Posts: 165
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 03-30-2004, 05:32 AM
RGSerge's Avatar
RGSerge RGSerge is offline
 
Join Date: Feb 2003
Location: United Kingdom
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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') . '");'); 
Reply With Quote
  #3  
Old 03-30-2004, 12:21 PM
djohn djohn is offline
 
Join Date: Feb 2004
Posts: 165
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #4  
Old 03-30-2004, 05:48 PM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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'); 
Reply With Quote
  #5  
Old 03-30-2004, 05:50 PM
RGSerge's Avatar
RGSerge RGSerge is offline
 
Join Date: Feb 2003
Location: United Kingdom
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 03-31-2004, 01:03 PM
djohn djohn is offline
 
Join Date: Feb 2004
Posts: 165
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

After some stress found this topic: https://vborg.vbsupport.ru/showthrea...4&page=1&pp=15 where I found everything i needed. Thanks, everyone!
Reply With Quote
  #7  
Old 03-31-2004, 02:36 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #8  
Old 03-31-2004, 02:56 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There's nothing wrong with Gary's code at all Zachery
Reply With Quote
  #9  
Old 03-31-2004, 03:04 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nothing wrong with it at all execpt Zach came up with it first.
Reply With Quote
  #10  
Old 03-31-2004, 04:20 PM
13th_Disciple 13th_Disciple is offline
 
Join Date: Jan 2003
Posts: 262
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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..
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:45 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.07294 seconds
  • Memory Usage 2,284KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (4)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete