The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Conditional for "length" (fx. number of words) for post?
I need a conditional for "length" (pref. number of words, or possibly fx. number of lines or size in KB) for a post. Is that possible
|
#2
|
|||
|
|||
I'd love to know this, too. I place a unit of AdSense after first post, but if the first post is too short, I'd like to place the ad after the second post, so I'm looking for a conditional that would be able to recognize the post size.
|
#3
|
|||
|
|||
There isn't an existing conditional for that. You'd need to create a plugin, because even if there was a way to check the message length in a template conditional, you'd still need to know if the ad had been displayed yet or not.
I haven't tested this at all, but you could try this (using hook location postbit_display_complete) PHP Code:
Then in postbit, Code:
<vb:if condition="$show[adsense]"> (existing code) </vb:if> |
#4
|
|||
|
|||
Hi kh99,
I much appreciate you taking the time for this. I'm going to play with it a bit. |
#5
|
|||
|
|||
I thought of a couple other things - you don't say what you'd want if the second (or third or fourth, etc) were also short. What I wrote will not display the ad until a post is long enough. Also, I forgot that it won't display at all if all the messages are short, so you need some check for that.
|
#6
|
|||
|
|||
I display one unit of AdSense per showthread page, right bellow the first post on each page. My original intention was to move the position of the ad to bellow the second post if the first post was too short. However, in the process of trying to figure out how to achieve it, I have changed my mind a bit. Instead of doing the above, I decided to not display ads at all on pages with fewer than three posts. I have managed to achieve this. I will leave it as is for now. Should the income drop considerably, I will revisit my original plan.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|