vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=34)
-   -   New pm alert (a replacement for pm popup) (https://vborg.vbsupport.ru/showthread.php?t=59890)

Brad 01-07-2004 10:00 PM

New pm alert (a replacement for pm popup)
 
This hack will change the way pm pop works on your forums. Frist of all it will no longer be a pop up, instead the info is placed in a new table under the navbar. Also the avatar of the member that sent you the pm is displayed.

This is dirty but it works, if everything checks out in this beta release I will update the template to use phrases and post a new thread in the full release forum

colicab-d 01-08-2004 09:28 AM

Great idea you have there, but it may cause a few probs for folk with things like vbindex etc installed :p

Brolly 01-08-2004 10:04 AM

Nice, installed ;)

Dean C 01-08-2004 11:56 AM

Nicely implemented :)

albibak 01-08-2004 03:15 PM

Nice, but I have a probleme.
When the subject has a ' exemple : I'm here

The result is : I\'m here

Have you got any answers ?

albibak 01-08-2004 03:24 PM

An other problem.
The avatar don't work if it's a link, exemple if my avatar is : www.test.com/avatar.jpg

I must upload my avatar. It must be on the database ;)

Brad 01-08-2004 03:34 PM

Quote:

Originally Posted by albibak
An other problem.
The avatar don't work if it's a link, exemple if my avatar is : www.test.com/avatar.jpg

I must upload my avatar. It must be on the database ;)

Thats why this is a beta hack, what url dose the image give when it dosent work (file customs and board avatars) thanks.

albibak 01-08-2004 03:43 PM

I know it's a beta hack, it's just for that I write my remarks ;)

what url dose the image give when it dosent work (file customs and board avatars) thanks. => I don't understand, sorry

Brad 01-08-2004 03:44 PM

Change:

PHP Code:

        $newpm['username'] = addslashes(unhtmlspecialchars($newpm['fromusername'], true));
        
$newpm['title'] = addslashes(unhtmlspecialchars($newpm['title'], true)); 

To:

PHP Code:

        $newpm['username'] = unhtmlspecialchars($newpm['fromusername'], true);
        
$newpm['title'] = unhtmlspecialchars($newpm['title'], true); 

That will fix the \' problems, looking at the avatars now :)

albibak 01-08-2004 03:58 PM

Little remark :

If you have the welcome panel installed, a modification will be do :

Find in the .txt installation file

PHP Code:

---------------------
Open templatenavbar
---------------------

At the very end of the template add:

<
br />
$newpm 

and replace by :

PHP Code:

---------------------
Open templateforumhome
---------------------

add below [$welcome_panel], :

<
br />
$newpm 


Brad 01-08-2004 04:05 PM

I have fixed the problems with avatars, if you have already installed this hack replace the block in global.php with this:

PHP Code:

// #############################################################################
// get new private message alert - hack
$newpmmsg 0;
$shownewpm false;
if (
$vboptions['checknewpm'] AND $bbuserinfo['userid'] AND $bbuserinfo['pmpopup'] == 2)
{
    
$DB_site->shutdown_query("UPDATE " TABLE_PREFIX "user SET pmpopup = 1 WHERE userid = $bbuserinfo[userid]"'pmpopup');
    if (
THIS_SCRIPT != 'private')
    {
        
$newpmmsg 1;
        
$newpm $DB_site->query_first("
            SELECT pmtext.title, fromusername, fromuserid
            FROM " 
TABLE_PREFIX "pmtext AS pmtext
            LEFT JOIN " 
TABLE_PREFIX "pm AS pm USING(pmtextid)
            WHERE pm.userid = 
$bbuserinfo[userid]
            ORDER BY pmtext.dateline DESC
            LIMIT 1
        "
);

        require_once(
'./includes/functions_user.php');
        
$pm_avaurl fetch_avatar_url($newpm['fromuserid']);

        if (empty(
$pm_avaurl))
        {
            
$showpm_ava false;
        }
        else
        {
            
$showpm_ava true;
        }
        
// end hack - new pm notifacation    
        
$newpm['username'] = unhtmlspecialchars($newpm['fromusername'], true);
        
$newpm['title'] = unhtmlspecialchars($newpm['title'], true);
        
$shownewpm true;
        
    }



Brad 01-08-2004 04:08 PM

Quote:

Originally Posted by albibak
Little remark :

If you have the welcome panel installed, a modification will be do :

Find in the .txt installation file

PHP Code:

---------------------
Open templatenavbar
---------------------

At the very end of the template add:

<
br />
$newpm 

and replace by :

PHP Code:

---------------------
Open templateforumhome
---------------------

add below [$welcome_panel], :

<
br />
$newpm 


That template modification can cause some un-desired effects because this is ment to function on the global scale, to make it only show on index.php replace:

PHP Code:

if (THIS_SCRIPT != 'private'

With:

PHP Code:

if (THIS_SCRIPT != 'private' AND THIS_SCRIPT == 'index'


albibak 01-08-2004 04:18 PM

Only for people who has the welcome panel allright ?

albibak 01-08-2004 04:21 PM

Problems with ' and avatars are solved.
Thx

Brad 01-08-2004 04:22 PM

Quote:

Originally Posted by albibak
Only for people who has the welcome panel allright ?

Yes. Or any other modification to this hack that removes it from a global template.

albibak 01-08-2004 04:26 PM

I'm glad to contribute to improve this hack, because I think it's a good hack :)

albibak 01-08-2004 04:57 PM

A little suggestion :

I think it's a good idea to let the alert for a new mp if a member don't read his mp directly, now ?

Brad 01-08-2004 05:03 PM

Quote:

Originally Posted by albibak
A little suggestion :

I think it's a good idea to let the alert for a new mp if a member don't read his mp directly, now ?

Im sorry but I cant understand your english :(

albibak 01-08-2004 05:11 PM

Sorry, for my bad english.

example (you had installed this hack here):

Imagine you go to vbulletin.org and you have a new mp. The box appear, but you don't read your pm now.
1 hours after you go to vbulletin.org, and now, the box don't appear.

I think it's more cool to let the box if you have don't read your pm, no ?

gmarik 01-08-2004 05:31 PM

Not bad. Can you add any dynamic element to it (gif or mid) so I really get noticed about the new msg?

apokphp 01-08-2004 11:36 PM

Does this work for rc2? Doesn't seem to for some reason.

Brad 01-09-2004 12:24 AM

Yes, this was made for and works with RC 2

apokphp 01-09-2004 12:39 AM

I'm only testing it by sending pm's to myself. Does it read self-sent pm's?

Brad 01-09-2004 12:44 AM

Quote:

Originally Posted by apokphp
I'm only testing it by sending pm's to myself. Does it read self-sent pm's?

Log into a test acount or have someone send you a pm, I had to get someone to send me about 20 test pm's to get this working :)

apokphp 01-09-2004 12:58 AM

It worked. 3 requests/ideas though.

1) If someone hasn't selected an avatar, no graphic displays, perhaps there is a way to use a default graphic instead of nothing? This way brings attention to the pm.

2) Anyway to keep the notice there until the pm is read? If you leave the forum and come back, or if you refresh, or if you move around in the forum, the notice disappears, and you missed the pm notice.

3) What about adding a blinker to it? Or a blinking or highlighted text to alert the member a pm is waiting?

