Quote:
Originally Posted by Domy
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.