vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   opening a php ... (https://vborg.vbsupport.ru/showthread.php?t=268591)

DjEddie 08-15-2011 10:49 PM

opening a php ...
 
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

Quote:

Originally Posted by DjEddie (Post 2233928)
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 :)

kh99 08-16-2011 10:59 AM

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

Quote:

Originally Posted by kh99 (Post 2234129)
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:
Code:

ob_start();
  require_once('/home/****/public_html/****/shoutcast/index.php');
  $php_include = ob_get_contents();
ob_end_clean();
vB_Template::preRegister('FORUMHOME',array('php_include' => $php_include));

using in the templete "forumhome"

using the hook:
Code:

{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

kh99 08-16-2011 02:37 PM

Maybe try this:

PHP Code:

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_include' => $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 ..


All times are GMT. The time now is 12:37 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.01256 seconds
  • Memory Usage 1,731KB
  • 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
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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