vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=5)
-   -   [ADD-ON] Improved PM Folderview PM Totals (https://vborg.vbsupport.ru/showthread.php?t=36840)

Matt 03-31-2002 10:00 PM

[ADD-ON] Improved PM Folderview PM Totals
 
You MUST have the original hack installed first - Created By Kreftt
https://vborg.vbsupport.ru/showthrea...threadid=36764


-----

UPDATED : Ok everything should work now, both in private.php and private2.php. I have updated it to work with both files so if you downloaded it before please go through the file again and check you have got all of it.

What does it do?
- Displays total PM's In :
-- Inbox
-- Sent Items Folder
-- Custom Folders

Next Up...
-- Message Tracking (Display total read/unread)

Screencap
See Above Thread, Post #20

Working Demo
http://www.darkangeluk.com/forums/

All credit goes to Kreftt for creating the hack in the first place! :D

Kumaro 04-02-2002 12:44 AM

screenshot would be nice.

Erwin 04-02-2002 06:56 AM

Nice addon - works well. Good job.

Matt 04-02-2002 11:21 AM

Quote:

Originally posted by Kumaro
screenshot would be nice.
https://vborg.vbsupport.ru/showthrea...threadid=36764

Post #20

John 04-03-2002 10:25 PM

Sweet!! This is a great hack, thanks :classic:

KISS 04-13-2002 04:55 AM

Very Nice Installed and worked Perfect. Thanks for the Add-on.

Mystics 04-21-2002 07:28 PM

Hi,

First: Great Addon! :)

But one bug: if you have an user on your ignore list, and get a PM from him, you can't see the PM of him but the Gauge Hack counts it to the number of total PMs.

On the start page (index.php) you don't see this PM, because the the ignored users are excluded.

To fix this you should replace (in private.php and private2.php):
PHP Code:

$msginfolder $DB_site->query_first("SELECT COUNT(*) AS foldermsgtotal FROM privatemessage WHERE userid=$bbuserinfo[userid] AND folderid=$folder[folderid]"); 

with
PHP Code:

      $ignoreusers="";
      if (
trim($bbuserinfo['ignorelist'])!="") {
        
$ignoreusers='AND fromuserid<>'.implode(' AND fromuserid<>',explode(' 'trim($bbuserinfo['ignorelist'])));
      }
      
$msginfolder $DB_site->query_first("SELECT COUNT(*) AS foldermsgtotal FROM privatemessage WHERE userid=$bbuserinfo[userid] AND folderid=$folder[folderid] $ignoreusers"); 

Then change
PHP Code:

$msgin_inbox $DB_site->query_first("SELECT COUNT(*) AS inbox_msgtotal FROM privatemessage WHERE userid=$bbuserinfo[userid] AND folderid='0'"); 

to
PHP Code:

  $ignoreusers="";
  if (
trim($bbuserinfo['ignorelist'])!="") {
    
$ignoreusers='AND fromuserid<>'.implode(' AND fromuserid<>',explode(' 'trim($bbuserinfo['ignorelist'])));
  }
  
$msgin_inbox $DB_site->query_first("SELECT COUNT(*) AS inbox_msgtotal FROM privatemessage WHERE userid=$bbuserinfo[userid] AND folderid='0' $ignoreusers"); 

Greetings,
Mystics

John 04-21-2002 07:48 PM

Nice fix - thanks :)

Ordovicium 04-24-2002 06:56 PM

Very nice, thanks to both.

Khaybel 05-17-2002 08:54 PM

Very nice, thanks to both as well :) I just added the install and it works great, here is a screen shot of your changes, ;) for the addon.

Live Demo, requires register, so reason for screenshot below.
http://forums.orbsydia.com/index.php

PS: I added Mystics's bug fix as well, thanks ;)

updated: June 13th 2002
I just installed the Improved PM Folderview + Addon and Ignore Fix, on VB 2.2.6, the install went really well, no errors.

I'll try and get a new screen shot up soon, wanting to add the PM backup script as well, thank you guys for all your hard work on this.

I was thinking of putting a small txt file together, with all 3 hacks, together, with table color changes, if you guys want me to.

till then my forums are located at:
http://forums.orbsydia.com/index.php

