I want to harmonize my newly installed forum with the rest of my site. For this, I use xmlrpc to pull the site's html header in the hope of using same html code in the forum header.
I wrote the following plugin, using global_start as the hook. The code looks like this :
Code:
require_once('xmlrpclibrary.inc');
$m = new xmlrpcmsg('method.name');
$c = new xmlrpc_client("/xmlrpc.php", "mydomain.com", 80);
$r = $c->send($m);
if (!$r->faultCode()) {
$v = $r->val->me['string'];
}
$myhtmlheader = print $v;
*************
And then I put {vb:raw myhtmlheader} in the header template. Unfortunately, the result is output before anything else on the page (before the html <head> tag, before the DOCTYPE even, etc.).
I've also tried to replace the last line with:
Code:
ob_start();
print $v;
$myhtmlheader = ob_get_contents();
ob_end_clean;
but that doesn't seem to output anything in the template.
Any idea about what I'm doing wrong ?
Many thanks