vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Post Count Conditional HELP! (https://vborg.vbsupport.ru/showthread.php?t=211664)

Sweeks 04-19-2009 09:29 PM

Post Count Conditional HELP!
 
I want to display some HTML to members with less than 25 posts in a template, how can this be achieved. Thank you

BBR-APBT 04-19-2009 09:35 PM

Quote:

Originally Posted by Sweeks (Post 1794734)
I want to display some HTML to members with less than 25 posts in a template, how can this be achieved. Thank you

This should work.
Code:

<if condition="$bbuserinfo['postcount'] > '25'">

Html code here

</if>


Sweeks 04-19-2009 09:38 PM

Thanks mate, Ive just tried it but no luck.

<if condition="$bbuserinfo['postcount'] > '25'">
<p>This is a test ignore me</p>
<else />
<p>Testing</p>
</if>

It will show Testing to all users.

--------------- Added [DATE]1240180803[/DATE] at [TIME]1240180803[/TIME] ---------------

I have just tested without the
Code:

<else />
and it works a charm, how can I get it to work with the else ?

--------------- Added [DATE]1240180852[/DATE] at [TIME]1240180852[/TIME] ---------------

Actually, take that back it doesnt show at all using that lol :)

Lynne 04-19-2009 09:45 PM

"posts" is the field in the user table. However, it gets formatted usually (so if you have over 1000 posts, it will show at 1,000). You can't do a condition on the formatted number which means you need to somehow get the unformatted number to use for your condition.

Also, the name of the variable is just about always dependent on what template you are using it in, or what hook location.

Sweeks 04-19-2009 09:48 PM

Ahh so this needs a plugin then, well that's my luck up lol I dont know any PHP yet, I did see this thread but not sure how to modify it to work as what I want:

https://vborg.vbsupport.ru/showpost....36&postcount=1

--------------- Added [DATE]1240182164[/DATE] at [TIME]1240182164[/TIME] ---------------

Got it working, not the same as I wanted but still :D Thank you.


All times are GMT. The time now is 01:31 AM.

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.01110 seconds
  • Memory Usage 1,720KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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