Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 05-24-2006, 05:08 AM
bigtime bigtime is offline
 
Join Date: Jun 2002
Location: Houston, Texas
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Please help me tweak my outside vb directory page...

Hi,

I have a php script that has a header and footer file. I want to use the vbulletin header and footer for the script.

If I'm going about this the wrong way, please let me know. If I'm on the right track, please tell me how to display this code
PHP Code:
$testing "this is a test";
echo 
'This is my content and here is the value of $testing'
which is near the bottom of my sample page below. My code is showing everything but that code and it can be seen in action here: http://www.rental-script.com/review_test/test2.php


PHP Code:
<?php

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

// ##################### DEFINE IMPORTANT CONSTANTS #######################
// change the line below to the actual filename without ".php" extention.
// the reason for using actual filename without extention as a value of this constant is to ensure uniqueness of the value throughout every PHP file of any given vBulletin installation.

define('THIS_SCRIPT''test2'); 

// #################### 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(
        
// change the lines below to the list of actual templates used in the script
        
'test_header',
        
'test_footer',
);

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

// ########################## REQUIRE BACK-END ############################
chdir('../testvb');
require_once(
'./global.php');  

// #################### HARD CODE JAVASCRIPT PATHS ########################
$headinclude str_replace('clientscript'$vbulletin->options['bburl'] . '/clientscript'$headinclude);

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

$navbits = array(); 
// change the line below to contain whatever you want to show in the navbar (title of your custom page)
$navbits[$parent] = 'Test Page';

$navbits construct_navbits($navbits);
eval(
'$navbar = "' fetch_template('navbar') . '";');

$title "this is my title";

// change the line below to contain the name of the actual main output template used in your script
eval('print_output("' fetch_template('test_header') . '");');

/* I want to show this code" */
$testing "this is a test";
echo 
"This is my content and here is the value of $testing";

eval(
'print_output("' fetch_template('test_footer') . '");');
?>

Thanks,

Tim
Reply With Quote
  #2  
Old 05-24-2006, 12:35 PM
Rich's Avatar
Rich Rich is offline
 
Join Date: Mar 2004
Location: U.S.A
Posts: 921
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If I were doing what you are looking to do, I would create 3 templates instead of 2. I would assign a variable to the test footer and test header like:

PHP Code:
eval('$testheader = "' fetch_template('test_header') . '";');
eval(
'$testfooter = "' fetch_template('test_footer') . '";'); 
and then I would create a third template as:

PHP Code:
eval('print_output("' fetch_template('new_template') . '");'); 
Within the new template, just add $testheader and $testfooter whereever you want them to appear. Between the 2 you can add whatever you like without having to echo anything.
Reply With Quote
  #3  
Old 05-24-2006, 03:29 PM
bigtime bigtime is offline
 
Join Date: Jun 2002
Location: Houston, Texas
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Rich. In my original php script there are 100 different files/pages that are all run with a header/footer.

Is there a way I can add the vb header and footer to the other scripts header/footer file? It seems to me that using the method above, I would need to create 100 templates?

Thanks,

Tim
Reply With Quote
  #4  
Old 05-24-2006, 04:22 PM
Rich's Avatar
Rich Rich is offline
 
Join Date: Mar 2004
Location: U.S.A
Posts: 921
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Before I go and give it a whirl at explaining this, have you considered using a CMS? vBadvanced allows you to pull PHP files in a "module" type of setting. Since vBadvaced is already 100% integrated with vBulletin, this would likely be the easiest way to do this.

It allows you to create pages, in unlimited quantities, using external or internal files and templates. The url would read:

index.php?page=YourPageName

and it would be automatically added to a vb page! For more information on this, check out: http://www.vbadvanced.com

Did I mention it is free? lol

With 100+ pages to add, no matter how you go about doing this, you are looking at some work. I believe this would be the easiest method though.
Reply With Quote
  #5  
Old 05-25-2006, 01:47 AM
bigtime bigtime is offline
 
Join Date: Jun 2002
Location: Houston, Texas
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Even though I have 100 pages in my review script, the header and footer are all controlled by one php file. If I could get that one php file to show the vbulletin header and footer, I'd be set! It doesn't seem like it would be that hard to do!

Thanks again for your input!

Tim
Reply With Quote
  #6  
Old 05-25-2006, 11:36 AM
Rich's Avatar
Rich Rich is offline
 
Join Date: Mar 2004
Location: U.S.A
Posts: 921
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, I think I am officially confused now. lol

HTML Code:
Even though I have 100 pages in my review script, the header and footer are all controlled by one php file.
So you must be using a review script of some sort? I am asking because if this is the case, could you please post what the file contains that is controlling the header and footer so we can see how they are processing it?

I was a bit thrown off because your first post is showing a vb powered page. If the script you are using isn't powered by vb, I don't see how a default vb powered page would work correctly.

Attach the file that controls the header and footer or add the code in PHP tags so we can check it out.
Reply With Quote
  #7  
Old 07-05-2006, 10:19 PM
fringehead fringehead is offline
 
Join Date: Nov 2004
Posts: 80
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

He wants to know how to inlcude the login info into the header of his website so people can "log into" the other non-vb pages. He doesn't want to use any vb templates "inside" of vbulletin.

At least that's how I see it. I want to do the exact same thing? Any help?

Thanks,

Sean
Reply With Quote
Reply

Thread Tools
Display Modes

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 08:05 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04445 seconds
  • Memory Usage 2,238KB
  • Queries Executed 13 (?)
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
  • (1)bbcode_html
  • (4)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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_postinfo_query
  • fetch_postinfo
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete