PDA

View Full Version : [Adv. Coding] vBulletin Customize


Sergio68
10-27-2006, 01:12 PM
I'm trying to merge an e-commerce with the vbulletin.

I made a customized page, a customized vBMenu, but I can't see the PHP output other than variables, why ?

In the manual is told that I can have the complete output : http://www.vbulletin.com/docs/html/templates_externalfiles

"Most PHP files that you might wish to include in your forum contain echo or other output statements in your PHP file, it will break vBulletin because it is still in the process of initializing when it loads your PHP file. All echo and other output commands must be output buffered using ob_start, ob_clean, etc. commands. The output of your PHP script will be buffered for later use and inserted into a variable. All other statements in the PHP script will execute normally."

Sergio68
10-30-2006, 07:48 AM
It seems I can show the buffer output now, I don't know how but it works.

Something weird is going on anyway, I included in the template the PHP file with the
ob_start();
include('./products.php');
$products = ob_get_contents();
ob_end_clean();
as told.

This is the file products.php
<?php
$my_variable="One";
echo"2";
include ('textprova.txt');
echo"4";

?>

This is textprova.txt
echo"3";

In the template i show this variables :

$my_variables (that contain One)
and
$products (that should show the buffered output from the included file.

That's what I see :

One 2 echo"3"; 4
instead of
One 2 3 4

Does it make any sense ? :rolleyes: