View Full Version : opening a php ...
DjEddie
08-15-2011, 10:49 PM
Hi,
From inside the forum home template .. i'm wanting to open a php file so that it shows that file clearly on the forum home page... without using an iframe .. obviously the php file is in my root folder ..
Does anyone have the coding I would use to do this please? i've tried to read up about it on php sites but have found some of it a bit confusing to do exactly what i'm wanting ..
Thanks :)
Eddie
EquinoxWorld
08-15-2011, 11:17 PM
Hi,
From inside the forum home template .. i'm wanting to open a php file so that it shows that file clearly on the forum home page... without using an iframe .. obviously the php file is in my root folder ..
Does anyone have the coding I would use to do this please? i've tried to read up about it on php sites but have found some of it a bit confusing to do exactly what i'm wanting ..
Thanks :)
Eddie
If you mean you want to show the output of that php file in your FORUMHOME template then just read this article here: >https://vborg.vbsupport.ru/showthread.php?t=242454 It's rather easy, just a few steps. Hope it helps.
DjEddie
08-16-2011, 07:49 AM
basically ..the file im wanting to add is a shoutcast statistics file that shows the dj and listener count ... im wanting to show this on my forumhome templete page....
by doing what that link u offered above ..it doesnt show up on my site at all ..loading the index.php file on its own tab works ..I just want to incorporate it into the forum home templete without adding all the code into the templete ... hope I explained that ok :)
I think using the method from the article should have worked. Can you post the exact code you used (and the hook location)?
DjEddie
08-16-2011, 02:33 PM
I think using the method from the article should have worked. Can you post the exact code you used (and the hook location)?
Thanks for your help people :)
code is:
ob_start();
require_once('/home/****/public_html/****/shoutcast/index.php');
$php_include = ob_get_contents();
ob_end_clean();
vB_Template::preRegister('FORUMHOME',array('php_in clude' => $php_include));
using in the templete "forumhome"
using the hook:
{vb:raw php_include}
and with doing all this ^^ .. it doesn't show anything at all
correct me if i'm wrong .. doing this should literally put what ever is being used in the "index.php" file (which this file also calls other files for use) onto the forumhome page where I decided to put it?
Thanks
Eddie
Maybe try this:
ob_start();
$cwd = getcwd();
chdir('/home/****/public_html/****/shoutcast');
require_once('index.php');
$php_include = ob_get_contents();
chdir($cwd);
ob_end_clean();
vB_Template::preRegister('FORUMHOME',array('php_in clude' => $php_include));
DjEddie
08-16-2011, 02:51 PM
ive sent u a pm ..
it still doesn't show after using the code you gave there ..
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.