Boofo 06-03-2002 05:52 PM

In the private.php, the first part of the code I need to add the hack code below is in there a couple of times. Do I need to replace all the code below ALL instances of it?

FleaBag 06-20-2002 01:40 PM

Installed on 2.2.6, working well. One thing though, aren't the custom folders supposed to have totals next to them? Because the instructiosn don't contain any template edits to show this. Thanks for this addon. :)

FleaBag 07-03-2002 10:07 PM

*Bump*

FleaBag 07-10-2002 10:45 PM

*Second bump...*

It'd be cool to get this working, would it not?

PET 07-13-2002 10:19 PM

sugestion :

when i create a folder. If i want to delete it...i must go to folders room. Well you can put a DELETE button...on each custom forum.

FleaBag 07-30-2002 12:04 AM

Matt are you ever coming back?! :p

ManagerJosh 09-01-2002 08:27 AM

I noticed the templates had a minor glitch, Matt in your attached file.

ONE Disclaimer
Due to PHP Boxes parsing the statement "{ firstaltcolor}"
I have displayed it as "{ firstaltcolor}"
Please remove the space between { and f


1) In template "priv_showfolders_folderbit_hack"

Original:
PHP Code:

<tr>
<
td  bgcolor="#13486D" width="100%"><normalfont><a href="private.php?s=$session[sessionhash]&folderid=$folder[folderid]">$folder[title]</a> ($foldermsgtotal)</font></td>
</
tr


Should Be:
PHP Code:

<tr>
<
td  bgcolor="{ firstaltcolor}" width="100%"><normalfont><a href="private.php?s=$session[sessionhash]&folderid=$folder[folderid]">$folder[title]</a> ($foldermsgtotal)</font></td>
</
tr



2) In template "privfolder"

Original:
PHP Code:

<td  bgcolor="#13486D" width="100%"><normalfont><a href="private.php?s=$session[sessionhash]&folderid=0">Inbox</a> ($inbox_msgtotal)</font></td


Should Be:
PHP Code:

<td  bgcolor="{ firstaltcolor}" width="100%"><normalfont><a href="private.php?s=$session[sessionhash]&folderid=0">Inbox</a> ($inbox_msgtotal)</font></td


3) In template "privfolder"

Original:
PHP Code:

<td bgcolor="#13486D" width="100%"><normalfont><a href="private.php?s=$session[sessionhash]&folderid=-1">Sent Items</a> ($sent_msgtotal)</font></td


Should Be:
PHP Code:

<td bgcolor="{ firstaltcolor}" width="100%"><normalfont><a href="private.php?s=$session[sessionhash]&folderid=-1">Sent Items</a> ($sent_msgtotal)</font></td


3) In template "privfolder"

Original:
PHP Code:

<tr>
       <
td  bgcolor="#13486D" width="100%"><normalfont><a href="private.php?s=$session[sessionhash]&folderid=0">Inbox</a> ($inbox_msgtotal)</font></td>
      </
tr>
      <
tr>
       <
td bgcolor="#13486D" width="100%"><normalfont><a href="private.php?s=$session[sessionhash]&folderid=-1">Sent Items</a> ($sent_msgtotal)</font></td>
      </
tr


Should Be:
PHP Code:

<tr>
       <
td  bgcolor="{ firstaltcolor}" width="100%"><normalfont><a href="private.php?s=$session[sessionhash]&folderid=0">Inbox</a> ($inbox_msgtotal)</font></td>
      </
tr>
      <
tr>
       <
td bgcolor="{ firstaltcolor}" width="100%"><normalfont><a href="private.php?s=$session[sessionhash]&folderid=-1">Sent Items</a> ($sent_msgtotal)</font></td>
      </
tr



The above changes are just aesthetics, but at least for users who haven't figured it out yet, you realize it was a minor coding error, but easily corrected :)

Exo 10-05-2002 03:31 AM

how can i make it that there stand for example 10 from 100 messages in use?

Tigga 10-29-2002 01:05 AM

Quote:

Originally posted by GamerForums
Installed on 2.2.6, working well. One thing though, aren't the custom folders supposed to have totals next to them? Because the instructiosn don't contain any template edits to show this. Thanks for this addon. :)
I just installed on 2.2.8 and am having the same problem. It works great, but it won't show the number of messages in a custom folder. I've tried playing around with it a bit (even re-installed it), but can't seem to figure out what's wrong. Anyone happen to know how to fix this?

