vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Blink PM icon with userinfo (https://vborg.vbsupport.ru/showthread.php?t=75619)

Sebastian 02-01-2005 10:00 PM

Blink PM icon with userinfo
 
Blink PM icon with userinfo

---------------------
Installation

- easy
- queries 0/1 (details below)
- file edits 1
- template edits 1

Reason for this hack:
I find the PM system lacked some additional information on the navbar the 0 X Unread, Total X isn't enough, as i wanted to know who sent the PM and how many they sent.

How it works:
When you get a PM the "Private Messages: x Unread, Total x." disappears and is replaced with a little blinking icon, if the user that sent the PM is a mod the icon will blink a teal color, if its a normal user, it will blink yellow. along with this you can view who sent the message, and if multiple people sent you PMs it will show their names.. If they sent you more than one, it will tell you that too. It will also take you directly to the PM without having to go to your inbox first.. After you've read all your PMs (or you dont have any) the "Private Messages: x Unread, Total x." returns to normal.

Queries: i know a lot of people are worried when it comes to adding hacks (especially me) because of additional queries.. this hack is sort of different. It only executes 1 query IF the user has unread PMs.. if they have no new PMs then 0 queries.

I've included two blinking gifs, you can use your own, put them in your images misc directory.

Read the txt file for installtion which takes 30 seconds.
I plan to expand this addons, but depends how many find it usefull, so click install plz.

yoyoyoyo 02-02-2005 07:25 PM

very cool!

edit- installed in about 30 seconds and it works as advertised!

Quad139 02-02-2005 07:28 PM

Cool

nexialys 02-02-2005 08:07 PM

[high]* nexialys looks further to receive these pm.. ;)[/high]

Harley77 02-02-2005 08:16 PM

Very cool, *clicks install*.

One question though, How would you get this to work on a portal page like vBAdvanced? The PM section dissapears as I goto the front page.

yoyoyoyo 02-02-2005 08:27 PM

wowzers.. now with the 1) audible PM message hack, and 2) this hack, and 3) the blinking "PRIVATE MESSAGE" message like they have here... my PM system is like the 4th of july when I get a PM :)

Phalynx 02-02-2005 08:46 PM

Works great, thanks!

OrangeFlea 02-02-2005 09:16 PM

I'm still using 3.0.3. Will I have to make any modifications?

nexialys 02-02-2005 09:18 PM

it's a 3.0+ hack, everything work the same for all versions...

Polo 02-02-2005 09:26 PM

nice :) thanks for sharing

Floris 02-02-2005 11:19 PM

You can do this using template conditionals, no need to hack code.

Sebastian 02-02-2005 11:30 PM

Quote:

Originally Posted by floris
You can do this using template conditionals, no need to hack code.

then do it, i'd like to see you accomplish this.
sure you can use a conditional to blink an image, but there is no way you are going to be able to get the users, the ids to the PM, the unique PM count, etc..

Kahoona 02-03-2005 12:07 AM

I get this SQL Error:

Database error in vBulletin 3.0.3:

Invalid SQL:
SELECT pmtext.pmtextid, pmtext.fromusername, pmtext.fromuserid, pmtext.dateline, pm.pmid, user.userid, user.usergroupid,
COUNT(pmtext.fromuserid) AS fromusertotal FROM pmtext AS pmtext
LEFT JOIN pm AS pm USING(pmtextid)
LEFT JOIN user ON (user.userid=pmtext.fromuserid)
WHERE pm.userid=1 AND messageread=0
GROUP BY pmtext.fromusername ORDER BY user.usergroupid ASC

mysql error: Table 'andy.pmtext' doesn't exist

mysql error number: 1146

Sebastian 02-03-2005 12:50 AM

@ Kahoona: redownload the zip. i forgot to add TABLE_PREFIX to the query.

kall 02-03-2005 12:51 AM

Quote:

Originally Posted by Kahoona
I get this SQL Error:

Database error in vBulletin 3.0.3:

Invalid SQL:
SELECT pmtext.pmtextid, pmtext.fromusername, pmtext.fromuserid, pmtext.dateline, pm.pmid, user.userid, user.usergroupid,
COUNT(pmtext.fromuserid) AS fromusertotal FROM pmtext AS pmtext
LEFT JOIN pm AS pm USING(pmtextid)
LEFT JOIN user ON (user.userid=pmtext.fromuserid)
WHERE pm.userid=1 AND messageread=0
GROUP BY pmtext.fromusername ORDER BY user.usergroupid ASC

