vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   PM Gauge (https://vborg.vbsupport.ru/showthread.php?t=34248)

Prince 07-12-2002 04:01 AM

yes, you're correct! thanks.

Prince 07-12-2002 04:58 PM

oh, btw, if you are including the PM Guage with the bar graph you do need that query in private.php or it will not work, but it's not needed in index.php.

BarryA 07-29-2002 02:28 AM

I just installed the hack and I think it broke my "Send PM to Buddies". Send PM to Buddies now comes up with a blank screen.

Has anyone else had this problem?

Prince 07-29-2002 03:06 AM

the hack did not break it, you did! ;)

re-do the hack, it works fine.

Baptizer 09-06-2002 12:24 AM

Great hack.....i just have to fix my images and it works perfectly.

QUick question: In my Vbulletin control panel, i 'think' the pm limit was set to 70, but some people had 500 pms in their box! why is that?

TvNut 09-07-2002 11:54 PM

I like the hcak but looking for something that can go into here..just under it...

Zzed 09-08-2002 12:14 AM

Quote:

Originally posted by TvNut
I like the hcak but looking for something that can go into here..just under it...
Check out the hack I did for PM statistics ;)

https://vborg.vbsupport.ru/showthrea...threadid=42360

crazza 09-19-2002 06:54 PM

There's a tiny error in the php code for this hack. Because of this, the colour for 75% and up will never work..

This is the original code:

Quote:

if ($inboxpms < 1) {
$pmpercent = "1"; // stop divisions by zero
} else {
$pmpercent = round(($inboxpms[messages] / $pmquota) * 100,2);
}
if ($pmpercent>50) {
$barimg="https://vborg.vbsupport.ru/images/yellow.gif";
} elseif ($pmpercent>75) {
$barimg="https://vborg.vbsupport.ru/images/red.gif";
} else {
$barimg="https://vborg.vbsupport.ru/images/green.gif";
}
It should be changed to

Quote:

if ($inboxpms < 1) {
$pmpercent = "1"; // stop divisions by zero
} else {
$pmpercent = round(($inboxpms[messages] / $pmquota) * 100,0);
}
if ($pmpercent>75) {
$barimg="https://vborg.vbsupport.ru/images/red.gif";
} elseif ($pmpercent>50) {
$barimg="https://vborg.vbsupport.ru/images/yellow.gif";
} else {
$barimg="https://vborg.vbsupport.ru/images/green.gif";
}

I have tested this.. and it works..

crazza 09-19-2002 07:03 PM

I've done some additional editing on the php and template code, to add a view of outbox % too..

The full php enhancement now looks like this:

Quote:

//PM GAUGE HACK BY GOBLIN and Installed by CraZ on September 19, 2002

$inboxpms=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND folderid=0 $ignoreusers");
if ($inboxpms < 1) {
$pmpercent = "1"; // stop divisions by zero
} else {
$pmpercent = round(($inboxpms[messages] / $pmquota) * 100,0);
}
if ($pmpercent>75) {
$barimg="{imagesfolder}/red.gif";
} elseif ($pmpercent>50) {
$barimg="{imagesfolder}/yellow.gif";
} else {
$barimg="{imagesfolder}/green.gif";
}

// outbox part by CRAZ

$outboxpms=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND folderid='-1' $ignoreusers");
if ($outboxpms < 1) {
$outpmpercent = "1"; // stop divisions by zero
} else {
$outpmpercent = round(($outboxpms[messages] / $pmquota) * 100,0);
}
if ($outpmpercent>75) {$outbarimg="{imagesfolder}/red.gif";}
elseif ($outpmpercent>50) {$outbarimg="{imagesfolder}/yellow.gif";}
else {$outbarimg="{imagesfolder}/green.gif";}

//PM GAUGE HACK BY GOBLIN
To the privfolder template I've added the following (in stead of the original alterations for this hack..

Quote:

<br>


