Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

Reply
 
Thread Tools
Add commas to replycounts, thread views, etc Details »»
Add commas to replycounts, thread views, etc
Version: 1.00, by Tigga Tigga is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 04-14-2003 Last Update: Never Installs: 14
 
No support by the author.

This "hack" is so simple I'm really surprised nobody's released it here before, or that it's not included in vB2 (though it is done this way in vB3). All this does is add commas to the number of threads & posts in each forum on your index page, and to the number of replies & views on the forum display page. So for a thread that has 1,000 views, it would normally be shown as "1000". This changes it to add the number format and show "1,000" instead. I know this is really simple, but I figured someone might find it useful since it makes those numbers a little easier to read.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 04-15-2003, 08:55 PM
N9ne N9ne is offline
 
Join Date: Feb 2002
Posts: 1,495
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

And also for post counts, in postbit and member list
Reply With Quote
  #13  
Old 04-15-2003, 09:12 PM
N9ne N9ne is offline
 
Join Date: Feb 2002
Posts: 1,495
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

For post counts in postbit, put this code anywhere in the buildpostbit function in functions.php

$post[posts]=number_format($post[posts]);
Reply With Quote
  #14  
Old 04-15-2003, 09:15 PM
N9ne N9ne is offline
 
Join Date: Feb 2002
Posts: 1,495
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

And for memberlist post counts:

memberlist.php, find:

$userinfo[datejoined]=vbdate($dateformat,$userinfo[joindate]);

Below it, add:

$userinfo[posts]=number_format($userinfo[posts]);

Done.

Thanks for the hack Tigga
Reply With Quote
  #15  
Old 04-15-2003, 10:15 PM
Logik's Avatar
Logik Logik is offline
 
Join Date: Nov 2002
Location: Tx
Posts: 432
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice addition.
Reply With Quote
  #16  
Old 05-04-2003, 08:20 PM
VAN's Avatar
VAN VAN is offline
 
Join Date: Oct 2001
Posts: 97
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Doh! Found another...

To add this to the post counts in a users profile,

In member.php find:

$userinfo[datejoined]=vbdate($dateformat,$userinfo[joindate]);

Below that, add:

$userinfo[posts]=number_format($userinfo[posts]);

Thanks for the "mini-hack", Tigga.

::installs original + everyones add-ons::
Reply With Quote
  #17  
Old 05-04-2003, 09:05 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Tigga, in your instructions, shouldn't this:

PHP Code:
Now open usercp.php AND member2.php and look for:

$replies=$thread[replycount];
$views=$thread[views];


Change that to (in both files):

$thread[replycount]=number_format($thread[replycount]);
$thread[views]=number_format($thread[views]); 
actually be this:

PHP Code:
Now open usercp.php AND member2.php and look for:

$replies=$thread[replycount];
$views=$thread[views];


Change that to (in both files):

$replies=number_format($thread[replycount]);
$views=number_format($thread[views]); 
Reply With Quote
  #18  
Old 05-04-2003, 10:13 PM
Tigga's Avatar
Tigga Tigga is offline
 
Join Date: Dec 2001
Location: Atlanta
Posts: 1,061
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bofo - No, actually the code you're looking for in those 2 files is useless. The $replies and $views variables aren't used anywhere in the templates, so I'm not sure why the code is even there in the first place (other than the devs forgot to remove it). That's why I figured it best to trade out that code for something a little more useful.
Reply With Quote
  #19  
Old 05-04-2003, 10:53 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just checked the templates. You're right. I don't see those anywhere at all. Thanks for clearing that up.

BTW: It's Boofo, not Bofo.
Reply With Quote
  #20  
Old 05-04-2003, 10:57 PM
Tigga's Avatar
Tigga Tigga is offline
 
Join Date: Dec 2001
Location: Atlanta
Posts: 1,061
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No problem at all. I thought it was kinda strange that the code was in there as well and made sure it wasn't used anywhere first. Maybe they were planning on using the number_format tags at first and forgot about it? Who knows...
Sorry about the typo in your name. Guess I was typing a little too fast.
Reply With Quote
  #21  
Old 05-04-2003, 11:10 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I would tend to believe it is just forgotten code.

BTW: Did you get the pm I sent you?
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:56 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.05165 seconds
  • Memory Usage 2,298KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete