Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
PM Statistics bar in thread view Details »»
PM Statistics bar in thread view
Version: 1.00, by Zzed Zzed is offline
Developer Last Online: Feb 2012 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 08-15-2002 Last Update: Never Installs: 4
 
No support by the author.

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

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 08-16-2002, 07:55 PM
Zzed's Avatar
Zzed Zzed is offline
 
Join Date: Feb 2002
Location: Glendale, CA, USA
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #13  
Old 08-16-2002, 07:56 PM
joeboo's Avatar
joeboo joeboo is offline
 
Join Date: Jun 2002
Posts: 149
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

oh ho.. daddy likes this hack i will install it soon
Reply With Quote
  #14  
Old 08-18-2002, 05:00 AM
Zzed's Avatar
Zzed Zzed is offline
 
Join Date: Feb 2002
Location: Glendale, CA, USA
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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")."\");"); 
Reply With Quote
  #15  
Old 08-18-2002, 05:22 AM
Donkeyballz's Avatar
Donkeyballz Donkeyballz is offline
 
Join Date: Apr 2002
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey,

This looks good, I'm gonna install it
Reply With Quote
  #16  
Old 08-18-2002, 05:31 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #17  
Old 08-18-2002, 06:00 AM
Zzed's Avatar
Zzed Zzed is offline
 
Join Date: Feb 2002
Location: Glendale, CA, USA
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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")."\");"); 
Reply With Quote
  #18  
Old 08-18-2002, 06:04 AM
NexDog's Avatar
NexDog NexDog is offline
 
Join Date: Mar 2002
Location: Lost in the Nexus
Posts: 388
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Um, sorry if I'm missing the boat but what stats is it reading? How many PMs someone has received or what excatly?
Reply With Quote
  #19  
Old 08-18-2002, 06:18 AM
Zzed's Avatar
Zzed Zzed is offline
 
Join Date: Feb 2002
Location: Glendale, CA, USA
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It is the total number of PM's a user has in their inbox and sent items folder.
Reply With Quote
  #20  
Old 08-18-2002, 06:32 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #21  
Old 08-18-2002, 06:38 AM
Zzed's Avatar
Zzed Zzed is offline
 
Join Date: Feb 2002
Location: Glendale, CA, USA
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You're very welcome.

It counts all the messages that belong to a particular userid.
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 04:41 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.04872 seconds
  • Memory Usage 2,340KB
  • Queries Executed 25 (?)
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
  • (5)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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_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