Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
coding-topic
Ad code between groups in fourm-index
Avatar
Frank Mastroianni
Member
Free Members
sp_UserOfflineSmall Offline
Dec 26, 2014 - 1:03 am

I've successfully added ads in the footer and after every specific topic post within a forum, now I am trying to add ads (sorry for the play on words) between each group of forums on my main forum-index page.

How would I go about this?

Thank you.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Dec 26, 2014 - 5:24 am

The template in this case is the spGroupView.php template. The forum groups are contained in a loop which starts with:

if (sp_has_groups()) : while (sp_loop_groups()) : sp_the_group();

and ends with a corresponding:

endwhile; else:

after the call to section end of 'group'.

You will probably want to place your ad code just before that endwhile of the group loop. Anything at that point will display after the forum group and before the start of the next.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Frank Mastroianni
Member
Free Members
sp_UserOfflineSmall Offline
Dec 26, 2014 - 3:42 pm

I'm still not very clear where I should put what code exactly...excuse my lack of knowledge in coding.

The first bit of code you provided is near the beginning of the file while the only place I can find the second bit of code is near the end...there is plenty of code in between.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Dec 26, 2014 - 5:04 pm

That's right. And as I said in post #2, you want tp put your code immediately before that endwhile statement. In other words where marked below:

    sp_SectionEnd('', 'group');
    ### --- your ad code here --- ###
endwhile; else:

Has to be php of course.

andy-signature.png
YELLOW
SWORDFISH
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17363
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625