The Forum has been Updated
The code has been upgraded to the latest .NET core version. Please check instructions in the Community Announcements about migrating your account.
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" />
Any help would be appreciated.
Thank
tony
<moved from="Help: General / Current Version (v3.4.xx)" by="Shaggy" />
Last edited by Shaggy on 04 September 2009, 04:48
Posted
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
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:
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
Code:
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"
MOD's contribution to Snitz community * Facebook Module *
RSS Snitz Multiple Feed *
Online videos (Youtube, Google video, Flash, Quicktime, etc) *
Add avatar with image crop (on the fly) *
Show last messages in the forum *
Show how many messages since yours IN PAGE TITLE *
Updated version of Gender MOD *
Fly to the top instead of jumping *
an idea: iPhone version of Snitz
<mySnitzForum>GAPE</mySnitzForum>
(Strøby, DANMARK)
"a Portuguese in Danmark"
MOD's contribution to Snitz community * Facebook Module *
RSS Snitz Multiple Feed *
Online videos (Youtube, Google video, Flash, Quicktime, etc) *
Add avatar with image crop (on the fly) *
Show last messages in the forum *
Show how many messages since yours IN PAGE TITLE *
Updated version of Gender MOD *
Fly to the top instead of jumping *
an idea: iPhone version of Snitz
<mySnitzForum>GAPE</mySnitzForum>
Last edited by balexandre on 03 September 2009, 17:04
Posted
that is exactly what i was looking for.
thanks a ton!! :)
thanks a ton!! :)
Posted
see how easy it was
Bruno Alexandre
(Strøby, DANMARK)
"a Portuguese in Danmark"
MOD's contribution to Snitz community * Facebook Module *
RSS Snitz Multiple Feed *
Online videos (Youtube, Google video, Flash, Quicktime, etc) *
Add avatar with image crop (on the fly) *
Show last messages in the forum *
Show how many messages since yours IN PAGE TITLE *
Updated version of Gender MOD *
Fly to the top instead of jumping *
an idea: iPhone version of Snitz
<mySnitzForum>GAPE</mySnitzForum>
(Strøby, DANMARK)
"a Portuguese in Danmark"
MOD's contribution to Snitz community * Facebook Module *
RSS Snitz Multiple Feed *
Online videos (Youtube, Google video, Flash, Quicktime, etc) *
Add avatar with image crop (on the fly) *
Show last messages in the forum *
Show how many messages since yours IN PAGE TITLE *
Updated version of Gender MOD *
Fly to the top instead of jumping *
an idea: iPhone version of Snitz
<mySnitzForum>GAPE</mySnitzForum>
Posted
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?
any suggestions?
Posted
n/mind, i figure it out!
Posted
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
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
Last edited by Running925 on 04 September 2009, 11:03
Posted
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 "
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 "
Posted
Try:
Code:
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
Posted
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
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
Posted
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.
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.
Email Member
Message Member
Post Moderation
FileUpload
If you're having problems uploading, try choosing a smaller image.
Preview post
Send Topic
Loading...