Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: MarkoKg on October 09, 2016, 08:52:57 PM

Title: Ads between categories
Post by: MarkoKg on October 09, 2016, 08:52:57 PM
Hello there,

I don't want to use AdManagement or similar mods, as it's quite big and I need only to add an advertisement between two categories on board index.

Any help with that please?

Thanks!
Title: Re: Ads between categories
Post by: vbgamer45 on October 09, 2016, 10:02:33 PM
themes/default/boardindex.template.php
Find

foreach ($context['categories'] as $category)
{
// If theres no parent boards we can see, avoid showing an empty category (unless its collapsed)
if (empty($category['boards']) && !$category['is_collapsed'])
continue;


Add your code after that you can check $category['id'] to see if you need to show the ad before it.