Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Number of private messages on top of board (Read 8010 times)
Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 1759
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Re: Number of private messages on top of board
Reply #1 - Aug 28th, 2014 at 1:31pm
Print Post  
Okay.  Smiley
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Monni
Senior Member
****
Offline


Min izāmō

Posts: 413
Location: Kaarina, Finland
Joined: Jul 16th, 2014
Gender: Male
Number of private messages on top of board
Aug 28th, 2014 at 12:04pm
Print Post  
This makes the PM count display cleaner when all private messages are unread.

Code
Select All
Index: cgi-bin/yabb2/Languages/English/Main.lng
===================================================================
--- cgi-bin/yabb2/Languages/English/Main.lng	(revision 1555)
+++ cgi-bin/yabb2/Languages/English/Main.lng	(working copy)
@@ -161,7 +161,9 @@
 '152' => 'you have',
 '153' => 'messages',
 '154' => 'are new.',
+'154b' => 'new messages.',
 '155' => 'is new.',
+'155b' => 'new message.',
 'nonew' => 'and no new messages.',
 '231' => 'Gender',
 'female' => 'Female',
Index: cgi-bin/yabb2/Sources/Load.pm
===================================================================
--- cgi-bin/yabb2/Sources/Load.pm	(revision 1555)
+++ cgi-bin/yabb2/Sources/Load.pm	(working copy)
@@ -109,13 +109,21 @@
     }

     if ( ${$username}{'PMmnum'} == 1 ) {
-        $yyim =
+        if ( ${$username}{'PMimnewcount'} == 1 ) {
+          $yyim = qq~$load_txt{'152'} <a href="$scripturl?action=im">${$username}{'PMmnum'} $load_txt{'155b'}</a>~;
+        }
+        else {
+          $yyim =
 qq~$load_txt{'152'} <a href="$scripturl?action=im">${$username}{'PMmnum'} $load_txt{'471'}</a>, $imnewtext~;
+        }
     }
     elsif ( !${$username}{'PMmnum'} && !${$username}{'PMimnewcount'} ) {
         $yyim =
 qq~$load_txt{'152'} <a href="$scripturl?action=im">${$username}{'PMmnum'} $load_txt{'153'}</a>~;
     }
+    elsif ( ${$username}{'PMmnum'} == ${$username}{'PMimnewcount'} ) {
+        $yyim = qq~$load_txt{'152'} <a href="$scripturl?action=im">${$username}{'PMmnum'} $load_txt{'154b'}</a>~;
+    }
     else {
         $yyim =
 qq~$load_txt{'152'} <a href="$scripturl?action=im">${$username}{'PMmnum'} $load_txt{'153'}</a>, $imnewtext~;
 

  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint