Current time: 05-21-2013, 10:37 PM Hello There, Guest! (LoginRegister)


 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[F] Notification about new PM from MyBB Engine [R] [C-StefanT]
05-03-2009, 05:21 PM
Post: #1
[F] Notification about new PM from MyBB Engine [R] [C-StefanT]
If you got a PM from "MyBB Engine" the name links to member.php?action=profile&uid= in the new PM banner.

Greets,
Michael
-------------
[Image: donation_drive_sig.png]
Visit this user's website Find all posts by this user
05-06-2009, 05:48 AM
Post: #2
RE: Notification about new PM from MyBB Engine
I can Reproduce. It shouldn't be clickable at all, or at least to the uid of 1.

Items: CSS3 Menu/Navigation - PHP Pagination
Find all posts by this user
05-06-2009, 08:00 AM
Post: #3
RE: Notification about new PM from MyBB Engine [R]
(05-06-2009 05:48 AM)Imad Jomaa Wrote:  I can Reproduce. It shouldn't be clickable at all, or at least to the uid of 1.

What if there is no '1' uid? Not sure whether this is the "best" way; the main problem I see is that the link (<a href=) is in the actual language file, therefore no matter what we do it's almost impossible to fix without linking it to an Admin's profile or moving the link variables. I think this is the best way; Feel free to give it a jiggle - it removes the link if the username is "MyBB Engine"...

In global.php, find:

PHP Code:
    if($pm['fromuid'] == 0)
    {
        
$pm['fromusername'] = 'MyBB Engine';
    }
    
    if(
$mybb->user['pms_unread'] == 1)
    {
        
$privatemessage_text $lang->sprintf($lang->newpm_notice_oneget_profile_link($pm['fromuid']), htmlspecialchars_uni($pm['fromusername']), $pm['pmid'], htmlspecialchars_uni($pm['subject']));
    }
    else
    {
        
$privatemessage_text $lang->sprintf($lang->newpm_notice_multiple$mybb->user['pms_unread'], get_profile_link($pm['fromuid']), htmlspecialchars_uni($pm['fromusername']), $pm['pmid'], htmlspecialchars_uni($pm['subject']));
    } 

...and replace it with:

PHP Code:
    if($pm['fromuid'] == 0)
    {
        
$pm['fromusername'] = 'MyBB Engine';
        
$user_text $pm['fromusername'];
    }
    else
    {
        
$user_text "<a href=\"".get_profile_link($pm['fromuid'])."\">".htmlspecialchars_uni($pm['fromusername'])."</a>";
    }
    
    if(
$mybb->user['pms_unread'] == 1)
    {
        
$privatemessage_text $lang->sprintf($lang->newpm_notice_one$user_text$pm['pmid'], htmlspecialchars_uni($pm['subject']));
    }
    else
    {
        
$privatemessage_text $lang->sprintf($lang->newpm_notice_multiple$mybb->user['pms_unread'], $user_text$pm['pmid'], htmlspecialchars_uni($pm['subject']));
    } 

In global.lang.php, find:

PHP Code:
$l['newpm_notice_one'] = "<strong>You have one unread private message</strong> from <a href=\"{1}\">{2}</a> titled <a href=\"private.php?action=read&amp;pmid={3}\" style=\"font-weight: bold;\">{4}</a>";
$l['newpm_notice_multiple'] = "<strong>You have {1} unread private messages.</strong> The most recent is from <a href=\"{2}\">{3}</a> titled <a href=\"private.php?action=read&amp;pmid={4}\" style=\"font-weight: bold;\">{5}</a>"

...and replace with:

PHP Code:
$l['newpm_notice_one'] = "<strong>You have one unread private message</strong> from {1} titled <a href=\"private.php?action=read&amp;pmid={2}\" style=\"font-weight: bold;\">{3}</a>";
$l['newpm_notice_multiple'] = "<strong>You have {1} unread private messages.</strong> The most recent is from {2} titled <a href=\"private.php?action=read&amp;pmid={3}\" style=\"font-weight: bold;\">{4}</a>"
Find all posts by this user
05-07-2009, 04:44 PM
Post: #4
RE: Notification about new PM from MyBB Engine [R]
I agree with Tom M's changes but I think you can use

PHP Code:
$user_text build_profile_link($pm['fromusername'], $pm['fromuid']); 

instead of

PHP Code:
$user_text "<a href=\"".get_profile_link($pm['fromuid'])."\">".htmlspecialchars_uni($pm['fromusername'])."</a>"
Visit this user's website Find all posts by this user
05-08-2009, 09:32 AM
Post: #5
[F] Notification about new PM from MyBB Engine [R]
Thank you for your bug report.

This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.

With regards,
MyBB Group
Find all posts by this user
06-15-2009, 07:34 PM
Post: #6
RE: Notification about new PM from MyBB Engine [R]
(05-07-2009 04:44 PM)Ryan Gordon Wrote:  I agree with Tom M's changes but I think you can use

PHP Code:
$user_text build_profile_link($pm['fromusername'], $pm['fromuid']); 

instead of

PHP Code:
$user_text "<a href=\"".get_profile_link($pm['fromuid'])."\">".htmlspecialchars_uni($pm['fromusername'])."</a>"

Thanks, that is the point...

Downloadic - Human Health
Find all posts by this user


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact Us | MyBB | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication