The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
conditional ad after 5th, 15th post
I have it working fine after 5 posts with
[code]<vb:if condition="$post['postcount'] % $vboptions['maxposts'] == 5">;/code] and it puts the 2nd ad under 15 if I change the 5 to 15. It also places ads under 30 and so on (for those with extended posts per page) Is there a way to combine the conditional statement to include the ad spots I want like 5, 15, 25, 35 rather than right a new conditional which seems to have less control? |
#2
|
|||
|
|||
You should be able to do this:
Code:
<vb:if condition="in_array($post['postcount'], array(5, 15, 25, 35))"> |
#3
|
|||
|
|||
That works but not as hoped for.
Lets say I want it after every 10th post regardless of page or post per page count? |
#4
|
|||
|
|||
I'm curious about this also. I'd like to place an ad after the 3rd post on every page. Is there a solution to do this?
|
#5
|
||||
|
||||
Quote:
PHP Code:
|
#6
|
|||
|
|||
Thank you, Mark. Is there a way to get this to work with conditionals? I get:
syntax error, unexpected '<', expecting end of file on line 4 in /home/site/whatever/includes/class_postbit.php(345) : eval()'d code #0 /home/buickfor/public_html/forums/showthread.php(1096): vB_Postbit->construct_postbit(Array) #1 {main} P.S. How was IRMA for you up there? |
#7
|
||||
|
||||
Quote:
We got a long of wind, but not a lot of rain in my neck of the woods. How did you guys fare? |
#8
|
|||
|
|||
Quote:
<vb:if condition="!is_member_of($bbuserinfo, #,#,#)> <li class="firstpost_advert_container"> <div class="firstpost_advert"> AD CODE HERE </div> </li> </vb:if> With Irma, we got a lot of strong wind. Lots of trees blown down. But very luckily, no flooding. None. That was great. I also never lost power. But lost internet for a few days... |
#9
|
||||
|
||||
The conditional you are using is valid within a template only, however you can exclude usergroups within the plugin PHP code. For example:
PHP Code:
I prefer using plugins rather than hacking templates, if at all possible. |
#10
|
|||
|
|||
This is my first time using plugins, so please bear with me.
Here's what my plugin looks like now: ----- ----- ----- global $ids; $excluded = array(199, 299, 399); if (!is_member_of($vbulletin->userinfo, $excluded) AND $post['postid'] == $ids[2]) { $template_hook['postbit_end'] .= '<li class="firstpost_advert_container"><div class="firstpost_advert"> <div class="firstpost_advert"> <center> AD CODE HERE </center> </div>'; } ----- ----- ----- I'm still doing something wrong with my added code. What sticks out to you? I'm not in any of those user group IDs. Let me know what you think. Thank you very much! Quote:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|