Hi
On smartphones it’s only really possible to see adverts in the header as sidebars aren’t really visible. Is there anyway to insert an advert between posts or forums It would be handy to have
Hi
On smartphones it’s only really possible to see adverts in the header as sidebars aren’t really visible. Is there anyway to insert an advert between posts or forums It would be handy to have
Hey Alan,
Yes you can place adverts wherever you like really! Take a look at How to display ads in the forum.
Just remember if you’re using Unified as your mobile theme you will need to place adverts inside the mobile rules of the template’s, and if you’re using Reboot, you will need to place adverts inside the mobile templates (in their own folder).
Hope that helps! Ask if you need any further help.
it went really well thanks
I had to ftp and edit the mobile theme as it wasnt accessible via theme editor like the default theme
The help page was really good. I would like to repeat an advertisement every 10th post as a topic can have inumerable posts. Is there an easy way to do this?
Also is there a way to specify which forum or topic specifically the ads can appear in as the template file is used for all topics
Thanks!
I see now it inserts the advert on each page which is what i was looking for.
It would be good to know what could be specified in the ‘if’ statement to check which forum the topic belongs to as I’d like to run with different ads for each forum.
Is this possible?
I guess the depth of my answer will depend a little on how good you php is 
So I will start off assuming you know you way around it. If you go to the forum admin > Toolbox > Data Inspector you can turn on options that will display for you the underlying data used to populate all the main forum views.
So – for example – if you wanted to work with the forum view (index listing of topics) – turn on either ‘spForumView’ which will display ALL of the data for the entire page – or – ‘spThisForum’ which will show you the data for each individual entry.
This is a window onto the data objects that are created for the page display and is all available with the main objects already globalised for custom use.
Does this help get you started?
Oh – by the way – the person who turned them on to see them is the only one they will be shown to.
Ahh PHP isn’t something I know much about so I think I would be looking to purchase professional services instead of messing up the forums
do you have a rate card anywhere?
also I has to drop the The JavaScript element from the HTML for the advertisement as I kept getting errors on forum page. The echo syntax required an open and closed single quote around the HTML code but the syntax for the JavaScript also used single quotes in several places which I think was screwing up the php file. The messAge referred to line where JavaScript code was written and said it was expecting a ‘ or ;
I have looked around on online forums to see how this can be overcome but haven’t see anything yet.
The key to that is that you can not mix quote types. So ALL of the quotes in the JavaScript need to be one type (say single) and then you surround the whole lot with the other type (double) for the echo statement. Or visa versa.
So if you can recap in some detail about what you want to accomplish and where we should be able to get you working,
Hello,
OK I got the javascript to work , thanks
With the code you have already provided I can already post adds after the 1st,5th,9th post on each page for every topic on every forum. I just wondered if I could make a further specification that forum=x and post is 1st ,5th ot 9th or forum=y and post is 1st,5th or 9th so it will allow me to place different ads on pages for different forums.
Thanks!
You can determine the forum number using the property:
$spThisTopic->forum_id
and the forum ID’s, of course, are all shown on the admin Manage Groups and Forums listing,
If you need any help phrasing the actual php ‘if’ statement then shout but it would be useful to know what you have coded already and what it is exactly you want…
I hope that helps.
Hello,
ok so I have something like this already in place
if($spTopicView->currentPost==6)
{echo “………”;} and I have the html placed here
I need the condition for the current post to be satisfied on the ‘if’ statement as as well as the forum id equalling that of one of my forums..
Thanks
Alan
simply:
if ( $spTopicView->currentPost == 6 && $spThisTopic->forum_id == X )
Where X = the id of the forum in question.