Boofo 10-29-2002 01:20 AM

That is an add-on. I think it was discussed in the same thread.

Tigga 11-05-2002 01:30 AM

Well just incase anyone else is having the problem with the custom folders total not showing, I figured out what was wrong.

Open private.php and find:
PHP Code:

eval("\$folderboxeshack .= \"".gettemplate("priv_showfolders_folderbit_hack",1,0)."\";"); 

Right above that add:
PHP Code:

$msginfolder $DB_site->query_first("SELECT COUNT(*) AS foldermsgtotal FROM privatemessage
 WHERE userid=
$bbuserinfo[userid] AND folderid=$folder[folderid]");
$foldermsgtotal $msginfolder[foldermsgtotal]; 

Then you can look for another instance of the code above that you just added (near the bottom of the file) and remove it. Works great now. :)

Dynamic One 11-13-2002 11:36 AM

Thanks for this noce looking addon m8.

Bison 11-13-2002 07:37 PM

Installed!

Adds a very professional look to the private message folder count!

Esdee 11-14-2002 06:11 PM

Thanks PlurPlanet, I was looking for that.
Great add-on BTW. Now the hack truly is perfect :D

jjj0923 12-31-2002 11:35 AM

has anyone tacked the Message Tracking Count yet???

T?Pau 01-07-2003 12:44 PM

I did the Message Tracking.
It shows the unread/read PM

Just open both private.php and private2.php and find
PHP Code:

/////////////////////////////////////////////////////////////////////////////////////hack///////////////////////////////////////////////////////////////////
//// -- Begin PM Folder Totals
// Messages Inbox
$msgin_inbox $DB_site->query_first("SELECT COUNT(*) AS inbox_msgtotal FROM privatemessage WHERE userid=$bbuserinfo[userid] AND folderid='0'");
$inbox_msgtotal $msgin_inbox[inbox_msgtotal];
//      
// Messages Sent
$msgin_sent $DB_site->query_first("SELECT COUNT(*) AS sent_msgtotal FROM privatemessage WHERE userid=$bbuserinfo[userid] AND folderid='-1'");
$sent_msgtotal $msgin_sent[sent_msgtotal]; 

Below that add:

PHP Code:

//Message Tracking
$msgin_track $DB_site->query_first("SELECT COUNT(*) AS track_msgtotal FROM privatemessage WHERE fromuserid=$bbuserinfo[userid] AND receipt='1'");
$track_msgtotal $msgin_track[track_msgtotal];

$msgin_trackread $DB_site->query_first("SELECT COUNT(*) AS track_msgtotalread FROM privatemessage WHERE fromuserid=$bbuserinfo[userid] AND receipt='2'");
$track_msgtotalread $msgin_trackread[track_msgtotalread]; 

And in your privfolder and privsend Templates find :
Code:

<td bgcolor="#13486D" width="100%"><normalfont><a href="private2.php?s=$session[sessionhash]">Message Tracking</a></font></td>
and replace it with
Code:

<td bgcolor="#13486D" width="100%"><normalfont><a href="private2.php?s=$session[sessionhash]">Message Tracking</a>($track_msgtotal / $track_msgtotalread)</font></td>
Works on my 2.2.7

Boofo 01-07-2003 04:20 PM

Work excellent of version 2.2.9, also. Thanks! :)

Is there a way of including the queries in the code above it to knock two more queries off of the page?

PixelFx 02-18-2003 12:32 AM

hey guys, just wanted to say great hack, I got it working with vbulletin v2.3.0, works great, I also added matts addon, with a few changes, to match colors, but otherwise everything installed perfectly.

Example image:
http://www.pixelfx.ca/code/imgs/pm_hack.gif

thanks for all your hard work guys :)

FleaBag 02-26-2003 02:58 AM

Thanks for the extra code additions everyone, makes a difference to DragonNinja running on 2.3.0.

ImportPassion 03-02-2003 10:36 PM

Quote:

And in your privfolder and privsend Templates find :
should read

And in your privfolder and privsent Templates find :

