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

Postby Case on Wed Sep 14, 2005 8:27 pm

Hey, you're all talking nonsense to me on here. That nonsense makes my webpage work!


I'm using Artemis. The code I want to get to work is...

Code: Select all
<!-- 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-8481392203960400";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_border = "979797";
google_color_bg = "979797";
google_color_link = "CCCCCC";
google_color_url = "CCCCCC";
google_color_text = "CCCCCC";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script> 
<br /> 
<a href="{U_REGISTER}">Register to remove this advert.</a> 
</td>     
</tr>     
<?php } ?> 
<!-- END switch_user_logged_out -->


...that one.
[size="9"]The Dope Spot - Urban Music Forum[/size]
User avatar
Case
Registered User
Registered User
 
Posts: 751
Joined: Thu Apr 28, 2005 3:27 pm
Location: North West UK

Postby Mark_the_accountant on Sat Nov 05, 2005 7:56 pm

Hi

I have added the simple code for adding ads to the viewtopic_body.tpl file.

Code: Select all
<?php if($postrow_i == 0) { ?>   
<tr>   
<td colspan="2" align="center" class="row1">   
Ad code here
</td>   
</tr>   
<?php } ?> 


Is there anyway to show a specific ad based upon upon the forum id.

For example, if I want a specific piece of code to be used if the forum_id is 11 and another piece of code to be used if it is anything else.

Thanks for any help in advance.


Mark
Mark_the_accountant
Registered User
Registered User
 
Posts: 2
Joined: Sat Nov 05, 2005 7:49 pm

Postby UseLess on Sat Nov 05, 2005 8:18 pm

Movie Quote:
It's not the years honey, it's the mileage...

I do not provide any install services for phpBB, Mods or Styles.
Please do not pm me for support/scripting help - you won't get any reply. If you have a question then make a post in the appropriate forum.
User avatar
UseLess
Registered User
Registered User
 
Posts: 6220
Joined: Mon Sep 27, 2004 2:14 am
Location: North East, UK

Postby Mark_the_accountant on Sun Nov 06, 2005 7:16 pm

Thank you for your reply.

Could you help me incorporate the code into viewtopic_body.tpl please as my level of coding knowledge is limited.

Many thanks

Mark
Mark_the_accountant
Registered User
Registered User
 
Posts: 2
Joined: Sat Nov 05, 2005 7:49 pm

Postby Neodelphi on Thu Nov 24, 2005 11:56 am

Guys

Help me, i want to have this google adsense work for my MORPHEUS X Blue.

any help would be a great help

regards,

Neo
Neodelphi
Registered User
Registered User
 
Posts: 9
Joined: Thu Jun 02, 2005 6:25 am

Postby reklipz on Sat Jan 07, 2006 9:25 am

Well, the fact that the code shows up without the <BEGIN switch_user_logged_out> and the <END ...> has something to do with extreme styles mod... there is a bug in there somewhere

if you leave the begin and end tags there, and remove the two <?php ?> tags(yes, this will put ads after everyone i know, but it is to show my point), it works fine, displaying ads to non logged in peeps and not showin em to logged in people

so, looks like i FOUND A BUG
reklipz
Registered User
Registered User
 
Posts: 3
Joined: Sat Jan 07, 2006 9:22 am

Postby reklipz on Sat Jan 07, 2006 9:29 am

there also seems to be a problem with embedded < BEGIN and END tags:

<!-- BEGIN postrow -->
<!-- BEGIN switch_user_logged_out -->

<!-- END switch_user_logged_out -->
<!-- END postrow -->

does not seem to work...
reklipz
Registered User
Registered User
 
Posts: 3
Joined: Sat Jan 07, 2006 9:22 am

Postby UseLess on Sat Jan 07, 2006 11:05 am

Greetings,

It's not a bug as such it's just that 'switch_user_logged_out' is a root level switch and your using it inside a loop. For it to work like you want above it would have to be defined once within the 'postrow' loop and it's not which is why it does not work.

See this for a way to solve the problem: viewtopic.php?t=4056
Movie Quote:
It's not the years honey, it's the mileage...

I do not provide any install services for phpBB, Mods or Styles.
Please do not pm me for support/scripting help - you won't get any reply. If you have a question then make a post in the appropriate forum.
User avatar
UseLess
Registered User
Registered User
 
Posts: 6220
Joined: Mon Sep 27, 2004 2:14 am
Location: North East, UK

Postby Tasadduqkhan on Sat Jan 07, 2006 12:56 pm

I am using extreme style. I am taking about first post of this thread.
As I have seen there is written:

#-----[ OPEN ]------------------------------------------
#
templates/subSilver/viewtopic_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<!-- END postrow -->


But I didn't find anything like this in extreme style template. I've also installed XS mod.
So what should I do?
Tasadduqkhan
Registered User
Registered User
 
Posts: 59
Joined: Thu Jan 05, 2006 9:12 am

Postby UseLess on Sat Jan 07, 2006 1:28 pm

Greetings,

The XS Mod is not a style and you should make the changes to the template 'viewtopic_body.tpl', however, if your using MorpheusX then as previously stated in another question you asked you have to edit;

- viewtopic_post_above.tpl
- viewtopic_post_left.tpl
- viewtopic_post_right.tpl
- viewtopic_post_none.tpl

which is where you'll find '<!-- END postrow -->'.
Movie Quote:
It's not the years honey, it's the mileage...

I do not provide any install services for phpBB, Mods or Styles.
Please do not pm me for support/scripting help - you won't get any reply. If you have a question then make a post in the appropriate forum.
User avatar
UseLess
Registered User
Registered User
 
Posts: 6220
Joined: Mon Sep 27, 2004 2:14 am
Location: North East, UK

Postby Tasadduqkhan on Sat Jan 07, 2006 3:58 pm

Ah
Extremely Sorry. :(
I just got lost from the way. Thanks for telling me.

PS : You are really helping UseLess. :D
Tasadduqkhan
Registered User
Registered User
 
Posts: 59
Joined: Thu Jan 05, 2006 9:12 am

Postby reklipz on Sat Jan 07, 2006 6:50 pm

so, after reading that thread(thank you btw), could i not just do it in php alone?

Code: Select all
global $userdata; 
if(!$userdata['session_logged_in']) {
   blah...
}
reklipz
Registered User
Registered User
 
Posts: 3
Joined: Sat Jan 07, 2006 9:22 am

Postby stdio on Sun Feb 12, 2006 12:51 pm

does anyone know how to add the ad after the LAST post?

Thanks!
stdio
Registered User
Registered User
 
Posts: 1
Joined: Sun Feb 12, 2006 12:43 pm

one more question..

Postby ManoSmriti on Mon Mar 13, 2006 2:09 am

how can i ( using a mod similar to the one described above) I can..

>> Place ads on the top of each page of my forum ?
>> Just below the Navigation menu(profiles,home,usergroups etc..)
>> At the end of each page
>> create a permanent block on the left hand side to display a skyscraper ad.


Thank You
ManoSmriti
Registered User
Registered User
 
Posts: 11
Joined: Thu Mar 09, 2006 11:55 am

Postby wouziap on Fri Mar 24, 2006 6:43 pm

Hello,

this mod really doesn't work with MorpheusX.

Can somebody tell, in witch line (viewtopic_body.tpl) i need to paste the code?
wouziap
Registered User
Registered User
 
Posts: 12
Joined: Tue Mar 22, 2005 9:19 pm

PreviousNext

Return to eXtreme Styles mod tutorials

Who is online

Users browsing this forum: No registered users and 1 guest