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 Statistics bar in thread view (https://vborg.vbsupport.ru/showthread.php?t=42360)

Zzed 08-15-2002 10:00 PM

PM Statistics bar in thread view
 
This hack was requested by SgtSling.

This is a very simple hack that displays the PM statistics of a user in the thread view screen.
It requires no template modifications because it appends itself on to $post[posts]. ;)

Here is how to implement this hack.

In showthread.php look for the following code:
PHP Code:

while ($post=$DB_site->fetch_array($posts) and $counter++<$perpage) {

  if (
$postdone[$post[postid]]) {
    
$counter--;
    continue;
  } else {
    
$postdone[$post[postid]]=1;
  }
  
$postbits .= getpostbit($post);


And replace it with the following:
PHP Code:

while ($post=$DB_site->fetch_array($posts) and $counter++<$perpage) {

  if (
$postdone[$post[postid]]) {
    
$counter--;
    continue;
  } else {
    
$postdone[$post[postid]]=1;
  }

  
$pmcount=$DB_site->query_first("select count(*) as msgs from privatemessage where userid = $post[userid]");
  
$pmratio 100 $pmcount[msgs] / $pmquota;
  if(
$pmratio 100) {
    
$pmratio 100;
  }
  
$pmstats "<p><font face=\"verdana\" size=\"1\">PM Stats:</font><br>";
    
$pmstats "$pmstats<table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" width=\"80%\" bordercolor=\"#000000\" bordercolorlight=\"#000000\" bordercolordark=\"#000000\"><tr><td bgcolor=\"#b5b5b5\"><img src=\"images/polls/bar3.gif\" width=\"$pmratio%\" height=\"9\"></td></tr></table>";
  
$pmstats "$pmstats\n$pmcount[msgs]/$pmquota";
  
$post[posts]="$post[posts]$pmstats";

  
$postbits .= getpostbit($post);


Click on the following link for a screenshot of this hack: http://www.ls1.com/forums/showthread...hreadid=110647

[D]Vincent 08-16-2002 08:46 AM

Great hack, nice idea. I might install this a little later.

Zzed 08-16-2002 08:57 AM

Thank you. You are too kind. :)

DudeSicko 08-16-2002 08:59 AM

I get this when i install it.

PHP Parse error: parse error, unexpected T_STRING in C:\Inetpub\webhotel\xxxxxxxx\forum\showthread.php on line 435

Zzed 08-16-2002 09:07 AM

Quote:

Originally posted by DudeSicko
I get this when i install it.

PHP Parse error: parse error, unexpected T_STRING in C:\Inetpub\webhotel\xxxxxxxx\forum\showthread.php on line 435

Sorry :( My bad. :(

I copied and pasted this from my editor and it copied the "\" along with the line breaks.

It's fixed now. :)

morrow 08-16-2002 01:52 PM

I like that a lot! Is there any way I can get instructions and code if possible so I can add that to my site?

Thanks

Dennis

Zzed 08-16-2002 02:41 PM

Quote:

Originally posted by morrow
I like that a lot! Is there any way I can get instructions and code if possible so I can add that to my site?

Thanks

Dennis

Here you go: Spoiler Tag Instructions :)

TECK 08-16-2002 03:22 PM

Who is the person who rated "1" this thread?
If you think is really worth nothing, why don't you write up one similar... better?

/me just rated the thread 5

Attrox 08-16-2002 05:15 PM

Nice idea, I may install it soon. And yes, I'm not sure why this has a thread rating so low...

Boofo 08-16-2002 07:33 PM

Can this be made to work with private messages in the privmsg template?

Also, I want that spoiler vbcode, can I have it? Please? :)

Zzed 08-16-2002 07:55 PM

Quote:

Originally posted by Boofo
Can this be made to work with private messages in the privmsg template?

Also, I want that spoiler vbcode, can I have it? Please? :)

Yes it can. You just need to modify the query string to do that. Feel free to PM or Email me if you need help with that. :)

And the link for the spoiler tag is in Post #7 of this thread. ;)

joeboo 08-16-2002 07:56 PM

oh ho.. daddy likes this hack :) i will install it soon

Zzed 08-18-2002 05:00 AM

If you are interested inseeing the PM stats in the private message view screen do the make the following changes.

