Log in

View Full Version : Plug-in help


idnguy
07-29-2011, 12:39 PM
Hi,

I created a plug-in to rotate a couple of ads as so, and named the file http://myforum.com/ads.php.


<?

$r_i=rand(0,1);

if ($r_i == 0)
{
echo "ad 1";

}
else
{

echo "ad 2";
}


?>



I created the plug-in with the code:


ob_start();
include('http://myforum/ads.php');
$myads = ob_get_contents();
ob_end_clean();



But when I access the code in the navbar template using $myads, no html shows up.

Any idea why?

We're on 3.8.4

Lynne
07-29-2011, 03:24 PM
What hook location are you using for your plugin?

idnguy
07-29-2011, 07:10 PM
What hook location are you using for your plugin?

I'm using global_start

The plug-in is active and the execution order is 5

Also, I tried both

$myads and $GLOBAL[myads] and nothing happens. The forum loads fine, but the php file is not getting included.

--------------- Added 1311973683 at 1311973683 ---------------

OK, the file include wasn't working so I put the code into variables in the plug-in editor box and it works that way.