mysql error: Table 'andy.pmtext' doesn't exist

mysql error number: 1146

And the attachment won't download!

Kahoona 02-03-2005 01:24 AM

It still does not work lol.

yoyoyoyo 02-03-2005 01:40 AM

Quote:

Originally Posted by Sebastian
@ Kahoona: redownload the zip. i forgot to add TABLE_PREFIX to the query.

Huh? It installed earlier for me fine and works great. Should I re-edit the hack with the newly updated code?

Sebastian 02-03-2005 02:03 AM

Quote:

Originally Posted by yoyoyoyo
Huh? It installed earlier for me fine and works great. Should I re-edit the hack with the newly updated code?

no you dont have to.
all i did was change:

FROM pmtext

to:

FROM " . TABLE_PREFIX . "pmtext

TABLE_PREFIX is only needed if you add a prefix on your tables when you installed vb, otherwise its not needed.

Kahoona, do your tables have a prefix or not?

yinyang 02-03-2005 06:30 AM

most excellent.

installed in 1 minute and works like a charm.

MrNase 02-03-2005 01:22 PM

Quote:

Originally Posted by yinyang
most excellent.

installed in 1 minute and works like a charm.

Same for me, thank you for that hack :)

Kahoona 02-03-2005 01:49 PM

Quote:

Originally Posted by Sebastian
no you dont have to.
all i did was change:

FROM pmtext

to:

FROM " . TABLE_PREFIX . "pmtext

TABLE_PREFIX is only needed if you add a prefix on your tables when you installed vb, otherwise its not needed.

Kahoona, do your tables have a prefix or not?

Yes I do have a prefix.

Mellow 02-03-2005 02:31 PM

I installed it and it worked on all my pages but not on my vbadvanded cmps portal page. I have a global.php require in my index.php, both my root and my forums but if there are any PMs that line disappears.... No PMs and it looks normal.. again, only on the portal page.... any thoughts?

Socomjunky.com 02-03-2005 05:08 PM

i tired to install it and i got the same database error i had to un-install it

bobjackson 02-03-2005 11:58 PM

Quote:

Originally Posted by Socomjunky.com
i tired to install it and i got the same database error i had to un-install it

there are a couple of missing TABLE_PREFIX's...

the sql script needed an additional two prefix's (in bold below):

Code:

$getmessages = $DB_site->query("
                SELECT pmtext.pmtextid, pmtext.fromusername, pmtext.fromuserid, pmtext.dateline, pm.pmid, user.userid, user.usergroupid,
                        COUNT(pmtext.fromuserid) AS fromusertotal FROM " . TABLE_PREFIX . "pmtext AS pmtext
                        LEFT JOIN " . TABLE_PREFIX . "pm AS pm USING(pmtextid)
                        LEFT JOIN " . TABLE_PREFIX . "user AS user ON (user.userid=pmtext.fromuserid)
                        WHERE pm.userid=$bbuserinfo[userid] AND messageread=0
                        GROUP BY pmtext.fromusername ORDER BY user.usergroupid ASC
        ");


Sebastian 02-04-2005 03:26 AM

doh, i forgot about the left joins.. i updated the zip,.. those that got the sql error and have table prefix on vb are the only ones that should get the updated version.

thanx.

yinyang 02-04-2005 08:29 PM

is there a way to make it show up also on the VBACmps (vb advanced) page?

Sebastian 02-04-2005 09:42 PM

what attachment are you talking about? the hack file?

boo.3 02-04-2005 10:28 PM

/me clicks install

JMH11788 02-08-2005 12:23 AM

Just installed it...Thanks!

DRJ 02-08-2005 02:59 AM

I get this error. Any idea on what the problem is?

Database error in vBulletin 3.0.6:

Invalid SQL:
SELECTpmtext.pmtextid, pmtext.fromusername, pmtext.fromuserid,pmtext.dateline, pm.pmid, user.userid, user.usergroupid,
COUNT(pmtext.fromuserid) AS fromusertotal FROMvb3_pmtext AS pmtext
LEFT JOIN vb3_pm AS pm USING(pmtextid)
LEFT JOIN vb3_user ON(user.userid=pmtext.fromuserid)
WHERE pm.userid=135 AND messageread=0
GROUP BY pmtext.fromusername ORDER BYuser.usergroupid ASC

mysql error: Unknown table 'user' in field list

mysql error number: 1109

Allan 02-08-2005 04:06 PM

Very nice :)

