MyBB Community Forums

Full Version: Need help with php footer include
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am trying to install the co-op ad network ads onto my forum and in order to do so I must add some code to my footer but I cannot find a php file to do this in. The only thing I could think of is global.php but I wouldn't really know how to implement it. I attached the code that I need to include in my footer below and thank you so much for your help and to the developers for such an awesome free forum software!

<?php
	ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../');
	include ('ad_network_305.php');
	echo $ad_network;
?>
I would learn to use dirname in your include statement Wink

If ad_network_305.php doesn't output anything, add the include statement to global.php and modify your templates to display $ad_network.
Yeah I am not a programming expert but the statement was given to me pre-made but anyway thanks alot, it works now but how would I adjust where the output is displayed? I would like it to be displayed in my footer but it is displayed right now above my header, I tried inserting the code in other parts of global.php but it still didn't show up in the footer, is there any other way to change this? Thanks alot.

Mike
Have you tried going into modify templates and edit the footer? If you've already added that code to your global.php file, I would think you would then just need to add $ad_network to the template footer. I think that's what laie_techie was trying to tell you??
Procedures:

Open global.php
Find:
eval("\$footer = \"".$templates->get("footer")."\";");
Before it, add:
ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../');
include ('ad_network_305.php');
Close, save, and upload global.php

Open the footer template in the Admin CP.
Add the variable $ad_network where you want the ads to appear.
Thanks alot, that solved my problem.