Ads after first post

Tutorials for <a href="http://www.phpbbstyles.com/viewtopic.php?t=356">eXtreme Styles mod</a> for phpBB 2.0.

Moderator: Moderators

Ads after first post

Postby Greg on Sun May 15, 2005 10:38 am

Hey,

I have seen alot of people wanting to have adverts between posts so I will write this short tutorial on how to do it.

There is currently a mod that does it but if you want a quick and easy method just use this.

This idea was based upon CyberAliens idea from various posts.

[code highlight="15"]
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/viewtopic_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<!-- END postrow -->
#
#-----[ BEFORE, ADD ]------------------------------------------
#
<?php if($postrow_i == 0) { ?>
<tr>
<td colspan="2" align="center" class="row1">
put here your ad code
</td>
</tr>
<?php } ?>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
[/code]

That will put an advert after the first post on each page of the topic.

If you are wanting to put an advert after the first cat. Do this;

[code highlight="15"]
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/index_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<!-- END catrow -->
#
#-----[ BEFORE, ADD ]------------------------------------------
#
<?php if($catrow_i == 0) { ?>

<div align="center">
Ad code here
</div>

<?php } ?>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
[/code]

And there we go, it is really that simple. The thing the remember with adsense (tutorial mainly aimed at adsense users) is that you must experiment to find the best place for your ads.

As with all tutorials in the the extreme styles mod tutorials they need XS mod.

If you would like to show the ads in between posts/cat. for guests only use this.

For in between cat.
[code highlight="16"]
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/index_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<!-- END catrow -->
#
#-----[ BEFORE, ADD ]------------------------------------------
#
<!-- BEGIN switch_user_logged_out -->
<?php if($catrow_i == 0) { ?>
<tr>
<td colspan="2" align="center" class="row1">
put here your ad code
<br />
<a href="{U_REGISTER}">Register to remove this advert.</a>
</td>
</tr>
<?php } ?>
<!-- END switch_user_logged_out -->

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
[/code]

Or for after the first post:

[code highlight="16"]
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/viewtopic_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<!-- END postrow -->
#
#-----[ BEFORE, ADD ]------------------------------------------
#
<!-- BEGIN switch_user_logged_out -->
<?php if($postrow_i == 0) { ?>
<tr>
<td colspan="2" align="center" class="row1">
put here your ad code
<br />
<a href="{U_REGISTER}">Register to remove this advert.</a>
</td>
</tr>
<?php } ?>
<!-- END switch_user_logged_out -->

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
[/code]

Have fun,
Greg
Last edited by Greg on Sun Jun 12, 2005 11:48 am, edited 1 time in total.
User avatar
Greg
Registered User
Registered User
 
Posts: 651
Joined: Wed Jul 07, 2004 3:20 pm
Location: Yorkshire, United Kingdom

Postby MCG321 on Tue May 24, 2005 1:53 am

When I put it on my forum, it added an advertisement after each post (or sometimes the first few...weird), not just the first. Any ideas?
MCG321
Registered User
Registered User
 
Posts: 1
Joined: Tue May 24, 2005 1:52 am

Postby Thatbitextra on Tue May 24, 2005 2:35 am

Do you have eXtreme Styles mod?
My MODs: [NEW] Choose Who to Accept PMs From (Prevents you from receiving unwanted PMs!) | Warn of Old Topic Before Posting Reply
Style: subBlack (Now updated to phpBB 2.0.22 and 5 new color schemes!)

Please note, I do NOT offer support via PM. It's a forum, so post your question, then everyone can help.
User avatar
Thatbitextra
Moderator
Moderator
 
Posts: 1821
Joined: Thu Mar 24, 2005 1:11 pm
Location: A place where something is or could be located; a site.

Postby giggle on Mon May 30, 2005 4:58 pm

Same here, it added an ad area after every post, however I do not have the extreme mod. Will this cause the problem?

I also noticed the ads don't show in Firefox browsers on this site.
giggle
Registered User
Registered User
 
Posts: 16
Joined: Mon May 30, 2005 4:34 am

Postby DooBDee on Mon May 30, 2005 5:19 pm

you can not use PHP in templates without extreme styles mod
DooBDee
Website Ninja
DooBDee.net
User avatar
DooBDee
Moderator
Moderator
 
Posts: 3530
Joined: Tue Mar 01, 2005 6:28 pm
Location: DooBDee.net

Postby PostBot on Mon May 30, 2005 7:22 pm

