Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
  #1  
Old 08-15-2011, 10:49 PM
DjEddie DjEddie is offline
 
Join Date: Nov 2007
Posts: 244
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 08-15-2011, 11:17 PM
EquinoxWorld EquinoxWorld is offline
 
Join Date: Nov 2009
Location: Naples
Posts: 354
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by DjEddie View Post
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.
Reply With Quote
  #3  
Old 08-16-2011, 07:49 AM
DjEddie DjEddie is offline
 
Join Date: Nov 2007
Posts: 244
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #4  
Old 08-16-2011, 10:59 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think using the method from the article should have worked. Can you post the exact code you used (and the hook location)?
Reply With Quote
  #5  
Old 08-16-2011, 02:33 PM
DjEddie DjEddie is offline
 
Join Date: Nov 2007
Posts: 244
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
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
Reply With Quote
  #6  
Old 08-16-2011, 02:37 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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)); 
Reply With Quote
  #7  
Old 08-16-2011, 02:51 PM
DjEddie DjEddie is offline
 
Join Date: Nov 2007
Posts: 244
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ive sent u a pm ..

it still doesn't show after using the code you gave there ..
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:36 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03912 seconds
  • Memory Usage 2,220KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete