Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 How to put ad spots between posts ??

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!
Before posting, make sure you have read this topic!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
Running925 Posted - 03 September 2009 : 13:54:05
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" />
15   L A T E S T    R E P L I E S    (Newest First)
balexandre Posted - 05 September 2009 : 21:19:20
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


phoenixtaz13 Posted - 05 September 2009 : 20:50:30
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.

balexandre Posted - 05 September 2009 : 07:51:52
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.

Classicmotorcycling Posted - 05 September 2009 : 02:03:28
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
Running925 Posted - 05 September 2009 : 00:01:16
quote:
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...
leatherlips Posted - 04 September 2009 : 18:54:14
Have you tried putting inside of a div tag? You could do something like <div align="center">Your Content</div>
Running925 Posted - 04 September 2009 : 16:41:35
you guys are Awesome!!

that worked HuwR

ony thing i'm tryin go square away now is i can't seem to get the ad to center it self in that cell. I've tried multiple ways to align it center (css / hard center) and i think the forum's propertys are taking priority on that because it continues to flush left on me.

If anyone has a suggestion then please toss it out there, i'd love to give it a shot. Otherwise, i might just live with it, at least it's on there!!

thanks again for the help guys.
HuwR Posted - 04 September 2009 : 15:40:57
you can't use the include directive inside a response.write, it will not work, you have to end the script first so you would have to do

if ( iForum Mod 3 = 0 ) then
Response.Write "<tr>" & VbCrLf & _
"<td bgcolor=""" & CColor & """ valign=""top"" width=""" & strTopicWidthLeft & """ colspan=""3"">" & VbCrLf %>
<!--#INCLUDE FILE="midpost.html"-->
<% Response.Write "</td></tr>"
end if
AnonJr Posted - 04 September 2009 : 15:03:57
Try:
if ( iForum Mod 3 = 0 ) then 
Response.Write "<tr>" & VbCrLf & _
"<td bgcolor=""" & CColor & """ valign=""top"" width=""" & strTopicWidthLeft & """ colspan=""3"">" & VbCrLf & _
" <!--#INCLUDE FILE=""midpost.html""-->" & VbCrLf & _
"</td></tr>" 
end if
Running925 Posted - 04 September 2009 : 11:19:47
Even if i go like this:

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


with nothing but some txt in the midpost file, it still gives me an error that states: Expected end of statement at the first "
Running925 Posted - 04 September 2009 : 10:58:01
Now i'm having a problem puting my adsense code in the spot where the txt is displaying. It thinks it's the end of a statement when it sees the google script...

This is what i've done: (Whats wrong here?)


if ( iForum Mod 2 = 0 ) then
Response.Write "<tr>" & VbCrLf & _
"<td bgcolor=""" & CColor & """ valign=""top"" width=""" & strTopicWidthLeft & """ colspan=""3"">"

& VbCrLf & _
" <script type="text/javascript"><!--
google_ad_client = "pub-7561796924071765";
/* 728x90, created 9/4/09 */
google_ad_slot = "1131326765";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script> " & VbCrLf & _
"</td></tr>"
end if

Running925 Posted - 04 September 2009 : 10:41:58
n/mind, i figure it out!
Running925 Posted - 04 September 2009 : 10:17:42
ok.. idk if my file is different or what but i'm having a hard time making this work. I put that code in on the line you said and it failed. so i moved it to where i thought it looked right (to me) and it poped in after the first post and nowhere else...

any suggestions?
balexandre Posted - 04 September 2009 : 09:46:17
see how easy it was
Running925 Posted - 04 September 2009 : 09:18:48
that is exactly what i was looking for.

thanks a ton!! :)

Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.07 seconds. Powered By: Snitz Forums 2000 Version 3.4.07