vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Stop showing post count after it gets to a certain number (https://vborg.vbsupport.ru/showthread.php?t=79327)

oldford 04-04-2005 02:03 PM

Stop showing post count after it gets to a certain number
 
After someone reaches a certain number of posts (say 2000) I'd like to have their post count just be text. For example instead of showing "post: 2303" it would say "post: too many to count" or something like that.

I think it would just be a conditional statement, but I'm not sure how to write it.

Thanks for any help!

oldford 04-25-2005 05:26 AM

Just a bump after a few weeks.

WetWired 04-25-2005 02:37 PM

It should be as simple as searching for $post[posts] in the postbit or postbit_legacy template, and replacing it with
Code:

<if condition="$post[posts]>=2000">Too many<else />$post[posts]</if>

oldford 04-25-2005 03:47 PM

Excellent! Thanks for the reply.

Do I need to rebuild the post count after making this change? It doesn't seem to be working at the moment.

WetWired 04-25-2005 08:01 PM

Hmm, it's because of the thousands separator. They applied it to both of the posts variables that I know of, so you may have to remove it from
Language Manager->Edit Settings->Number Formatting->Thousands Separator
Of course, that would remove it everywhere...

Ian Montgomerie 09-12-2005 11:47 PM

Bumping this thread, because I'm trying to do the same thing, without removing the separator.

I am happy with just displaying "1000 or more" if the user has 1000 or more posts. I figure that you can check for this using strlen($post[posts]) > 3.

Problem is... can I call strlen from a template? It's not allowed within the if conditional itself. Can I call a function somewhere else and have it set a variable? I know PHP but am a bit clueless about how much of it fits into VBulletin templates.

Currently I've hacked a solution as follows:

<if condition="($post[posts]{0}==NULL) || ($post[posts]{1}==NULL) || ($post[posts]{2}==NULL) || ($post[posts]{3}==NULL)">
$vbphrase[posts]: $post[posts]
<else />
$vbphrase[posts]: 1000 or more
</if>


All times are GMT. The time now is 05:53 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.01009 seconds
  • Memory Usage 1,716KB
  • 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
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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