[quote user="giggle" post="37227"]Same here, it added an ad area after every post, however I do not have the extreme mod. Will this cause the problem?[/quote]
This forum is about tutorials for extreme styles mod, so all code requires it.
[quote user="giggle" post="37227"]I also noticed the ads don't show in Firefox browsers on this site.[/quote]
Its not about a browser, but about your login status. I show those ads only for guests.
Do NOT pm me, I don't visit this forum anymore, don't own it, don't provide any support and don't moderate.
User avatar
PostBot
Moderator
Moderator
 
Posts: 10659
Joined: Sat Aug 02, 2003 3:52 pm
Location: Mars

Postby giggle on Mon May 30, 2005 8:30 pm

Thanks CyberAlien, works fine now that I have the xmod added.
giggle
Registered User
Registered User
 
Posts: 16
Joined: Mon May 30, 2005 4:34 am

Postby Nicolas on Sun Jun 12, 2005 3:22 am

What is the script, to say, signup, and remove this banner?

Like what you have, you register, no more ad.

So it would be like this


|-------------------------------------------------|
| |
| | <-- Thats the ad
| |
|-------------------------------------------------|
Click here to signup and remove this ad
^^Thats the link to the signup page

What sould be the code for that?
Nicolas
Registered User
Registered User
 
Posts: 95
Joined: Sun Jun 12, 2005 3:19 am

Postby Greg on Sun Jun 12, 2005 11:44 am

For in between cat.
[code highlight="16"]
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/index_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<!-- END catrow -->
#
#-----[ BEFORE, ADD ]------------------------------------------
#
<!-- BEGIN switch_user_logged_out -->
<?php if($catrow_i == 0) { ?>
<tr>
<td colspan="2" align="center" class="row1">
put here your ad code
<br />
<a href="{U_REGISTER}">Register to remove this advert.</a>
</td>
</tr>
<?php } ?>
<!-- END switch_user_logged_out -->

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
[/code]

Or for after the first post:

[code highlight="16"]
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/viewtopic_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<!-- END postrow -->
#
#-----[ BEFORE, ADD ]------------------------------------------
#
<!-- BEGIN switch_user_logged_out -->
<?php if($postrow_i == 0) { ?>
<tr>
<td colspan="2" align="center" class="row1">
put here your ad code
<br />
<a href="{U_REGISTER}">Register to remove this advert.</a>
</td>
</tr>
<?php } ?>
<!-- END switch_user_logged_out -->

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
[/code]
User avatar
Greg
Registered User
Registered User
 
Posts: 651
Joined: Wed Jul 07, 2004 3:20 pm
Location: Yorkshire, United Kingdom

Postby Nicolas on Sun Jun 12, 2005 12:12 pm

When I put it in my forums, it didnt show the ad at all. I tried logged in and out.

I removed the user logout stuff, and then it showed. Ill show you.

Image

Image

Please help. To see a live preview, www.halomoddingsite.com/files/

And ys, I have xmod installed
Nicolas
Registered User
Registered User
 
Posts: 95
Joined: Sun Jun 12, 2005 3:19 am

Postby Nicolas on Wed Jun 15, 2005 3:13 am

Anyone have an answer?
Nicolas
Registered User
Registered User
 
Posts: 95
Joined: Sun Jun 12, 2005 3:19 am

Postby ale152 on Thu Jun 16, 2005 9:15 am

Hi, I'm italian and I don't speak englesh very well... :roll:
I've a problem, i can't view the ads in my forum...
I've tried to insert the ads only for guest, but the web site doesn't view anything
I'm registred to Google AdSense, the others ads are viewed, but can't view the ads after the first post...
And if it were because I've the Aqua Style?
boh...
this is my viewtopic_body.tpl
can you halp me?
Code: Select all
<table width="90%" border="0" align="center">
<tr>
<td align="left" valign="bottom" colspan="2"><a class="maintitle" href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a><br />
<span class="gensmall"><b>{PAGINATION}</b><br />
  </span></td>
</tr>
</table>

<table width="90%" border="0" align="center" cellpadding="2" cellspacing="2">
<tr>
<td align="left" valign="bottom" nowrap="nowrap"><span class="nav"><a href="{U_POST_REPLY_TOPIC}"><img src="{REPLY_IMG}" border="0" alt="{L_POST_REPLY_TOPIC}" align="middle" /></a></span></td>
<td align="left" valign="middle" width="100%"><span class="nav">   <a href="{U_INDEX}" class="nav">{L_INDEX}</a>
  -> <a href="{U_VIEW_FORUM}" class="nav">{FORUM_NAME}</a></span></td>
