Results 1 to 1 of 1
-
31st Aug 2011, 09:13 PM #1OPMember
vbulletin 4 php include
I found this on a forum about how to include a php file for vbulletin 4.. im running on v4.1.5 and it doesn't seem to work..
Code:>>plugin using global_start ob_start(); require_once('/var/www/html/LE.php'); $php_include = ob_get_contents(); vB_Template::preRegister('FORUMHOME',array('php_include' => $php_include)); ob_end_clean(); >>in template at footer {vb:raw php_include}
?Hook Location: What area of the forums you want this variable to appear. Don't know where? Use global_start
?Title: Give it a title
?Execution order: Your choice
?Plugin PHP Code:
Code:ob_start(); require_once('LOCATION OF EXTERNAL FILE'); $php_include = ob_get_contents(); ob_end_clean(); vB_Template::preRegister('TEMPLATE YOU ARE USING',array('php_include' => $php_include));
To give you an example of what you should use is that if you want to display your external PHP file on your Forum's Home. Then replace these two with these values:
Hook Location with forumhome_start
TEMPLATE YOU ARE USING with FORUMHOME
Keep in mind that global_start will still be acceptable, but it's extra loading time where it's not needed. Therefore choosing the optimum hook location is better for your performance overall.
Step 3: Visit the Style Manager -> TEMPLATE YOU ARE USING and place the variable in your style where you want it. You will have to use the new format.
Code:{vb:raw php_include}
Notes, If you want to:
Include this PHP file in multiple templates then preRegister it for the multiple templates:
Code:vB_Template::preRegister('TEMPLATE YOU ARE USING',array('php_include' => $php_include)); vB_Template::preRegister('TEMPLATE YOU ARE USING 2?,array('php_include' => $php_include));
Klinzter Reviewed by Klinzter on . vbulletin 4 php include I found this on a forum about how to include a php file for vbulletin 4.. im running on v4.1.5 and it doesn't seem to work.. >>plugin using global_start ob_start(); require_once('/var/www/html/LE.php'); $php_include = ob_get_contents(); vB_Template::preRegister('FORUMHOME',array('php_include' => $php_include)); ob_end_clean(); Rating: 5
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Use php include for certain div of the page
By igordr in forum Web Development AreaReplies: 9Last Post: 25th Aug 2012, 05:54 PM -
[Selling] 4 Website for Sale (include 2 PR2 + 1 PR1)
By freehealthylife.com in forum Completed TransactionsReplies: 5Last Post: 28th Sep 2011, 11:05 AM -
[Hiring] Uploaders to include URl in uploads (for $)
By kiladila in forum Completed TransactionsReplies: 5Last Post: 13th Mar 2011, 09:00 PM -
PHP Include (How To Template Your Site)
By Jesse in forum Tutorials and GuidesReplies: 3Last Post: 14th Jan 2011, 03:43 PM -
[PHP]Include functions scope
By Robin H in forum Web Development AreaReplies: 6Last Post: 10th Jan 2011, 06:01 PM
themaLeecher - leech and manage...
Version 5.03 released. Open older version (or...