MyBB Community Forums

Full Version: Adding PHP code
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi everyone!

I'm new to PHP and I need some help to put ads on my MyBB forum.
The advertising company, eXponsor, gives me the ads with PHP code:
// Request ads
$cod_soporte = "XXXXX";
$cod_web = "XXXXX";
$pagina = $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
$inicio = 0;
$cantidad = 10;
$formato = "HTML";

require_once("eXponsor.class.inc.php");
$exponsor = new eXponsor();
$exponsor->set_modo_prueba();
$exponsor->dame_enlaces($cod_soporte, $cod_web, $pagina, $inicio, $cantidad, $formato);
// Show the ads
echo $exponsor->pinta_enlaces_horizontal();

I want to put those ads on every page of my forum, if it's possible.
The ideal place will be under the welcome block. I have edited the header template and added a <div> for the ads, but PHP code doesn't work on templates.
This is how the forum looks with the <div>.
http://www.clanwtf.co.cc/foro/
My question is obvious: How can I fill the <div> with the PHP code?Huh

Lightbulb I also have tried some ads plugins from this page, but none worked.

Thank you.
You'll need to learn how to develop plugins yourself, or ask someone to make one for you (NOT me).