</tr>
</table>
<table width="90%"  border="0" align="center" cellpadding="0" cellspacing="0" background="templates/aqua/images/aquatbm.gif">
<tr align="center" background="templates/aqua/images/aquatbm.gif">
<td width="33%" height="22" align="left"><img src="templates/aqua/images/aquatbl.gif" width="22" height="22"></td>
<td width="33%" height="22" align="center"></td>
<td width="33%" height="22" align="right"><img src="templates/aqua/images/aquatbr1.gif" width="79" height="22"></td>
</tr>
</table>
<table width="90%" border="0" align="center" cellpadding="3" cellspacing="0" class="forumline">
<tr align="right">
<td class="catHead" colspan="2" height="28"><span class="nav"><a href="{U_VIEW_OLDER_TOPIC}" class="nav">{L_VIEW_PREVIOUS_TOPIC}</a> :: <a href="{U_VIEW_NEWER_TOPIC}" class="nav">{L_VIEW_NEXT_TOPIC}</a>  </span></td>
</tr>
{POLL_DISPLAY}
</table>
<!-- BEGIN postrow -->
<table width="90%" border="0" align="center" cellpadding="3" cellspacing="0" class="forumline">
<tr>
<th class="thLeft" width="150" height="26" nowrap="nowrap">{L_AUTHOR}</th>
<th class="thRight" nowrap="nowrap">{L_MESSAGE}</th>
</tr>
<tr>
<td width="150" align="left" valign="top" class="{postrow.ROW_CLASS}"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="9" height="9"><img src="templates/aqua/images/profileul.gif" width="9" height="9"></td>
    <td height="9" background="templates/aqua/images/profileum.gif"></td>
    <td width="9" height="9"><img src="templates/aqua/images/profileur.gif" width="9" height="9"></td>
  </tr>
  <tr>
    <td width="9" background="templates/aqua/images/profileml.gif"></td>
    <td background="templates/aqua/images/profilemm.gif"><span class="name"><a name="{postrow.U_POST_ID}"></a><b>{postrow.POSTER_NAME}</b></span><br /><span class="postdetails">{postrow.POSTER_RANK}<br />{postrow.RANK_IMAGE}{postrow.POSTER_AVATAR}<br /><br />{postrow.POSTER_JOINED}<br />{postrow.POSTER_POSTS}<br />{postrow.POSTER_FROM}</span><br /></td>
    <td width="9" background="templates/aqua/images/profilemr.gif"></td>
  </tr>
  <tr>
    <td width="9" height="9"><img src="templates/aqua/images/profiledl.gif" width="9" height="9"></td>
    <td height="9" background="templates/aqua/images/profiledm.gif"></td>
    <td width="9" height="9"><img src="templates/aqua/images/profiledr.gif" width="9" height="9"></td>
  </tr>
</table></td>
<td class="{postrow.ROW_CLASS}" width="100%" height="28" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%"><a href="{postrow.U_MINI_POST}"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /></a><span class="postdetails">{L_POSTED}: {postrow.POST_DATE}<span class="gen"> </span>   {L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td>
<td valign="top" nowrap="nowrap">{postrow.QUOTE_IMG} {postrow.EDIT_IMG} {postrow.DELETE_IMG} {postrow.IP_IMG}</td>
</tr>
<tr>
<td colspan="2"><hr /></td>
</tr>
<tr>
<td colspan="2"><span class="postbody">{postrow.MESSAGE}{postrow.SIGNATURE}</span><span class="gensmall">{postrow.EDITED_MESSAGE}</span></td>
</tr>
</table></td>
</tr>
<tr>
<td class="{postrow.ROW_CLASS}" width="150" align="left" valign="middle"><a href="#top" class="nav"><img src="templates/aqua/images/top.gif" alt="{L_BACK_TO_TOP}" border="0"></a></td>
<td class="{postrow.ROW_CLASS}" width="100%" height="28" valign="bottom" nowrap="nowrap"><table cellspacing="0" cellpadding="0" border="0" height="18" width="18">
<tr>
<td valign="middle" nowrap="nowrap">{postrow.PROFILE_IMG} {postrow.PM_IMG} {postrow.EMAIL_IMG} {postrow.WWW_IMG} {postrow.AIM_IMG} {postrow.YIM_IMG} {postrow.MSN_IMG}
<script language="JavaScript" type="text/javascript"><!--

if ( navigator.userAgent.toLowerCase().indexOf('mozilla') != -1 && navigator.userAgent.indexOf('5.') == -1 && navigator.userAgent.indexOf('6.') == -1 )
document.write(' {postrow.ICQ_IMG}');
else
document.write('</td><td>&nbsp;</td><td valign="top" nowrap="nowrap"><div style="position:relative"><div style="position:absolute">{postrow.ICQ_IMG}</div><div style="position:absolute;left:5px;top:1px">{postrow.ICQ_STATUS_IMG}</div></div>');