ImportPassion 03-02-2003 11:23 PM

I just made some more changes.
Instead of displaying ( / ) or () if there is nothing there, I added this.

PHP Code:

//Message Tracking
$msgin_track $DB_site->query_first("SELECT COUNT(*) AS track_msgtotal FROM privatemessage WHERE fromuserid=$bbuserinfo[userid] AND receipt='1'");
//$track_msgtotal = $msgin_track[track_msgtotal];
if ($msgin_track[track_msgtotal]) :  
    
$track_msgtotal $msgin_track[track_msgtotal];
else :
    
$track_msgtotal 0;
endif;

$msgin_trackread $DB_site->query_first("SELECT COUNT(*) AS track_msgtotalread FROM privatemessage WHERE fromuserid=$bbuserinfo[userid] AND receipt='2'");
$track_msgtotalread $msgin_trackread[track_msgtotalread];
//$track_msgtotalread = $msgin_track[track_msgtotalread];
if ($msgin_track[track_msgtotalread]) :  
    
$track_msgtotalread $msgin_track[track_msgtotalread];
else :
    
$track_msgtotalread 0;
endif; 


Stud_Muffin 03-23-2003 06:19 PM

Installed in vb 2.3.0 but quite messy to do.

AlexanderT 04-22-2003 01:31 AM

Quote:

03-03-03 at 01:23 AM 7thgenCivic.Com said this in Post #31
I just made some more changes.
Instead of displaying ( / ) or () if there is nothing there, I added this.

Yours contains some typo mistakes. Here the corrected one (apply in both private.php and private2.php)

PHP Code:

  $msgin_track $DB_site->query_first("SELECT COUNT(*) AS track_msgtotal FROM privatemessage WHERE fromuserid=$bbuserinfo[userid] AND receipt='1'");
  if (
$msgin_track[track_msgtotal]) :  
      
$track_msgtotal $msgin_track[track_msgtotal];
  else :
      
$track_msgtotal 0;
  endif;

  
$msgin_trackread $DB_site->query_first("SELECT COUNT(*) AS track_msgtotalread FROM privatemessage WHERE fromuserid=$bbuserinfo[userid] AND receipt='2'");
  if (
$msgin_trackread[track_msgtotalread]) :  
      
$track_msgtotalread $msgin_trackread[track_msgtotalread];
  else :
      
$track_msgtotalread 0;
  endif; 


RetroDreams 05-06-2003 02:05 PM

Quote:

07-14-02 at 12:19 AM PET said this in Post #15
sugestion :

when i create a folder. If i want to delete it...i must go to folders room. Well you can put a DELETE button...on each custom forum.

Has this been accomplished? Also what about alphabetizing the folders?

ogden2k 05-06-2003 10:57 PM

Quote:

11-04-02 at 11:30 PM Tigga said this in Post #21
Well just incase anyone else is having the problem with the custom folders total not showing, I figured out what was wrong.

Open private.php and find:
PHP Code:

eval("\$folderboxeshack .= \"".gettemplate("priv_showfolders_folderbit_hack",1,0)."\";"); 

Right above that add:
PHP Code:

$msginfolder $DB_site->query_first("SELECT COUNT(*) AS foldermsgtotal FROM privatemessage
 WHERE userid=
$bbuserinfo[userid] AND folderid=$folder[folderid]");
$foldermsgtotal $msginfolder[foldermsgtotal]; 

Then you can look for another instance of the code above that you just added (near the bottom of the file) and remove it. Works great now. :)

Thanks!

XFLBret 05-07-2003 01:39 AM

i installed this in 2.3.0 and it seems to be working OK.

I'm holding off installing the mentioned code in post 26 until boofo's question is answered. I'd like to save a couple queries myself.

and as for the addition proposed in post 31, I don't understand what it's supposed to do.

nymyth 05-31-2003 07:46 AM

my custom folders are still not showing a total......and i couldnt find the other instance you were talking about....any ideas...

Peace

Sam FT 06-03-2003 05:06 AM

Quote:

05-31-03 at 03:46 AM nymyth said this in Post #37
my custom folders are still not showing a total......and i couldnt find the other instance you were talking about....any ideas...

Peace

