Support Forum

Adding more than on ad between posts

MY My
My
Member

I’ve had 1 adsense ad in my forums for a while appearing after the first post based on the info at https://simple-press.com/documentation/codex/faq/problem-with-post-edit-buttonow-to/faq-how-to-display-ads-in-the-forum however if I try to use the second option to insert two ads in (after the first and 4th posts) something isn’t right, I’m guessing it’s just a syntax error but I don’t know enough to know what it is… any suggestions?

5 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

We would need to see your code. Can you paste it here using the Code Syntax Highlighter on the toolbar?

MY My
My
Member

I literally just changed this (which was working fine)

if($spTopicView->currentPost==1){

to this

if($spTopicView->currentPost==1) || ($spTopicView->currentPost==4){
YS Yellow Swordfish
Yellow Swordfish
Member

That is incorrect I am afraid. The way you have it means the if statement has no parentheses for it’s enclosing conditional statement. Should be like this:

if($spTopicView->currentPost==1 || $spTopicView->currentPost==4)

That should do the trick.

MY My
My
Member

Thanks… you might want to update the info via the link I got it from 🙂

YS Yellow Swordfish
Yellow Swordfish
Member

Whoops! Apologies for that. Been corrected.