Log in

View Full Version : [ADD-ON] Improved PM Folderview PM Totals


Matt
03-31-2002, 10:00 PM
You MUST have the original hack installed first - Created By Kreftt
https://vborg.vbsupport.ru/showthread.php?s=&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
Originally posted by Kumaro
screenshot would be nice.

https://vborg.vbsupport.ru/showthread.php?s=&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):$msginfolder = $DB_site->query_first("SELECT COUNT(*) AS foldermsgtotal FROM privatemessage WHERE userid=$bbuserinfo[userid] AND folderid=$folder[folderid]");with $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$msgin_inbox = $DB_site->query_first("SELECT COUNT(*) AS inbox_msgtotal FROM privatemessage WHERE userid=$bbuserinfo[userid] AND folderid='0'");to $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:
<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:
<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:
<td bgcolor="#13486D" width="100%"><normalfont><a href="private.php?s=$session[sessionhash]&folderid=0">Inbox</a> ($inbox_msgtotal)</font></td>


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


Should Be:
<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:
<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:
<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
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:
eval("\$folderboxeshack .= \"".gettemplate("priv_showfolders_folderbit_hack",1,0)."\";");

Right above that add:
$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
/////////////////////////////////////////////////////////////////////////////////////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:


//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 :

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


//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
03-03-03 at 01:23 AM 7thgenCivic.Com said this in Post #31 (https://vborg.vbsupport.ru/showthread.php?postid=360371#post360371)
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)

$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
07-14-02 at 12:19 AM PET said this in Post #15 (https://vborg.vbsupport.ru/showthread.php?postid=272334#post272334)
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
11-04-02 at 11:30 PM Tigga said this in Post #21 (https://vborg.vbsupport.ru/showthread.php?postid=318807#post318807)
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:
eval("\$folderboxeshack .= \"".gettemplate("priv_showfolders_folderbit_hack",1,0)."\";");

Right above that add:
$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
05-31-03 at 03:46 AM nymyth said this in Post #37 (https://vborg.vbsupport.ru/showthread.php?postid=402237#post402237)
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:
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:
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 ?

Sam FT
06-16-2003, 01:38 AM
Today at 09:18 PM Onkel_Tom said this in Post #40 (https://vborg.vbsupport.ru/showthread.php?postid=409405#post409405)
[B]Sorry Music Pirate, but there is a mistake in your compilation.

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


Sorry about that Onkel.

I forgot to remove that line, several of the fixes overlapped each other and I just forgot to remove it. But I have remove the line duplicate line. Sorry everybody...

ogden2k
06-25-2003, 09:25 PM
Will this be re-done for vB 3?

Onkel_Tom
06-25-2003, 09:42 PM
I'm still missing a function to remove the custom Folders from the PM System. I can create new own folders but can't remove them.

Has anybody a solution for that ?

sharjah
06-29-2003, 09:35 PM
Hi Tom ..

You can do that through "Folders button"
(You?ll find it underneath your messages)

https://vborg.vbsupport.ru/images/pm_folders.gif

Here's the link to it ....

http://your_site.com/v/private.php?s=&action=editfolders

Onkel_Tom
06-30-2003, 12:02 AM
Many thanks sharjah, I was blind ;)

Gutspiller
07-05-2003, 06:09 PM
This hack really should be updated to replace 13486D with { firstaltcolor } (without the spaces of course) A small thing, but it would help the noobs.

Sam FT
07-05-2003, 07:59 PM
Today at 02:09 PM Gutspiller said this in Post #46 (https://vborg.vbsupport.ru/showthread.php?postid=415532#post415532)
This hack really should be updated to replace 13486D with { firstaltcolor } (without the spaces of course) A small thing, but it would help the noobs.

That was the reason why I just I compiled an update of all the bugs fixes and what not...https://vborg.vbsupport.ru/showthread.php?postid=403742#post403742 But it there was a way to replace it with what I did would help the noobs.

groovesalad
07-11-2003, 02:21 AM
I see several of these in my private.php code:

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];


Which one am I supposed to put this under?

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///////////////////////////////////////////////////////////////


Would someone kindly help?

Ludelover
07-22-2003, 03:03 AM
@Groovesalad

They look similar yes but if you read the code carefully you'll notice some differences. THere is only one section that is identical to that.

MaDCaT75
09-05-2003, 12:31 AM
Good 1

Alidar
11-14-2003, 09:05 PM
very nice addition, I love it!!!

Deacon Frost
01-19-2004, 08:39 PM
ok, since I installed a newer version (2.3.4) it worked out fine, but now I have another prob...

when I click on "track messages" I get an error like:

Parse error: parse error, unexpected T_VARIABLE in /home/virtual/site3/fst/var/www/html/forum/private2.php on line 308

which says:

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

Crank
06-13-2004, 02:01 AM
i have all the bug fixes installed and still cant see the number of messages
it just display ()
anyone help with this thanks