There isn't any, because if you look at the date when it was posted it was back in November of 2002. So think it had an extra instance of it, but now with the newer version there isn't any.

Sam FT 06-03-2003 05:33 AM

I was reading through this thread and noticed some people said that it was quite messy getting through this hack. And I am surprised that someone didn't already compile all the modifications and fixes submitted by everyone in this thread. So I decided to that it need to be done and that way it would be much easier on everyone.

Thanks to Matt for creating this hack. And also thanks to Mystics, ManagerJosh, Tigga, T?Pau, 7thgenCivic.Com, & AlexanderT for modifying and fixing to this hack.

Special thanks goes out to Kreft for creating the original Improved PM Folderview Hack.

*File has been updated 6/15/03*

Onkel_Tom 06-16-2003 01:18 AM

Sorry Music Pirate, but there is a mistake in your compilation.

you wrote:
PHP Code:

OPEN PRIVATE.php

FIND
:

if (
$bbuserinfo[pmfolders]) {
    
$allfolders split("\n"trim($bbuserinfo[pmfolders]));
    
$foldercount 0;
    while (list(
$key,$val)=each($allfolders)) {
      
$folder split("\|\|\|"$val);
      
$foldercount++;
      
$highestnum $folder[0];

      
$folder[folderid]=$folder[0]+1;
      
$folder[title]=$folder[1];


BELOW THAT ADD

//////////////////////////////////////hack////////////////////////////////////////

$ignoreusers=""
      if (
trim($bbuserinfo['ignorelist'])!="") { 
        
$ignoreusers='AND fromuserid<>'.implode(' AND fromuserid<>',explode(' 'trim($bbuserinfo['ignorelist']))); 
      } 
      
$msginfolder $DB_site->query_first("SELECT COUNT(*) AS foldermsgtotal FROM privatemessage WHERE userid=$bbuserinfo[userid] AND folderid=$folder[folderid] $ignoreusers");
$foldermsgtotal $msginfolder[foldermsgtotal];

///////////////////////////////////////hack///////////////////////////////////////


FIND

///////////////////////////////////////hack///////////////////////////////////////

eval("\$folderboxeshack .= \"".gettemplate("priv_showfolders_folderbit_hack",1,0)."\";");
      }
  }

///////////////////////////////////////hack///////////////////////////////////////


ABOVE THAT ADD

///////////////////////////////////////hack//////////////////////////////////////

$msginfolder $DB_site->query_first("SELECT COUNT(*) AS foldermsgtotal FROM privatemessage
WHERE userid=
$bbuserinfo[userid] AND folderid=$folder[folderid]");
$foldermsgtotal $msginfolder[foldermsgtotal];

///////////////////////////////////////hack/////////////////////////////////////// 

But correct is:
PHP Code:

OPEN PRIVATE.php

FIND
:

if (
$bbuserinfo[pmfolders]) {
    
$allfolders split("\n"trim($bbuserinfo[pmfolders]));
    
$foldercount 0;
    while (list(
$key,$val)=each($allfolders)) {
      
$folder split("\|\|\|"$val);
      
$foldercount++;
      
$highestnum $folder[0];

      
$folder[folderid]=$folder[0]+1;
      
$folder[title]=$folder[1];


BELOW THAT ADD

/////////////////////////////////////////hack////////////////////////////////////

$ignoreusers=""
      if (
trim($bbuserinfo['ignorelist'])!="") { 
        
$ignoreusers='AND fromuserid<>'.implode(' AND fromuserid<>',explode(' 'trim($bbuserinfo['ignorelist']))); 
      } 
      
$msginfolder $DB_site->query_first("SELECT COUNT(*) AS foldermsgtotal FROM privatemessage WHERE userid=$bbuserinfo[userid] AND folderid=$folder[folderid] $ignoreusers");
$foldermsgtotal $msginfolder[foldermsgtotal];

/////////////////////////////////////////hack///////////////////////////////////// 

The second part you wrote in your instruction is duplicate with the first part !

@ all
How can I delete custom Folders from PM System ?
I didn't find a solution how to delete the added own folders. Am I blind ?


All times are GMT. The time now is 04:30 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.03161 seconds
  • Memory Usage 1,941KB
  • 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
  • (2)bbcode_code_printable
  • (22)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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