vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Header and footer on external page (https://vborg.vbsupport.ru/showthread.php?t=268682)

Domy 08-17-2011 05:37 PM

Header and footer on external page
 
How can I include the header (and navbar) and footer of vBulletin on external page?

kh99 08-17-2011 06:04 PM

Maybe you could create your own vbulletin page (https://vborg.vbsupport.ru/showthread.php?t=228112) that includes the header, footer, and navbar, then include your external page in that (https://vborg.vbsupport.ru/showthread.php?t=24245)

Domy 08-17-2011 06:18 PM

No, I have to add header and footer of vbulletin on wordpress.

Boofo 08-17-2011 06:22 PM

Then you might want to look to the Wordpress sites for that.

Domy 08-17-2011 06:46 PM

I can include an external file into wordpress like this:
Code:

<?php
include 'LINK_TO_INCLUDING_FILE';
?>

Can I export the vbulletin header in a php file?

kh99 08-17-2011 07:00 PM

Quote:

Originally Posted by Domy (Post 2234675)
I can include an external file into wordpress like this:
Code:

<?php
include 'LINK_TO_INCLUDING_FILE';
?>

Can I export the vbulletin header in a php file?

I was thinking about that, the problem is that the header (and other) html produced by vbulletin has relative paths in it, so all the links and the references to css and js files are broken. Maybe someone has an idea about that.

You could probably use iframes and then write scripts to produce the html you want (you'd need one for each separate section I guess, lik have one that generates just the header and navbar, and another that produces just the footer).

--------------- Added [DATE]1313613328[/DATE] at [TIME]1313613328[/TIME] ---------------

OK, I put together this script and called it wp.php, and put it in the vb directory:

PHP Code:

<?php

require_once('./global.php');

if (
$_REQUEST['do'] == 'header')
{
    
$navbits = array('link' => 'location');
    
$navbar render_navbar_template($navbits);
    
$template_name 'wp_top';
}
else if (
$_REQUEST['do'] == 'footer')
    
$template_name 'wp_bottom';


$templater vB_Template::create($template_name);
    
$templater->register_page_templates();
    
$templater->register('navbar'$navbar);
print_output($templater->render());


and I also created two new templates, wp_top and wp_bottom:

wp_top:
HTML Code:

{vb:stylevar htmldoctype}
 <html xmlns="http://www.w3.org/1999/xhtml"<vb:if condition="$vboptions['enablefacebookconnect']"> xmlns:fb="http://www.facebook.com/2008/fbml"</vb:if> dir="{vb:stylevar textdirection}" lang="{vb:stylevar languagecode}" id="vbulletin_html">
<head>
        {vb:raw headinclude}
        {vb:raw headinclude_bottom}
</head>

<body>

{vb:raw header}

{vb:raw navbar}
</body>
</html>


wp:bottom:
HTML Code:

{vb:stylevar htmldoctype}
 <html xmlns="http://www.w3.org/1999/xhtml"<vb:if condition="$vboptions['enablefacebookconnect']"> xmlns:fb="http://www.facebook.com/2008/fbml"</vb:if> dir="{vb:stylevar textdirection}" lang="{vb:stylevar languagecode}" id="vbulletin_html">
<head>
        {vb:raw headinclude}
        {vb:raw headinclude_bottom}
</head>

<body>

{vb:raw footer}

</body>
</html>


and then I created this html file to test it:
HTML Code:

<html><head><title>Test</title></head>
<body>
    <div><iframe src="forum4/wp.php?do=header" frameborder="0" scrolling="no" width="100%"/></div>
    This is the body.
    <div><iframe src="forum4/wp.php?do=footer" frameborder="0" scrolling="no" width="100%"/></div>
</body>
</html>


The navbits section is a problem, I don't know what to set it to, but I suppose you could just remove it from the template.

Anyway, I hope this helps.


All times are GMT. The time now is 08:58 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.02566 seconds
  • Memory Usage 1,737KB
  • 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
  • (3)bbcode_html_printable
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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