Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-11-2003, 01:40 AM
Gutspiller's Avatar
Gutspiller Gutspiller is offline
 
Join Date: Dec 2001
Posts: 1,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How do I add commas in the # of threads and posts?

On the index page of my forum where it shows the threads and the posts in each forum, I would like to have a comma in the numbers every three spaces you know.

I know that it uses the "number_format" command, but I don't know where I need to add it.

I would also like to add it so that inside each forum the few threads that get over 1000 views or replies have the commas in them as well.

Can somebody help me with this? It seems pretty simple, but I can't find out where I need to add the "number_format" command?
Reply With Quote
  #2  
Old 01-12-2003, 12:36 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

in index.php for example it would be before this line:
PHP Code:
eval("\$forumbits .= \"".gettemplate("forumhome_forumbit_level$depth$tempext")."\";"); 
before you should put this:
PHP Code:
$forum[replycount] = number_format($forum[replycount]); 
analog at the other files
Reply With Quote
  #3  
Old 01-12-2003, 01:03 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How about for the Subscribed Threads listing in the user cp? I tried the number format for both usercp.php and member2.php and it didn't work.
Reply With Quote
  #4  
Old 01-12-2003, 03:44 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

boofo i think in usercp.php#

this line:
PHP Code:
$replies=$thread[replycount]; 
should be this:
PHP Code:
$replies=number_format($thread[replycount]); 
Reply With Quote
  #5  
Old 01-13-2003, 12:11 AM
Xanthine Xanthine is offline
 
Join Date: Mar 2002
Posts: 232
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Xenon the first change works on forumhomes reply count but not thread count, how would I do the threads the same?
Reply With Quote
  #6  
Old 01-13-2003, 01:47 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Xenon
boofo i think in usercp.php#

this line:
PHP Code:
$replies=$thread[replycount]; 
should be this:
PHP Code:
$replies=number_format($thread[replycount]); 
I think that will work on my vb home in the user cp. It doesn't work when listing the subscribed threads listing is shown. I found it though. It was in the member2.php. Thanks for pointing me in the right direction.

How do I add commas to the numbers for the forumdisplaybit, though? I checked the forumdisplay.php and I see nowhere to add the number_format variable.
Reply With Quote
  #7  
Old 01-13-2003, 01:49 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Xanthine
Xenon the first change works on forumhomes reply count but not thread count, how would I do the threads the same?
Just do this for both of them:

PHP Code:
$forum[replycount] = number_format($forum[replycount]);
$forum[threadcount] = number_format($forum[threadcount]); 
Reply With Quote
  #8  
Old 01-13-2003, 02:51 AM
Xanthine Xanthine is offline
 
Join Date: Mar 2002
Posts: 232
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks
Reply With Quote
  #9  
Old 01-13-2003, 03:08 AM
Gutspiller's Avatar
Gutspiller Gutspiller is offline
 
Join Date: Dec 2001
Posts: 1,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey Xenon,

it worked part way.

I'm still trying to get it so that in the actual forum though, where a have a few threads of 1000+ replies or views. I would like those to have the commas as well. Do you know how to add it to those? I tried doing the same thing that I did with the index.php with the forumdisplay.php, but is all that did was add the commas to the same forums when you click on the catagory title in the index page of the forum.

Did that make sense?
Reply With Quote
  #10  
Old 01-13-2003, 02:34 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmm, didn't understand everything but i think you just wanted to know where to put what in forumdisplay.php right?

before this line:
PHP Code:
eval("\$forumdisplaybits .= \"".gettemplate('forumdisplaybit')."\";"); 
put:
PHP Code:
$thread[views]=number_format($thread[views]);
$thread[replycount]=number_format($thread[replycount]); 
Reply With Quote
Reply


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 07:21 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04345 seconds
  • Memory Usage 2,271KB
  • Queries Executed 13 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (9)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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_postinfo_query
  • fetch_postinfo
  • 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