How to put ad spots between posts ?? - Posted (2119 Views)
Starting Member
Running925
Posts: 28
28
I'm interested in finding out how i can automate a snipit of code to pop in-between every so many posts for ad space.
Any help would be appreciated.
Thank

tony

<moved from="Help: General / Current Version (v3.4.xx)" by="Shaggy" />
 Sort direction, for dates DESC means newest first  
 Page size 
Posted
Senior Member
leatherlips
Posts: 1838
1838
Have you tried putting inside of a div tag? You could do something like <div align="center">Your Content</div>
Posted
Starting Member
Running925
Posts: 28
28
Originally posted by leatherlips
Have you tried putting inside of a div tag? You could do something like <div align="center">Your Content</div>

yea, it didn't seem to work...
Posted
Development Team Leader
Classicmotorcycling
Posts: 2085
2085
Have you tried putting a simple align tag in:

if ( iForum Mod 3 = 0 ) then
Response.Write "<tr>" & VbCrLf & _
" <td bgcolor=""" & CColor & """ align=""center"" valign=""top"" width=""" & strTopicWidthLeft & """ colspan=""3"">" & VbCrLf %>
<!--#INCLUDE FILE="midpost.html"--><%
Response.Write " </td>" & VbCrLf & _
"</tr>"
end if
Cheers,

David Greening
Posted
Junior Member
balexandre
Posts: 418
418
the proper css rule if using a div is

.googleads { width: 100%; text-align: center; }

you can easily add this into your midpost.html file.

the problem you had when inserting the Google Code in your code is the breakin's, you have to break each line in VBScript, the include file is always the best way to go as it turns your script much more accessible for later updates.
Posted
Junior Member
phoenixtaz13
Posts: 129
129
hi.. Good day to all.... :)

how can u make ads appear only once or twice?... and if a forum topic reaches 2 or 4 pages, how can u make ads appear once or twice per page?... coz what i remember with Google adsence TOS, u can only have maximum of 3 ads displayed in a page.
Posted
Junior Member
balexandre
Posts: 418
418
easy, instead of

if ( iForum mod 2 = 0 ) ... witch says: every time 2nd time use:

if ( iForum mod cInt( (iReplyCount + 1) / (ads2show + 1) ) = 0 ) ...

witch will say something like:

divide the number of posts by the ads to show plus 1, plus 1 so we put the ad in the middle and not at the end.
remember to add, if using the variable,

dim ads2show in the config.asp file

work:

4 replies to a post, and we want to add 2 ads:

5 / 3 = 1.666 (cInt will convert to 2 - so, every 2)

1 - post
2 - 1st reply
------------------ AD
3 - 2nd reply
4 - 3rd reply
------------------ AD
5 - 4th reply


You Must enter a message