PDA

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


Matt
01 Apr 2002, 16:00
You MUST have the original hack installed first - Created By Kreftt
http://www.vbulletin.org/forum/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
02 Apr 2002, 02:44
screenshot would be nice.

Erwin
02 Apr 2002, 08:56
Nice addon - works well. Good job.

Matt
02 Apr 2002, 13:21
Originally posted by Kumaro
screenshot would be nice.

http://www.vbulletin.org/forum/showthread.php?s=&threadid=36764

Post #20

John
04 Apr 2002, 00:25
Sweet!! This is a great hack, thanks :classic:

KISS
13 Apr 2002, 06:55
Very Nice Installed and worked Perfect. Thanks for the Add-on.

Mystics
21 Apr 2002, 21:28
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
21 Apr 2002, 21:48
Nice fix - thanks :)

Ordovicium
24 Apr 2002, 20:56
Very nice, thanks to both.

Khaybel
17 May 2002, 22:54
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
03 Jun 2002, 19:52
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
20 Jun 2002, 15:40
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
04 Jul 2002, 00:07
*Bump*

FleaBag
11 Jul 2002, 00:45
*Second bump...*

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

PET
14 Jul 2002, 00:19
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
30 Jul 2002, 02:04
Matt are you ever coming back?! :p

ManagerJosh
01 Sep 2002, 10:27
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
05 Oct 2002, 05:31
how can i make it that there stand for example 10 from 100 messages in use?

Tigga
29 Oct 2002, 03:05
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
29 Oct 2002, 03:20
That is an add-on. I think it was discussed in the same thread.

Tigga
05 Nov 2002, 03:30
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
13 Nov 2002, 13:36
Thanks for this noce looking addon m8.

Bison
13 Nov 2002, 21:37
Installed!

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

Esdee
14 Nov 2002, 20:11
Thanks PlurPlanet, I was looking for that.
Great add-on BTW. Now the hack truly is perfect :D

jjj0923
31 Dec 2002, 13:35
has anyone tacked the Message Tracking Count yet???

TīPau
07 Jan 2003, 14:44
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
07 Jan 2003, 18:20
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
18 Feb 2003, 02:32
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
26 Feb 2003, 04:58
Thanks for the extra code additions everyone, makes a difference to DragonNinja running on 2.3.0.

ImportPassion
03 Mar 2003, 00:36
And in your privfolder and privsend Templates find :

should read

And in your privfolder and privsent Templates find :

ImportPassion
03 Mar 2003, 01:23
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
23 Mar 2003, 20:19
Installed in vb 2.3.0 but quite messy to do.

AlexanderT
22 Apr 2003, 03:31
03-03-03 at 01:23 AM 7thgenCivic.Com said this in Post #31 (http://www.vbulletin.org/forum/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
06 May 2003, 16:05
07-14-02 at 12:19 AM PET said this in Post #15 (http://www.vbulletin.org/forum/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
07 May 2003, 00:57
11-04-02 at 11:30 PM Tigga said this in Post #21 (http://www.vbulletin.org/forum/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
07 May 2003, 03:39
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
31 May 2003, 09:46
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
03 Jun 2003, 07:06
05-31-03 at 03:46 AM nymyth said this in Post #37 (http://www.vbulletin.org/forum/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
03 Jun 2003, 07:33
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
16 Jun 2003, 03:18
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
16 Jun 2003, 03:38
Today at 09:18 PM Onkel_Tom said this in Post #40 (http://www.vbulletin.org/forum/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
25 Jun 2003, 23:25
Will this be re-done for vB 3?

Onkel_Tom
25 Jun 2003, 23:42
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
29 Jun 2003, 23:35
Hi Tom ..

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

http://www.vbulletin.org/forum/images/pm_folders.gif

Here's the link to it ....

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

Onkel_Tom
30 Jun 2003, 02:02
Many thanks sharjah, I was blind ;)

Gutspiller
05 Jul 2003, 20:09
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
05 Jul 2003, 21:59
Today at 02:09 PM Gutspiller said this in Post #46 (http://www.vbulletin.org/forum/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...http://www.vbulletin.org/forum/showthread.php?postid=403742#post403742 But it there was a way to replace it with what I did would help the noobs.

groovesalad
11 Jul 2003, 04:21
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
22 Jul 2003, 05:03
@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
05 Sep 2003, 02:31
Good 1

Alidar
14 Nov 2003, 23:05
very nice addition, I love it!!!

Deacon Frost
19 Jan 2004, 22:39
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
13 Jun 2004, 04:01
i have all the bug fixes installed and still cant see the number of messages
it just display ()
anyone help with this thanks