Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 How to put ad spots between posts ??
 New Topic  Reply to Topic
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

Running925
Starting Member

USA
28 Posts

Posted - 03 September 2009 :  13:54:05  Show Profile  Visit Running925's Homepage  Reply with Quote
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" />

Edited by - Shaggy on 04 September 2009 04:48:02

balexandre
Junior Member

Denmark
418 Posts

Posted - 03 September 2009 :  17:01:56  Show Profile  Visit balexandre's Homepage  Send balexandre an ICQ Message  Reply with Quote
quite easy...

open topic.asp file

in the original file (v.3.4.07), at line 683 add:

right before the next in the loop For iForum = 0 to iReplyCount


if ( iForum Mod 2 = 0 ) then 
	Response.Write "<tr>" & VbCrLf & _
                "<td  bgcolor=""" & CColor & """ valign=""top"" width=""" & strTopicWidthLeft & """ colspan=""3"">" & VbCrLf & _
                " [CONTENT OF THE ADD] " & VbCrLf & _
                "</td></tr>" 
end if


Where iForum Mod 2 ... the 2 is the separation, if you want 3 by 3... write

iForum Mod 3


you will end up with something like:



Bruno Alexandre
(Strøby, DANMARK)

"a Portuguese in Danmark"



Edited by - balexandre on 03 September 2009 17:04:28
Go to Top of Page

Running925
Starting Member

USA
28 Posts

Posted - 04 September 2009 :  09:18:48  Show Profile  Visit Running925's Homepage  Reply with Quote
that is exactly what i was looking for.

thanks a ton!! :)
Go to Top of Page

balexandre
Junior Member

Denmark
418 Posts

Posted - 04 September 2009 :  09:46:17  Show Profile  Visit balexandre's Homepage  Send balexandre an ICQ Message  Reply with Quote
see how easy it was

Bruno Alexandre
(Strøby, DANMARK)

"a Portuguese in Danmark"


Go to Top of Page

Running925
Starting Member

USA
28 Posts

Posted - 04 September 2009 :  10:17:42  Show Profile  Visit Running925's Homepage  Reply with Quote
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?
Go to Top of Page

Running925
Starting Member

USA
28 Posts

Posted - 04 September 2009 :  10:41:58  Show Profile  Visit Running925's Homepage  Reply with Quote
n/mind, i figure it out!
Go to Top of Page

Running925
Starting Member

USA
28 Posts

Posted - 04 September 2009 :  10:58:01  Show Profile  Visit Running925's Homepage  Reply with Quote
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


Edited by - Running925 on 04 September 2009 11:03:31
Go to Top of Page

Running925
Starting Member

USA
28 Posts

Posted - 04 September 2009 :  11:19:47  Show Profile  Visit Running925's Homepage  Reply with Quote
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 "
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 04 September 2009 :  15:03:57  Show Profile  Visit AnonJr's Homepage  Reply with Quote
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
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 04 September 2009 :  15:40:57  Show Profile  Visit HuwR's Homepage  Reply with Quote
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
Go to Top of Page

Running925
Starting Member

USA
28 Posts

Posted - 04 September 2009 :  16:41:35  Show Profile  Visit Running925's Homepage  Reply with Quote
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.
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 04 September 2009 :  18:54:14  Show Profile  Visit leatherlips's Homepage  Reply with Quote
Have you tried putting inside of a div tag? You could do something like <div align="center">Your Content</div>

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD
Go to Top of Page

Running925
Starting Member

USA
28 Posts

Posted - 05 September 2009 :  00:01:16  Show Profile  Visit Running925's Homepage  Reply with Quote
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...
Go to Top of Page

Classicmotorcycling
Development Team Leader

Australia
2084 Posts

Posted - 05 September 2009 :  02:03:28  Show Profile  Reply with Quote
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
Go to Top of Page

balexandre
Junior Member

Denmark
418 Posts

Posted - 05 September 2009 :  07:51:52  Show Profile  Visit balexandre's Homepage  Send balexandre an ICQ Message  Reply with Quote
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.


Bruno Alexandre
(Strøby, DANMARK)

"a Portuguese in Danmark"


Go to Top of Page

phoenixtaz13
Junior Member

129 Posts

Posted - 05 September 2009 :  20:50:30  Show Profile  Reply with Quote
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.

Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.22 seconds. Powered By: Snitz Forums 2000 Version 3.4.07