vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Private Messages Enhancements - Percentage of PM Quota Used (https://vborg.vbsupport.ru/showthread.php?t=255430)

ForumsMods 12-16-2010 10:00 PM

Percentage of PM Quota Used
 
1 Attachment(s)
Percentage of PM Quota Used 4.0

Description:
It show the percentage of PM quota that the user used.

Installation:
  1. Import "product-pm_percent.xml" as a product, overwrite if it's already installed
  2. Check Stylevars
Where to set option:
Styles & Templates-> Style Manager-> Stylevars-> Private_Messages-> pm_percent
Languages:
- English

History:
17-12-10: v4.0 First Release
29-12-10: v4.0.1 Fixed displayed porcentage

This hack is created for your use free of charge. No payment is requested. However, if you would like to donate money for the work I put in to this hack, a donation would show your appreciation.

Boofo 12-17-2010 10:56 PM

You're percentage seems to be off. It is showing 2 when it should be .013, or .01.

Quote:

You have 13 messages stored, of a total 1,000 allowed. : 2%

This works:
Code:

$totalpmpercent = $vbulletin->userinfo['pmtotal'] / $vbulletin->userinfo['permissions']['pmquota'];
$pmpercent = vb_number_format($totalpmpercent, 2);


ForumsMods 12-18-2010 02:59 AM

Quote:

Originally Posted by Boofo (Post 2135618)
You're percentage seems to be off. It is showing 2 when it should be .013, or .01.

This works:
Code:

$totalpmpercent = $vbulletin->userinfo['pmtotal'] / $vbulletin->userinfo['permissions']['pmquota'];
$pmpercent = vb_number_format($totalpmpercent, 2);


Hi,
It should be 1.3 but as I am using ceil function which returns the next highest value, it displays 2. I will use vb_number_format in next release.

Boofo 12-18-2010 03:47 AM

13 divided by 1,000 is not 1.3, it is .013. I did a quota percent for my site a while back and have always used the code I posted. With ceil, it would show as .02. Just trying to help. ;)

ForumsMods 12-18-2010 04:43 AM

Quote:

Originally Posted by Boofo (Post 2135745)
13 divided by 1,000 is not 1.3, it is .013. I did a quota percent for my site a while back and have always used the code I posted. With ceil, it would show as .02. Just trying to help. ;)

No. It is 13 divided by 1000 multiplied by 100.
13 / 1000 * 100 = 1.3

Boofo 12-18-2010 05:08 AM

Okay, but that is not the true percentage then. The way I do it doesn't multiply by 100, which is misleading. No offense meant. ;)

ForumsMods 12-18-2010 05:21 AM

Quote:

Originally Posted by Boofo (Post 2135778)
Okay, but that is not the true percentage then. The way I do it doesn't multiply by 100, which is misleading. No offense meant. ;)

See:
http://en.wikipedia.org/wiki/Percentage
Or use:
http://www.csgnetwork.com/csgpercent.html

13 is what percent of 1000? Result: 1.3 %

Boofo 12-18-2010 05:41 AM

According to your second link, you are 100% right. It still doesn't look right to me, but I can't argue with it anymore. Sorry for my confusion. And here I thought was good in math in school. ;)

Here's what I came up with using your method:
Code:

$pmpercent = vb_number_format($vbulletin->userinfo['pmtotal'] / $vbulletin->userinfo['permissions']['pmquota'] * 100, 2);

ForumsMods 12-18-2010 01:24 PM

Quote:

Originally Posted by Boofo (Post 2135790)
According to your second link, you are 100% right. It still doesn't look right to me, but I can't argue with it anymore. Sorry for my confusion. And here I thought was good in math in school. ;)

Here's what I came up with using your method:
Code:

$pmpercent = vb_number_format($vbulletin->userinfo['pmtotal'] / $vbulletin->userinfo['permissions']['pmquota'] * 100, 2);

Now it is correct.
Also I am thinking using round function.

Boofo 12-18-2010 01:27 PM

Yes, round would be better. And thanks for catching me on the percentage error. I Have been doing it wrong all along, it seems. ;)

Harley D 12-20-2010 06:29 PM

Has the code been updated to reflect the proper percentage?
Is it possible to move the display to the top? Mine currently shows at the bottom.

Thanks

fishwestend 01-15-2011 08:57 PM

Any updates?

ForumsMods 01-15-2011 09:07 PM

Quote:

Originally Posted by fishwestend (Post 2149694)
Any updates?

As in thread description 4.0.1 version was released with the correct porcentage.

fishwestend 01-16-2011 01:08 AM

Thanks, must have missed that. Anyway of moving the Folder Controls which shows the percentage above the Inbox and full list of PM's?

bosanci28 10-27-2014 02:37 PM

I know that this is old tread, but can this be displayed at top? also possible to notify the user ,with a email that his mail box is getting closed to be full? Using vb4.2.1.

Thanks

stevieb 10-29-2014 10:57 PM

Does this work on 4.2 patch1?


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