]> git.mxchange.org Git - friendica.git/blobdiff - boot.php
Merge branch 'fabrixxm-master'
[friendica.git] / boot.php
index 19c6d887866412f21c2af77d71f136bc8f929ef3..aa40c17111a161571db4ecb88c8dd4e77b3261d9 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -2,9 +2,9 @@
 
 set_time_limit(0);
 
-define ( 'FRIENDIKA_VERSION',      '2.1.913' );
+define ( 'FRIENDIKA_VERSION',      '2.1.922' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.1'  );
-define ( 'DB_UPDATE_VERSION',      1040   );
+define ( 'DB_UPDATE_VERSION',      1043   );
 
 define ( 'EOL',                    "<br />\r\n"     );
 define ( 'ATOM_TIME',              'Y-m-d\TH:i:s\Z' );
@@ -1828,10 +1828,14 @@ if(! function_exists('format_like')) {
 function format_like($cnt,$arr,$type,$id) {
        $o = '';
        if($cnt == 1)
-               $o .= $arr[0] . (($type === 'like') ? t(' likes this.') : t(' doesn\'t like this.')) . EOL ;
+               $o .= (($type === 'like') ? sprintf( t('%s likes this.'), $arr[0]) : sprintf( t('%s doesn\'t like this.'), $arr[0])) . EOL ;
        else {
-               $o .= '<span class="fakelink" onclick="openClose(\'' . $type . 'list-' . $id . '\');" >' 
-                       . $cnt . ' ' . t('people') . '</span> ' . (($type === 'like') ? t('like this.') : t('don\'t like this.')) . EOL ;
+               $spanatts = 'class="fakelink" onclick="openClose(\'' . $type . 'list-' . $id . '\');"';
+               $o .= (($type === 'like') ? 
+                                       sprintf( t('<span  %1$s>%2$d people</span> like this.'), $spanatts, $cnt)
+                                        : 
+                                       sprintf( t('<span  %1$s>%2$d people</span> don\'t like this.'), $spanatts, $cnt) ); 
+               $o .= EOL ;
                $total = count($arr);
                if($total >= MAX_LIKERS)
                        $arr = array_slice($arr, 0, MAX_LIKERS - 1);
@@ -1839,8 +1843,8 @@ function format_like($cnt,$arr,$type,$id) {
                        $arr[count($arr)-1] = t('and') . ' ' . $arr[count($arr)-1];
                $str = implode(', ', $arr);
                if($total >= MAX_LIKERS)
-                       $str .= t(', and ') . $total - MAX_LIKERS . t(' other people');
-               $str .= (($type === 'like') ? t(' like this.') : t(' don\'t like this.'));
+                       $str .= sprintf( t(', and %d other people'), $total - MAX_LIKERS );
+               $str = (($type === 'like') ? sprintf( t('%s like this.'), $str) : sprintf( t('%s don\'t like this.'), $str));
                $o .= "\t" . '<div id="' . $type . 'list-' . $id . '" style="display: none;" >' . $str . '</div>';
        }
        return $o;
@@ -2406,11 +2410,19 @@ function get_birthdays() {
        );
 
        if($r && count($r)) {
-               $o .= '<div id="birthday-wrapper"><div id="birthday-title">' . t('Birthdays this week:') . '</div>'; 
+               $total = 0;
+               foreach($r as $rr)
+                       if(strlen($rr['name']))
+                               $total ++;
+
+               $o .= '<div id="birthday-notice" class="birthday-notice fakelink" onclick=openClose(\'birthday-wrapper\'); >' . t('Birthday Reminders') . ' ' . '(' . $total . ')' . '</div>'; 
+               $o .= '<div id="birthday-wrapper" style="display: none;" ><div id="birthday-title">' . t('Birthdays this week:') . '</div>'; 
                $o .= '<div id="birthday-adjust">' . t("\x28Adjusted for local time\x29") . '</div>';
                $o .= '<div id="birthday-title-end"></div>';
 
                foreach($r as $rr) {
+                       if(! strlen($rr['name']))
+                               continue;
                        $now = strtotime('now');
                        $today = (((strtotime($rr['start'] . ' +00:00') < $now) && (strtotime($rr['finish'] . ' +00:00') > $now)) ? true : false); 
 
@@ -2420,7 +2432,7 @@ function get_birthdays() {
                        . '</div>' ;
                }
 
-               $o .= '</div>';
+               $o .= '</div></div>';
        }
 
   return $o;