<table cellpadding="{tableouterborderwidth}" cellspacing="0" border="0" bgcolor="{tablebordercolor}" {tableouterextra} width="{contenttablewidth}" align="center"><tr><td>
<table cellpadding="4" cellspacing="{tableinnerborderwidth}" border="0" {tableinnerextra} width="100%">
<tr>
<td width="50%" bgcolor="{secondaltcolor}"><smallfont>Je Inbox is $pmpercent% vol</td>
<td width="50%" bgcolor="{secondaltcolor}"><smallfont>Je Outbox is $outpmpercent% vol</td>
</tr>

<tr>
<td width="50%" bgcolor="{secondaltcolor}"><img src="$barimg" width="$pmpercent%" height="9">
<table border="0" cellspacing="1" width="100%">
<tr>
<td width="33%"><smallfont>0%</td>
<td width="34%"><p align="center"><smallfont>50%</td>
<td width="33%"><p align="right"><smallfont>100%</smallfont></p></td>
</tr>
</table>
</td>

<td width="50%" bgcolor="{secondaltcolor}"><img src="$outbarimg" width="$outpmpercent%" height="9">
<table border="0" cellspacing="1" width="100%">
<tr>
<td width="33%"><smallfont>0%</td>
<td width="34%"><p align="center"><smallfont>50%</td>
<td width="33%"><p align="right"><smallfont>100%</smallfont></p></td>
</tr>
</table>
</td>


</tr>
</table>
</td></tr></table>

<br>


As you can see, the colspan of 7 is gone.. I've taken the liberty to place the gauges outside of the message table.. so insert the code above the table declarations (there are two).. and not directly above the $privatemessages

See attachment for a screenshot (never mind the dutch lingo)..

Dynamic One 11-01-2002 07:41 PM

Thanks m8. had already dl another1, but I will see wich one is the easiest to install.

Dynamic One 11-15-2002 10:39 AM

Who can please help me with this ??

I Have posted some test PM and I only see thet it's using 1%, When I delete them it stays on 1 %.

who knows what I'm doing wrong.

PS:
Sometimes I get tis error:
Warning: Division by zero in ....................private.php on line 106

Regards,

DO.

mehungie2 01-30-2003 11:06 PM

is there anyway to make this count all the folders in ur pm box, not just inbox, because peoples pm boxes get full but it doesnt show full on forum home cause its just counting inbox

iceman11111 04-06-2003 04:34 PM

Great Hack!!!

Very very easy to install!

This should be a beginners first hack!

:)

dede1 05-20-2003 07:37 PM

Hallo

if the p.o. box is full to 100% remains the yellow bar it comes no red
someone where the error is white there?

JustAskJulie 03-31-2004 09:47 PM

Just installed on 2.3.4 and it works great.

XJeepguy 04-06-2004 04:46 PM

In the instructions where it says " ** OPEN INDEX.PHP and find

if ($newpm['messages']==0) {

** ADD ABOVE, the below

//PM GAUGE HACK BY GOBLIN"

What exactly does ADD ABOVE , the below mean ??? Add the code above where it says or below that top code ?

Thanks

JustAskJulie 04-10-2004 03:50 PM

Well it seemed to work great but the guage does not appear to be accurate. As the admin, I have no idea what my limit on PM's is or where it is set (if any). And recently the gauge got up to about 85% for my account. HOwever, after deleting all of the sent PM's it still didn't go down.

For standard users, their limit is set at 50 PM's and I have had reports that the bar shows them at 25% with 48 PM's. Something is not right here. Is there a place in the hack that I need to specify what the PM limit is?

basskiller 05-04-2004 12:21 AM

I can't even get the notepad to open

Rich 05-04-2004 01:46 PM

[/QUOTE]In the instructions where it says " ** OPEN INDEX.PHP and find

if ($newpm['messages']==0) {

** ADD ABOVE, the below

//PM GAUGE HACK BY GOBLIN"

What exactly does ADD ABOVE , the below mean ??? Add the code above where it says or below that top code ?
[QUOTE]

That means add //PM GAUGE HACK BY GOBLIN" above the code if ($newpm['messages']==0) { in the INDEX.PHP file


All times are GMT. The time now is 04:57 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.01142 seconds
  • Memory Usage 1,766KB
  • 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
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (19)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete