View Full Version : Small hack: New, unread, and total messages in PM folders
My first hack! Yay!
This should theoretically work for 2.0.0 and above, but I've only tested it to work in 2.0.3 and 2.2.0.
What this hack does is just allow you to use $allpm[messages], $newpm[messages], and $unreadpm[messages] like in index.php, in your privfolder template. I found it handy to be able to use this in the privfolder template because it's annoying to have to go back to index.php to find out how many messages you have left after deleting a crapload ;)
This little gem of a small hack is perfect for my needs, thank-you!
I'm surprised no one has replied to this thread ever as with a slight addition, it can cut back on some of our 'support' to our end users...
I don't know how many times I've had to explain to my users on why they can't receive PMs even after emptying their inboxes [the dreaded Sent Items folder].
Simply add another query to the instructions:
$unreadpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND folderid=-1 $ignoreusers");
And then put $sentpm[messages] sent messages wherever in your privfolder template
Well, that's how I'm using it :D
Cheers,
~Regs.
Chris M
04-20-2002, 10:25 AM
Sweet Hack...
I am installing it now!
Satan
Chris M
04-20-2002, 10:51 AM
I find that if you put this code instead, it looks better:
<b>|</b><smallfont><b>$newpm[messages]</b> New Messages <b>|</b></smallfont>
<smallfont><b>$unreadpm[messages]</b> Unread Messages <b>|</b></smallfont>
<smallfont><b>$allpm[messages]</b> Total Messages <b>|</b></smallfont>
<smallfont><b>$sentpm[messages]</b> Sent Messages <b>|</b></smallfont>
That makes the font smaller, and then it looks more vBulletin style...
I also added <b>|</b> Before and after each one, so that it seperates them better...
@Regs - You made a mistake in your php...It should be :
$sentpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND folderid=-1 $ignoreusers");
Not :
$unreadpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND folderid=-1 $ignoreusers");
:)
Satan
inetd
04-20-2002, 12:11 PM
You have screenshot?
Chris M
04-20-2002, 12:17 PM
I'll get you one...
Satan
Chris M
04-20-2002, 12:21 PM
I customised mine with the additions I said above, and I also added colour to it :
<font color="#FF972F">
Make sure you add this to the end of the group of text though :
</font>
Mine looks like this :
<font color="#FF972F">
<b>|</b><smallfont><b>$newpm[messages]</b> New Messages <b>|</b></smallfont> <smallfont><b>$unreadpm[messages]</b>
Unread Messages <b>|</b></smallfont> <smallfont><b>$allpm[messages]</b> Total
Messages <b>|</b></smallfont> <smallfont><b>$sentpm[messages]</b> Sent Messages
<b>|</b></smallfont> </font>
Screenshot below...
Satan
Chris M
04-20-2002, 12:22 PM
It is meant to be Orange, but it doesnt show up too well...
Satan
... Hellsatan. I just hurriedly copied and pasted the code from the original readme and forgot to change the first bit of code.
I had made the little template alterations as you suggested and added code to put it in a table like the rest of the pages.
I left that for others though :D
A good hack nonetheless.
Cheers,
~Regs.
Chris M
04-20-2002, 04:59 PM
Yeh...
I found the alterations seemed to make it less confusing...
Satan
Chris M
05-08-2002, 07:21 PM
After a Request by Boofo (a friend), I added the Read Messages to this...
I am not entirely sure if it works (Boofo is testing it now), but I think it should do the trick...
If you want the Version with my Mods, download the NEXT file, not this one...
Satan
Chris M
05-08-2002, 07:26 PM
This one has my modifications, and the new feature I added...
Satan
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.