Rhoads 02-08-2005 08:34 PM

My users always login on the portal, my question is ?, how can I use this with the vbadvanded portal.

Kihon Kata 02-09-2005 02:19 AM

Can I get someone to help me with my code? I think mycode is modded already and this is why I'm not sure where to put thishacked code. THanks in advance!

My PM area code:
Code:

<if condition="$bbuserinfo['userid']">
       
                <td class="alt2" valign="top" nowrap="nowrap">
                <div class="smallfont">
                        <!--$vbphrase[log_out]]-->               
                        <strong>$vbphrase[welcome_x]

                <phrase1="$pmbox[lastvisitdate]"2="$pmbox[lastvisittime]">$vbphrase[last_visited_x_at_y]
                        <if condition="$show['pmstats']">
$vbphrase[private_messages]: $vbphrase[unread_nav] $bbuserinfo[pmunread]$bbuserinfo[pmunread], $vbphrase[total] $bbuserinfo[pmtotal].


Cheertobi 02-09-2005 10:40 AM

Quote:

Originally Posted by DRJ
I get this error. Any idea on what the problem is?

Database error in vBulletin 3.0.6:

Invalid SQL:
SELECTpmtext.pmtextid, pmtext.fromusername, pmtext.fromuserid,pmtext.dateline, pm.pmid, user.userid, user.usergroupid,
COUNT(pmtext.fromuserid) AS fromusertotal FROMvb3_pmtext AS pmtext
LEFT JOIN vb3_pm AS pm USING(pmtextid)
LEFT JOIN vb3_user ON(user.userid=pmtext.fromuserid)
WHERE pm.userid=135 AND messageread=0
GROUP BY pmtext.fromusername ORDER BYuser.usergroupid ASC

mysql error: Unknown table 'user' in field list

mysql error number: 1109

Yap, same error here ;(

Tobi

Cheertobi 02-09-2005 10:52 AM

Hi,

got it work with this query:

Code:

                        SELECT pmtext.pmtextid, pmtext.fromusername, pmtext.fromuserid, pmtext.dateline, pm.pmid, " . TABLE_PREFIX . "user.userid, " . TABLE_PREFIX . "user.usergroupid,
                                COUNT(pmtext.fromuserid) AS fromusertotal FROM " . TABLE_PREFIX . "pmtext AS pmtext
                                LEFT JOIN " . TABLE_PREFIX . "pm AS pm USING(pmtextid)
                                LEFT JOIN " . TABLE_PREFIX . "user ON (" . TABLE_PREFIX . "user.userid=pmtext.fromuserid)
                                WHERE pm.userid=$bbuserinfo[userid] AND messageread=0
                                GROUP BY pmtext.fromusername ORDER BY " . TABLE_PREFIX . "_user.usergroupid ASC

How got I the "2 Minutes ago" thing working? I just got "New PM from xyz, Today!".

Regards,

Tobi

JMH11788 02-11-2005 11:06 PM

Quote:

Originally Posted by drl2005
My users always login on the portal, my question is ?, how can I use this with the vbadvanded portal.

I need the same question answered... :ermm: ...

T3MEDIA 02-11-2005 11:31 PM

agreed. I have a site that uses vbindex.
I assume you plop the code in vbindex and mod the vbindex templates?
just need a confirm

T3MEDIA 02-12-2005 12:50 AM

Quote:

Originally Posted by Allan
Very nice :)

Problem. I have a few girls on a form and one girl had 30 PM's this spread across her screen. I assumed it would show like maybe 1 or 2 max.

Is there a way to show 1 to 3 users max and have the flashing note icon clickable to the normal private.php file?

I am going out to a club so I guess you guys can huck that up...
thanks.

gothicuser 02-12-2005 03:13 AM

Many thanks, works nicely.
One slight hiccup though, when there is no PM for the member all displays normally in vBAdvanced portal, but when there IS a PM that whole section disappears from the nav panel (but as I say works perfectly in the forums.)
Nothing to worry about, i'll figure it all out when my brain returns from it's winter holidays!!

uae 02-13-2005 03:24 AM

Nice, clicked installed :)


All times are GMT. The time now is 04:47 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.01247 seconds
  • Memory Usage 1,826KB
  • 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
  • (3)bbcode_code_printable
  • (10)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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