vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Small hack: New, unread, and total messages in PM folders (https://vborg.vbsupport.ru/showthread.php?t=29681)

fury 10-05-2001 10:00 PM

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

Regs 04-20-2002 07:55 AM

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:

PHP Code:

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

<b>|</b>
Before and after each one, so that it seperates them better...

@Regs - You made a mistake in your php...It should be :

PHP Code:

$sentpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND folderid=-1 $ignoreusers"); 

Not :

Quote:

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

PHP Code:

<font color="#FF972F"

Make sure you add this to the end of the group of text though :

PHP Code:

</font

Mine looks like this :

PHP Code:

<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]</bTotal 
Messages 
<b>|</b></smallfont> <smallfont><b>$sentpm[messages]</bSent 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

Regs 04-20-2002 03:21 PM

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


All times are GMT. The time now is 12: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.02938 seconds
  • Memory Usage 1,754KB
  • 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
  • (5)bbcode_php_printable
  • (2)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
  • (10)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