In private.php:
Look for the following code:
PHP Code:

eval("dooutput(\"".gettemplate("privmsg")."\");"); 

Change it to the following:
PHP Code:

  $pmcount=$DB_site->query_first("select count(*) as msgs from privatemessage where userid = $fromuserinfo[userid]");
  
$pmratio 100 $pmcount[msgs] / $pmquota;
  if(
$pmratio 100) {
    
$pmratio 100;
  }
  
$pmstats "<p><font face=\"verdana\" size=\"1\">PM Stats:</font><br>";
  
$pmstats "$pmstats<table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" width=\"80%\" bordercolor=\"#000000\" bordercolorlight=\"#000000\" bordercolordark=\"#000000\"><tr><td bgcolor=\"#b5b5b5\"><img src=\"images/polls/bar3.gif\" width=\"$pmratio%\" height=\"9\"></td></tr></table>";
  
$pmstats "$pmstats\n$pmcount[msgs]/$pmquota";
  
$fromuserinfo[posts]="$fromuserinfo[posts]$pmstats";

  eval(
"dooutput(\"".gettemplate("privmsg")."\");"); 


Donkeyballz 08-18-2002 05:22 AM

Hey,

This looks good, I'm gonna install it :D

Boofo 08-18-2002 05:31 AM

Is there a way to have it only show up for Admins and Supermods? Great job, by the way! Works execellent. :)

Anything on the other that we talked about? ;)

Zzed 08-18-2002 06:00 AM

Here is the supermod/admin version ;)
PHP Code:

if(($bbuserinfo[usergroupid]==5) OR ($bbuserinfo[usergroupid]==6)) {
  
$pmcount=$DB_site->query_first("select count(*) as msgs from privatemessage where userid = $fromuserinfo[userid]");
  
$pmratio 100 $pmcount[msgs] / $pmquota;
  if(
$pmratio 100) {
    
$pmratio 100;
  }
  
$pmstats "<p><font face=\"verdana\" size=\"1\">PM Stats:</font><br>";
  
$pmstats "$pmstats<table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" width=\"80%\" bordercolor=\"#000000\" bordercolorlight=\"#000000\" bordercolordark=\"#000000\"><tr><td bgcolor=\"#b5b5b5\"><img src=\"images/polls/bar3.gif\" width=\"$pmratio%\" height=\"9\"></td></tr></table>";
  
$pmstats "$pmstats\n$pmcount[msgs]/$pmquota";
  
$fromuserinfo[posts]="$fromuserinfo[posts]$pmstats";
}
  eval(
"dooutput(\"".gettemplate("privmsg")."\");"); 


NexDog 08-18-2002 06:04 AM

Um, sorry if I'm missing the boat but what stats is it reading? How many PMs someone has received or what excatly?

Zzed 08-18-2002 06:18 AM

It is the total number of PM's a user has in their inbox and sent items folder.

Boofo 08-18-2002 06:32 AM

Thank you very much! Works great! :)

BTW: Will this count messages that they have in another folder? Like if they create a folder and move messages to it?

Zzed 08-18-2002 06:38 AM

You're very welcome. :)

It counts all the messages that belong to a particular userid.

NexDog 08-18-2002 10:40 AM

Thanks for clarifying that for me. Not sure if I can use it but it's great idea. :)

DudeSicko 09-04-2002 09:18 AM

Great works fine now :)

Thx.

Bison 12-17-2002 07:41 AM

If I have certain PM quota's for different usergroups, how do I get the numbers to display the amount each user HAS in the statistics column under their usergroup ... viewable to everyone?

Right now, I can get it to show the amount that the logged in user has but when I view everyone's PM count, it displays the amount that I set for the admin under everyone.

If I login under a regular user's account, it displays the right amount that they are authorized, but eveyone else has the same numbers as well!

subu1 12-19-2002 05:22 AM

hey Friends and sorry for my english. How can i this Creat Hack to Place on another Place into the showthread, also I want to see this on the last Place, behind (level, MemberID,Age etc.)

can you help me?

thanks friends

subu1 12-26-2002 01:50 PM

huhu???? *g*


All times are GMT. The time now is 03:51 AM.

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.01312 seconds
  • Memory Usage 1,795KB
  • 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_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (25)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