Brad 01-09-2004 01:18 AM

Quote:

Originally Posted by apokphp
It worked. 3 requests/ideas though.

1) If someone hasn't selected an avatar, no graphic displays, perhaps there is a way to use a default graphic instead of nothing? This way brings attention to the pm.

2) Anyway to keep the notice there until the pm is read? If you leave the forum and come back, or if you refresh, or if you move around in the forum, the notice disappears, and you missed the pm notice.

3) What about adding a blinker to it? Or a blinking or highlighted text to alert the member a pm is waiting?

1: Change:

PHP Code:

        if (empty($pm_avaurl))
        {
            
$showpm_ava false;
        }
        else
        {
            
$showpm_ava true;
        } 

To:

PHP Code:

        if (empty($pm_avaurl))
        {
            
$pm_avaurl 'path/to/default/avatar.gif';
            
$showpm_ava true;
        }
        else
        {
            
$showpm_ava true;
        } 

2: *code removed* will cause un-disired results, I will update the hack with a better version of this soon :)

3: you can do so by editing to pm_new_globals to your liking, I made this because I dis-liked the blink, but there is no reason why you can-not add it :)

Brad 01-09-2004 01:38 AM

Ok, if you want the pm alert to stay on top until the pm is viewed do this.

In global.php find:

PHP Code:

$DB_site->shutdown_query("UPDATE " TABLE_PREFIX "user SET pmpopup = 1 WHERE userid = $bbuserinfo[userid]"'pmpopup'); 

Remove it.

In the pm_new_globals template replace:

Code:

<a href="private.php?$session[sessionurl]">Click here to enter your private message area</a>
Replace with:

Code:

<a href="pmgateway.php?$session[sessionurl]">Click here to enter your private message area</a>
And upload the attached php file to your /forum directory :)

apokphp 01-09-2004 04:56 AM

Yes, that worked great! Thanks. :)

And if you don't mind (hehe), if I wanted to, what about just having a default image for ALL notices of a pm? Instead of having it be the sender's avatar...what would it be if I wanted a graphic to display in its place, for all members who get a pm. Not sure if I would do this, but it seems like it may come in handy.

Brad 01-09-2004 05:08 AM

Remove:

PHP Code:

        require_once('./includes/functions_user.php');
        
$pm_avaurl fetch_avatar_url($newpm['fromuserid']);

        if (empty(
$pm_avaurl))
        {
            
$showpm_ava false;
        }
        else
        {
            
$showpm_ava true;
        } 

Then in the template find:

PHP Code:

$pm_avaurl 

And replace it with the image you want to show, also find:

Code:

<if condition="$showpm_ava">
        <td class="alt1" width="100%">
                        <div class="smallfont"><img src="$pm_avaurl" alt="$newpm[username]'s avatar" border="0" /></div>
                </td>        </if>

Replace with:

Code:

<td class="alt1" width="100%">
                        <div class="smallfont"><img src="$pm_avaurl" alt="$newpm[username]'s avatar" border="0" /></div>
                </td>


apokphp 01-09-2004 05:33 AM

very nice, thanks. As I expected, it was a little more than I had thought. :) I needed the help.

albibak 01-09-2004 09:54 AM

Thx brad for all answers you give to me ;)

MrNase 01-11-2004 01:45 PM

nice hack, but i'll wait for the final :)

]|fre$h-LoRd|[ 09-04-2004 07:45 PM

The hack is great and after I have installed it, it works very fine. THX

Viruseater 09-11-2004 04:37 AM

Hmmm

I'm having problems.

It doesn't work at all for me.

It shut down my pm popup of course (because i replaced the code) but now nothing shows up.

It added a break after the navbar (as directed).

but now I get no notice of any kind. So i'm much worse off now. yuck.

Viruseater 09-12-2004 05:53 AM

Correction.

User error. It's working great now.

easily one of my favorite hacks. Kudos

Polo 02-09-2005 11:00 PM

mmmm.. i feel like giving it a try :)


All times are GMT. The time now is 11:32 AM.

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.01415 seconds
  • Memory Usage 1,852KB
  • 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
  • (4)bbcode_code_printable
  • (14)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (36)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete