vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   A request for number formatting (https://vborg.vbsupport.ru/showthread.php?t=46118)

SWFans.net 11-26-2002 03:15 AM

A request for number formatting
 
Similar to what we see in vB3. How would one go about applying numer_format to threadcount and replycount on forumhome, and replycount and views in forumdisplay.

It can't be all that tough to do. I played around a little myself and couldn't figure it out, but I'm no PHP guru by any means.

And for those who may not be following my request, what I mean is to have numbers for the Numbers of posts, replies and views that currently appear like this in vB 2.x.x

100000

appear like this

100,000

Xenon 11-26-2002 06:31 PM

in your index.php you find this line:

PHP Code:

eval("\$forumbits .= \"".gettemplate("forumhome_forumbit_level$depth$tempext")."\";"); 

before it add:
PHP Code:

$forum[threadcount]=number_format($forum[threadcount]);
$forum[replycount]=number_format($forum[replycount]); 

it would be quite similar in forumdisplay.php for threads ;)

SWFans.net 11-26-2002 07:15 PM

Thanks for pointing me in the right direction. The code I used was actually
Code:

        // Number format hack
        $forum[threadcount]=number_format($forum[threadcount]);
        $forum[replycount]=number_format($forum[replycount]);
        // end number format hack

And I put it right where you said to. :)

Xenon 11-26-2002 07:49 PM

hmm, i've meant the same, just typed wrong ;)

SWFans.net 11-26-2002 08:55 PM

Thanks again. And for anyone that wants to know how to do post counts and view counts, I just put the code
Code:

        // Number format hack
        $thread[replycount]=number_format($thread[replycount]);
        $thread[views]=number_format($thread[views]);
        // end number format hack

right before where the forumdisplaybit template was executed in forumdisplay.php.


All times are GMT. The time now is 09:22 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.01158 seconds
  • Memory Usage 1,718KB
  • 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
  • (2)bbcode_php_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