PDA

View Full Version : Header and footer on external page


Domy
08-17-2011, 05:37 PM
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:
<?php
include 'LINK_TO_INCLUDING_FILE';
?>
Can I export the vbulletin header in a php file?

kh99
08-17-2011, 07:00 PM
I can include an external file into wordpress like this:
<?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 1313613328 at 1313613328 ---------------

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

<?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:
{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:
{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><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.