MyBB Community Forums

Full Version: Add ads/banner inside category
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
dear all ,

I need a help...
I create a new forum and i need to add a banner in every category / sub category
(please see the attached file)
You could use Template PHP/Conditionals to check if Forum ID (FID) is the correct one then hardcode your ad/banner.

Other than that you could get someone to code a plugin for you where you can create ads/banners for each or multiple forums.
Can you give me one example ?
Using this plugin http://mybbhacks.zingaburga.com/showthread.php?tid=260

or a more restricted version

http://mybbhacks.zingaburga.com/showthread.php?tid=464

Inside your "forumdisplay" template under "Forum Display Templates" you can add somewhere the following


<if $foruminfo['fid'] == YOUR_FID_WHERE_TO_DISPLAY then>
    <div>YOUR THING GOES HERE</div>
</if>

an example would be

<if $foruminfo['fid'] == 5 || $foruminfo['fid'] == 6 then>
    	<div style="margin:auto;text-align:center;height:30px;line-height:30px;border-radius:3px;background:#999;max-width:20%;margin-bottom:10px;"><a href="upgrade.php">CLICK HERE TO UPGRADE NOW!</a></div>
	</if>

This would show a small rounded box saying upgrade now if the forum id was either 5 or 6.

Place this below {$header} in your template.
thank you very much ,

i will try it today !

Thank you again

Succeeded with using this plugin http://mybbhacks.zingaburga.com/showthread.php?tid=260 .

GodLess101 do you know if exist also for postbit? (for the showthread ['tid']
For the postbit? I'm not sure what you mean? You want it to above the thread when you go to read a thread, that is not anything to do with the postbit.

Inside your templates scroll down to the Show Thread Templates and go inside your Showthread template.

You can use the corresponding variables {$thread['tid']} for THREAD ID or {$thread['fid']} for the forum id the thread is in.
This should do the trick for you.
Thats exactly I mean inside threads

so i have to enter that?
<if $thread['tid'] == YOUR_FID_WHERE_TO_DISPLAY then>
<div>YOUR THING GOES HERE</div>
</if>

below {$header} ?
Well depends what you want to do? for it to work on all threads inside a specific forum id you need to use the thread['fid'] but if it's only ínside THE THREAD with the TID == SOMETHING which you should know by now is a unique ID and is therefore only one thread.

Goodluck.
Thank you GodLess101 again for the help .

One more question .
Banner under the post is available to insert ( i mean in a thread or to a subforum) .

Thanks in advance.