The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Insert HTML or (pre-processed!) PHP file above specific forum Details »» | ||||||||||||||||||||||
Insert HTML or (pre-processed!) PHP file above specific forum
Developer Last Online: Oct 2023
This is a very simple but very powerful hack for VB 3 which I've not been able to find elsewhere so decided to write.
It inserts a named external file (or files) above a specific forum (or forums). I use it to insert some HTML from HTML AND PHP (!) files above specific forums. It works perfectly on my forums with over 28,000 members. It requires editing one file and one template. The amazing thing I discovered is that if the php function used (file_get_contents) is used on a php file, the php is processed BEFORE the file contents are read into the string. The first attached image shows this hack 'including' a php file which dynamically builds a list from a database on a different server into a drop-down list box. The second image shows the inclusion of a banner and beneath it a HTML file showing latest news (which is created automatically). * Updated August 7 2004. Altered the text file to include instructions on how to insert the file at the top of your forum list *. Please note that the forum list instructions are untested. If someone uses it, please let me know if it works ok. One question, though. This hack is so simple but so powerful, howcome nobody has done it before? Or have they already? Show Your Support
|
Comments |
#22
|
||||
|
||||
I have used my hack to display banners above and below threads.
Edit showthread.php and find ********************************************* // ################################################## ########################### // output page eval('print_output("' . fetch_template('SHOWTHREAD') . '");'); ********************************************* and add this code before it: ********************************************* $headerbanner = "<P ALIGN=\"CENTER\" CLASS=\"smallfont\">" . file_get_contents("http://www.url_of_your_script.php?forumid=$forumid&type=h eader") . "</P>"; $footerbanner = "<P ALIGN=\"CENTER\" CLASS=\"smallfont\">" . file_get_contents("http://www.url_of_your_script.php?forumid=$forumid&type=f ooter") . "</P>"; ********************************************* Then in the SHOWTHREAD template, find ********************************************* $navbar ********************************************* and after it, put ********************************************* <if condition="$headerbanner">$headerbanner</if> ********************************************* and find ********************************************* <if condition="$bbuserinfo[field11] == 'Yes'">$quickreply</if> ********************************************* and above it add ********************************************* <if condition="$footerbanner">$footerbanner</if> ********************************************* Then write your php script to output banners depending on what forumid is passed and whether it's the header or footer: PHP Code:
Re your specific code request, I recommend you learn some PHP. PHP Code:
Re displaying banners for whole categories, you might be able to do it, but I don't have time to look into it this year |
#23
|
|||
|
|||
How would you do this if you want to include something on top of every page of the forum?
|
#24
|
||||
|
||||
You wouldn't need to use this hack - use the phpinclude_start template instead.
|
#25
|
|||
|
|||
Quote:
|
#26
|
||||
|
||||
Do a search on vbulletin.com for phpinclude
|
#27
|
|||
|
|||
Hi,
i am going to try, to use the shoutcast status Box, which is availible for vba-portal, on my Forumhome. When i try to include the shoutcast.php below the $navbar it says : Code:
Fatal error: Call to undefined function: fetch_template() in /srv/www/htdocs/web1/html/shoutcast.php on line 68 Code:
eval('$home[$mods[\'modid\']][\'content\'] .= "' . fetch_template('adv_portal_shoutcast') . '";'); th@nks |
#28
|
||||
|
||||
try this, you're eval is a mess as is
PHP Code:
|
#29
|
|||
|
|||
th@nks 4 reply, but i have still this error :
Code:
Fatal error: Call to undefined function: fetch_template() in /srv/www/htdocs/web1/html/shoutcast.php on line 68 here i paste the whole script : PHP Code:
i hade the eval twice, so i have tried also to change the eval below the server settings, but still not working. gr33tz |
#30
|
||||
|
||||
you need to include the global.php
|
#31
|
|||
|
|||
Quote:
Th@nks 4 help but i can't include that. if i use : require_once('./global.php'); into the Header of the php,Forumhome is going to open the shoutcast.php himself on the Index, and i cannot login anymore. gr33tz |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|