//--></script><noscript>{postrow.ICQ_IMG}</noscript></td>
</tr>
</table></td>
</tr>
<!-- BEGIN switch_user_logged_out --> 
<?php if($postrow_i == 0) { ?>     
<tr>     
<td colspan="2" align="center" class="row1">     
<script type="text/javascript"><!--
google_ad_client = "pub-2663293223831746";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "A8DDA0";
google_color_bg = "EBFFED";
google_color_link = "0000CC";
google_color_url = "008000";
google_color_text = "6F6F6F";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script> 
<br /> 
<a href="{U_REGISTER}">Registrati per non visualizzare questi annunci.</a> 
</td>     
</tr>     
<?php } ?> 
<!-- END switch_user_logged_out --> 
<!-- END postrow -->
</table>
<table width="90%" border="0" align="center" cellpadding="3" cellspacing="0" class="forumline">
<tr align="center">
<td class="catBottom" colspan="2" height="28"><table cellspacing="0" cellpadding="0" border="0">
<tr><form method="post" action="{S_POST_DAYS_ACTION}">
<td align="center"><span class="gensmall">{L_DISPLAY_POSTS}: {S_SELECT_POST_DAYS} {S_SELECT_POST_ORDER} <input type="submit" value="{L_GO}" class="liteoption" name="submit" /></span></td>
</form></tr>
</table></td>
</tr>
</table>
<table width="90%" height="22"  border="0" align="center" cellpadding="0" cellspacing="0" background="templates/aqua/images/aquatbdm.gif">
<tr>
<td><img src="templates/aqua/images/aquatbdl.gif"></td>
<td align="right"><img src="templates/aqua/images/aquatbdr.gif"></td>
</tr>
</table>
<table width="90%" border="0" align="center">
<tr>
<td align="left" valign="middle" nowrap="nowrap"><span class="nav"><a href="{U_POST_REPLY_TOPIC}"><img src="{REPLY_IMG}" border="0" alt="{L_POST_REPLY_TOPIC}" align="middle" /></a></span></td>
<td align="left" valign="middle" width="100%"><span class="nav">   <a href="{U_INDEX}" class="nav">{L_INDEX}</a>
  -> <a href="{U_VIEW_FORUM}" class="nav">{FORUM_NAME}</a></span></td>
<td align="right" valign="top" nowrap="nowrap"><span class="gensmall">{S_TIMEZONE}</span><br /><span class="nav">{PAGINATION}</span>
</td>
</tr>
<tr>
<td align="left" colspan="3"><span class="nav">{PAGE_NUMBER}</span></td>
</tr>
</table>

<table width="90%" cellspacing="2" border="0" align="center">
<tr>
<td width="40%" valign="top" nowrap="nowrap" align="left"><span class="gensmall">{S_WATCH_TOPIC}</span><br />
 <br />
{S_TOPIC_ADMIN}</td>
<td align="right" valign="top" nowrap="nowrap">{JUMPBOX}<span class="gensmall">{S_AUTH_LIST}</span></td>
</tr>
</table>
ale152
Registered User
Registered User
 
Posts: 1
Joined: Thu Jun 16, 2005 9:08 am

Postby Nicolas on Fri Jun 17, 2005 4:55 pm

Yea, you need to recode that only for guest thing.
Nicolas
Registered User
Registered User
 
Posts: 95
Joined: Sun Jun 12, 2005 3:19 am

Postby Nicolas on Mon Jun 20, 2005 12:11 am

Here is a better mod.
Easier to change the code too.

http://www.phpbb.com/phpBB/viewtopic.ph ... ht=adsense

More steps, but I think its better.
Nicolas
Registered User
Registered User
 
Posts: 95
Joined: Sun Jun 12, 2005 3:19 am

Health and Fitness

Postby Toma on Tue Jun 21, 2005 12:24 am

Hi Greg,

II was reading your post thinking it might be something I want to add to my sight. When scrolling down I noticed in your links one for Health and fitness. If this is a special interest of yours, my site could really use your help. It is about controlling diabetes and other medical conditions with good nutrition. You may check it out at http://www.nutricoach.net. I am very new to php and phpbb in particular and trying to learn all of this is a bit difficult for an old man with not a good technical background and unfamiliar with many of the terms used. I seems every time I have something I want to do it takes from 2 days to 2 weeks to figure out how to do it. I could use someone who knows their way around PHP.[/url]
Toma
founder,
www.nutricoach.net
For the Nutritionally Challenged
Good health is no accident.
Those who would sacrifice liberty for temporary security,
deserve neither security nor liberty!
Freedom isnt free.
Toma
Registered User
Registered User
 
Posts: 3
Joined: Mon Jun 20, 2005 12:33 pm
Location: Nanaimo, BC Canada

Next

Return to eXtreme Styles mod tutorials

Who is online

Users browsing this forum: No registered users and 1 guest

cron