vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Please help me tweak my outside vb directory page... (https://vborg.vbsupport.ru/showthread.php?t=116527)

bigtime 05-24-2006 05:08 AM

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

Rich 05-24-2006 12:35 PM

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.

bigtime 05-24-2006 03:29 PM

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

Rich 05-24-2006 04:22 PM

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.

bigtime 05-25-2006 01:47 AM

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

Rich 05-25-2006 11:36 AM

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.

fringehead 07-05-2006 10:19 PM

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


All times are GMT. The time now is 12:21 AM.

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.01089 seconds
  • Memory Usage 1,749KB
  • 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
  • (1)bbcode_html_printable
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete