Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 09 Sep 2014, 10:04
induslady induslady is offline
 
Join Date: Jul 2006
Template Conditional for Ad slot after 5th Post in Postbit

Hello,

Am looking to display ads in showthread page in the below positions -

1)After First Post
2)After 5th Post ONLY IF the thread has 10 posts.

For #1, Have used the template conditional in postbit-
<vb:if condition="THIS_SCRIPT == showthread AND !$GLOBALS['FIRSTPOSTID']">

Similarly for #2, can anyone help me with the template conditional.

Thanks.
Reply With Quote
  #2  
Old 09 Sep 2014, 11:00
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Aug 2009
Real name: Chris

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Replace the ? mark with the post number you want the Ads to show after.
__________________
You can get access to my 180 mods for vB 3.6 - 4.x at The Admin Zone as well as the professional support you are used to. New vBulletin Spider Definitions, vBulletin Spiders List Hits 1000 Spiders! ​ OzzModz down. Site has had a data breach, checking how the intrusion happened. Change your PW if you use the same one on my site and others.
Reply With Quote
  #3  
Old 10 Sep 2014, 09:11
induslady induslady is offline
 
Join Date: Jul 2006
Yes Thanks, that worked good.

--------------- Added 10 Sep 2014 at 10:38 ---------------

Hello ozzy47,
Looks like the conditional


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

is displaying the ad after 5th post, that is fine.

But what am looking for is the below -

- Display ad after 5th post ONLY if the thread page has 10 posts.
- Do not display Ad if the thread page has 5 or 6 or 7 or 8 or 9 posts in it.

Let me know how this conditional could be tweaked.

For info, I have the below setting in my forum -
Maximum Displayed Posts Before Page Split - 10

Last edited by induslady; 10 Sep 2014 at 10:42.
Reply With Quote
  #4  
Old 10 Sep 2014, 10:44
mokujin's Avatar
mokujin mokujin is offline
 
Join Date: Nov 2005
Real name: Đạt
Try this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
I am on holiday (18 Jan to 14 Feb), so I can't complete your requests in time, sorry guys, hope next time you still hire me. Thanks

PM me for custom paid modifications for your vB3/vB4 forums ...
Reply With Quote
  #5  
Old 10 Sep 2014, 13:13
induslady induslady is offline
 
Join Date: Jul 2006
Hello mokujin,

The above conditional is not working.
Reply With Quote
  #6  
Old 10 Sep 2014, 22:06
punchbowl punchbowl is offline
 
Join Date: Nov 2006
Originally Posted by induslady View Post
Hello mokujin,

The above conditional is not working.
try this:
Originally Posted by mokujin View Post
Try this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.
(removed stray '(' )

is maxposts about the page or about the thread btw? i.e. say I have 10 posts per page and 11 posts in total is postcount 1 or 11?, what is the conditional for basically saying "if there is only x posts on this page"?
Reply With Quote
  #7  
Old 10 Sep 2014, 23:07
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Aug 2009
Real name: Chris
Originally Posted by induslady View Post
Hello mokujin,

The above conditional is not working.
Try this one.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
You can get access to my 180 mods for vB 3.6 - 4.x at The Admin Zone as well as the professional support you are used to. New vBulletin Spider Definitions, vBulletin Spiders List Hits 1000 Spiders! ​ OzzModz down. Site has had a data breach, checking how the intrusion happened. Change your PW if you use the same one on my site and others.
Reply With Quote
  #8  
Old 10 Sep 2014, 23:10
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Aug 2009
Real name: Chris
Originally Posted by punchbowl View Post
try this:


(removed stray '(' )

is maxposts about the page or about the thread btw? i.e. say I have 10 posts per page and 11 posts in total is postcount 1 or 11?, what is the conditional for basically saying "if there is only x posts on this page"?
For the "if there is only x posts on this page"


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
You can get access to my 180 mods for vB 3.6 - 4.x at The Admin Zone as well as the professional support you are used to. New vBulletin Spider Definitions, vBulletin Spiders List Hits 1000 Spiders! ​ OzzModz down. Site has had a data breach, checking how the intrusion happened. Change your PW if you use the same one on my site and others.
Reply With Quote
  #9  
Old 10 Sep 2014, 23:30
punchbowl punchbowl is offline
 
Join Date: Nov 2006
Originally Posted by ozzy47 View Post
For the "if there is only x posts on this page"


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.
brilliant thanks...exactly what I wanted.
Reply With Quote
  #10  
Old 10 Sep 2014, 23:31
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Aug 2009
Real name: Chris
Not a problem, glad to help.
__________________
You can get access to my 180 mods for vB 3.6 - 4.x at The Admin Zone as well as the professional support you are used to. New vBulletin Spider Definitions, vBulletin Spiders List Hits 1000 Spiders! ​ OzzModz down. Site has had a data breach, checking how the intrusion happened. Change your PW if you use the same one on my site and others.
Reply With Quote
  #11  
Old 11 Sep 2014, 11:12
punchbowl punchbowl is offline
 
Join Date: Nov 2006
For some reason this works fine on in ad_showthread_firstpost but doesn't seem to work on ad_showthread_beforeqr or if you do something like


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

in the footer

It only seems to work as vb is producing the posts not in templates calls after. In 3.8 anyway. Sorry yes I'm using 3.8 but the conditionals are almost exactly the same so I didn't think anyone would mind
Reply With Quote
  #12  
Old 11 Sep 2014, 11:48
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Aug 2009
Real name: Chris
Possibly this.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
You can get access to my 180 mods for vB 3.6 - 4.x at The Admin Zone as well as the professional support you are used to. New vBulletin Spider Definitions, vBulletin Spiders List Hits 1000 Spiders! ​ OzzModz down. Site has had a data breach, checking how the intrusion happened. Change your PW if you use the same one on my site and others.
Reply With Quote
  #13  
Old 11 Sep 2014, 13:05
punchbowl punchbowl is offline
 
Join Date: Nov 2006
Nope. Doesn't seem to know the postcount outside of the postbit template itself. Not a big deal anyway. Thanks for your help.
Reply With Quote
  #14  
Old 16 Sep 2014, 13:09
induslady induslady is offline
 
Join Date: Jul 2006
To display Ad after the 5th post ONLY if the thread has 10 posts, I used the below conditional -


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

but this is not working. what is happening is that the ad is not getting displayed after 5th post even when there are 10 posts in the thread.
Please help me with the workable conditional.
Thanks.
Reply With Quote
  #15  
Old 23 Sep 2014, 06:40
induslady induslady is offline
 
Join Date: Jul 2006
Hello All,

Hope this might be useful to some one,

To display Ad after the 5th post ONLY if the thread has minimum 6 posts the below conditional works -


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 16:52.

Layout Options | Width: Wide Color: