PDA

View Full Version : Conditionnal number to posts


Allan
12-12-2006, 10:54 AM
Hey :)

I search a conditionnal for limit to acces (show) with the number to posts please ;)

peterska2
12-12-2006, 11:01 AM
In what context?

Allan
12-12-2006, 11:20 AM
in the template, for hide to text for example if the member don't have x posts

peterska2
12-12-2006, 12:10 PM
Check the hide hacks out. I know that one of them has a post count requirement, so it is possible that some of the others do too.

Xoligy
12-12-2006, 12:43 PM
There is no need to use a hack for this if you wish to add it directly to the template, simply doing the following will work:

<if condition="$vbulletin->userinfo['posts'] > 10">
Hidden text
</if>

Obviously change the number 10 with the minimum amount of posts required to view the text. If you want to do this inside a post, you will need to install a hide hack.

Hope this helps :)

Allan
12-12-2006, 01:10 PM
Don't work

i test with so <if condition="$vbulletin->userinfo['posts'] = 10">

idem, don't work :(

Xoligy
12-12-2006, 02:22 PM
That's because you're setting their post count to 10 rather than comparing it. If you want to show it only when they have exactly 10 posts you need to use == like so:

<if condition="$vbulletin->userinfo['posts'] == 10">

However if you want to show only if they have more than 10 posts you need to use > like so:

<if condition="$vbulletin->userinfo['posts'] > 10">

..and to show only if they have less than 10 posts you use < like so:

<if condition="$vbulletin->userinfo['posts'] < 10">

Allan
12-12-2006, 03:06 PM
For me, it doesn't work :p

I test with a member with 2 post, with this in the template postbit:

<if condition="$vbulletin->userinfo['posts'] > 10">
Test more 10 posts
</if>


With this Account (2 posts), the text "Test more 10 posts" Doesn't appear

With me account (more 3000 posts), the text "Test more 10 posts" Doesn't appear so

I don't understand why that don't work :p

paul41598
12-12-2006, 03:20 PM
<if condition="$bbuserinfo[posts] > 10">
Test more 10 posts
</if>

Allan
12-12-2006, 03:47 PM
<if condition="$bbuserinfo[posts] > 10">
Test more 10 posts
</if>
? hummm

peterska2
12-12-2006, 08:44 PM
erm, whats with the $vbulletin->userinfothat doesn't be used in templates. The template equivalent is $bbuserinfo

Allan
12-12-2006, 09:20 PM
Humm ok, it's more clear, thanks Kerry-Anne, Paul41598 and Xoligy ;)