vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Conditionnal number to posts (https://vborg.vbsupport.ru/showthread.php?t=133811)

Allan 12-12-2006 10:54 AM

Conditionnal number to posts
 
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:
Code:

<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

Code:

<if condition="$bbuserinfo[posts] > 10">
Test more 10 posts
</if>


Allan 12-12-2006 03:47 PM

Quote:

Originally Posted by paul41598 (Post 1137153)
Code:

<if condition="$bbuserinfo[posts] > 10">
Test more 10 posts
</if>


? hummm

peterska2 12-12-2006 08:44 PM

erm, whats with the
Code:

$vbulletin->userinfo
that doesn't be used in templates. The template equivalent is
Code:

$bbuserinfo

Allan 12-12-2006 09:20 PM

Humm ok, it's more clear, thanks Kerry-Anne, Paul41598 and Xoligy ;)


All times are GMT. The time now is 04:15 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01029 seconds
  • Memory Usage 1,732KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (12)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete