Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions

Reply
 
Thread Tools Display Modes
  #11  
Old 02-19-2001, 04:10 PM
Guest
 
Posts: n/a
Default

Another thing I get an error at the top of a page if the person hasn't made posts, and an instance with 1 post,

Warning: Division by zero in /www/thzclan/forums/member.php3 on line 624

0 posts - http://www.thzclan.com/forums/member...info&userid=41

and heres one with 1 post - http://www.thzclan.com/forums/member...info&userid=44

Not everybody with 1 post has the error.

I can live with this, but if there is a fix I'd apprieciate it, thanks.

PHP3
Reply With Quote
  #12  
Old 02-24-2001, 02:26 PM
Guest
 
Posts: n/a
Default

yEAh A FIX IS NEEDed please finish your hack
thanks
Reply With Quote
  #13  
Old 02-25-2001, 09:37 PM
Guest
 
Posts: n/a
Default

Just check before if the posts are less then 2, then the values are "N/A', else the values are what they are :P

That's how i've done it
Reply With Quote
  #14  
Old 02-28-2001, 12:25 PM
Guest
 
Posts: n/a
Default

Ummmm
I'm not sure what you mean, please explain...
thanks
Reply With Quote
  #15  
Old 02-28-2001, 01:26 PM
Guest
 
Posts: n/a
Default

Just use something like

PHP Code:
  $userjointimestamp=date("U",$userinfo[joindate]);
  
$systemtimestamp=date("U");
  
$tsdifference=round(($systemtimestamp-$userjointimestamp)/86400);
  
$tsdifference=$tsdifference+1;
  if (
$userinfo[posts]>=2) {
    
$averageposts=round($userinfo[posts]/$tsdifference,2);
    
$averagecharsperpost=round($postinfo[totalchars]/$postinfo[totalposts]);
  } else {
    
$averageposts="NVT";
    
$averagecharsperpost="NVT";
  } 
The only way when you NOW can get an division by zero error, is when the user's posts are deleted, but his postnumber isn't, so it still reads like 22 posts even if he hasn't got any..

But otherwise, it works fine.. for me though
Reply With Quote
  #16  
Old 03-01-2001, 11:41 PM
Guest
 
Posts: n/a
Default

How would you do this for vBB2. Can somebody make it or remodel it quickly. It would be really useful.

Thx
Reply With Quote
  #17  
Old 03-02-2001, 12:14 AM
Guest
 
Posts: n/a
Default

Quote:
Originally posted by mrlister
How would you do this for vBB2. Can somebody make it or remodel it quickly. It would be really useful.


Thx
it is already in vb2. Click on user profile and have a look.
Reply With Quote
  #18  
Old 03-02-2001, 12:30 AM
Guest
 
Posts: n/a
Default

oh ok. thx it's just that in the member.php thing it said something about mail so i got confused
Reply With Quote
Reply

Thread Tools
Display Modes

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 08:05 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.04287 seconds
  • Memory Usage 2,212KB
  • 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
  • (1)bbcode_php
  • (1)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
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)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
  • 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