MyBB Community Forums
Add ads/banner inside category - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Plugins (https://community.mybb.com/forum-73.html)
+---- Forum: Plugin Development (https://community.mybb.com/forum-68.html)
+---- Thread: Add ads/banner inside category (/thread-224351.html)



Add ads/banner inside category - liontaris - 08-23-2019

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)


RE: Add ads/banner inside category - GodLess101 - 08-27-2019

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.


RE: Add ads/banner inside category - liontaris - 08-27-2019

Can you give me one example ?


RE: Add ads/banner inside category - GodLess101 - 08-27-2019

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.


RE: Add ads/banner inside category - liontaris - 08-28-2019

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']


RE: Add ads/banner inside category - GodLess101 - 08-28-2019

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.


RE: Add ads/banner inside category - liontaris - 08-29-2019

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} ?


RE: Add ads/banner inside category - GodLess101 - 08-30-2019

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.


RE: Add ads/banner inside category - liontaris - 09-05-2019

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.