I would like to include file.php on frontpage. http://www.adulu.com/index.php Therefore I try to modify and insert code for "footer" templete as below code <?php include("file.php"); ?> or include("file.php"); or include('file.php'); PHP: but web page echo nothing I think Vbulletin disable something. How can i to do?
Hm, you could try the following. Put this in the php file where you want to include the file. ob_start(); include 'file.php'; $include_contents = ob_get_contents(); ob_end_flush(); PHP: Now go to the admin panel, and add this into the appropriate template: $include_contents PHP: That could work.
ob_start();include 'aduluads.php';$include_contents = ob_get_contents();ob_end_flush(); PHP: Should i insert this code which file or template? I insert in index.php below images currently problem "123" is file contents. left top "123" is unnecessary but it is from this code "ob_start();include 'file.php'....." right top "123" is from $include_contents where i have written left down "123" , I don't know why echo "123" please help me.
It will not work that way. You will need to put the coding into a plugin (stored in a variable), then you will echo that variable in the footer template. But you need to make sure you specify the right place for the plugin (I think it should say something like footer). I will tell you how when I get home. Peace,
Sorry I am late, I totally forgot about it until I visited my Admin panel. 1 - Go to admin control panel - plugin manager 2 - Add a new plugin 3 Product - Vbulletin Hook Location depends on where you want to display your "code". If you want it at the time the system is parsing the template (eg. header, footer) use: parse_templates as the location. Title - enter a title Plugin PHP code - something like global $vbulletin; $custom_info = 'Testing123'; //You can run mysql queries too //$is_test = false; PHP: 4 - Go to styles and template manager 5 - Edit common templates 6 - Place $custom_info where you want "Testing123" to appear. You can also do if statments to true/false variables within the template: <if condition="$is_test"> Test Passed <else /> Test Not Passed </if> PHP: Peace,
I succeed in what i expected. but I have another question how to replace Testing123 with include("aduluads.php"); $custom_info = 'Testing123'; PHP: I have had test below code It won't working fine and got error message $custom_info = 'include("aduluads.php");'; or $custom_info = 'include('aduluads.php');'; or $custom_info = 'include(aduluads.php);'; PHP: aduluads.php contents code <?php include("tadb.php"); $totalads=mysql_query("SELECT * FROM aduluads order by t"); $ta=mysql_num_rows($totalads); srand(time()); $random = (rand()%$ta); $sql="select * from aduluads where t='$random'"; $result=mysql_query($sql); while (list($t,$product) =mysql_fetch_row($result)) { echo $product; } mysql_free_result($result); ?> PHP: thanks for azizny.
Thank you, I found solution by myself. refer to http://www.vbulletin.com/forum/showthread.php?t=173937
i have a similar problem here and would love help: http://forums.digitalpoint.com/showthread.php?t=924602
I have been wrestling with this problem, and finally found the solution that worked for me. I needed to include a php external file in my vbulletin forum. I found the answer here: http://www.vbulletin.com/forum/showthread.php?173937-How-to-Include-a-PHP-or-HTML-File This goes into the 'Add new plugin' page as the php code (no need to use <? opener and closer): ob_start(); include('path/to/this/file/myfile.php'); $includedphp = ob_get_contents(); ob_end_clean(); (obviously get the path correct, using ../../ if required) then paste $includedphp into the location to call in the php file, in my case the footer. I used parse_templates as the hook location. whew, got it sorted at last ... yipee