]> git.mxchange.org Git - friendica.git/blobdiff - boot.php
Merge remote-tracking branch 'origin/master'
[friendica.git] / boot.php
index ac57d1e519626bbf6d59c94655b2365eaa9c1c8b..f12ec0d8d8d4091b6efa202e422ec057a613b3dc 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.932' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.1'  );
-define ( 'DB_UPDATE_VERSION',      1040   );
+define ( 'DB_UPDATE_VERSION',      1045   );
 
 define ( 'EOL',                    "<br />\r\n"     );
 define ( 'ATOM_TIME',              'Y-m-d\TH:i:s\Z' );
@@ -1068,6 +1068,7 @@ function paginate(&$a) {
        $stripped = preg_replace('/(&page=[0-9]*)/','',$a->query_string);
        $stripped = str_replace('q=','',$stripped);
        $stripped = trim($stripped,'/');
+       $pagenum = $a->pager['page'];
        $url = $a->get_baseurl() . '/' . $stripped;
 
 
@@ -1080,7 +1081,7 @@ function paginate(&$a) {
 
                $numpages = $a->pager['total'] / $a->pager['itemspage'];
 
-               $numstart = 1;
+                       $numstart = 1;
                $numstop = $numpages;
 
                if($numpages > 14) {
@@ -1603,9 +1604,15 @@ function lrdd($uri) {
 if(! function_exists('fetch_lrdd_template')) {
 function fetch_lrdd_template($host) {
        $tpl = '';
-       $url = 'http://' . $host . '/.well-known/host-meta' ;
-       $links = fetch_xrd_links($url);
-logger('template: ' . print_r($links,true));
+
+       $url1 = 'https://' . $host . '/.well-known/host-meta' ;
+       $url2 = 'http://' . $host . '/.well-known/host-meta' ;
+       $links = fetch_xrd_links($url1);
+       logger('template (https): ' . print_r($links,true));
+       if(! count($links)) {
+               $links = fetch_xrd_links($url2);
+               logger('template (http): ' . print_r($links,true));
+       }
        if(count($links)) {
                foreach($links as $link)
                        if($link['@attributes']['rel'] && $link['@attributes']['rel'] === 'lrdd')
@@ -1856,11 +1863,11 @@ function format_like($cnt,$arr,$type,$id) {
 
 if(! function_exists('load_view_file')) {
 function load_view_file($s) {
+       global $lang;
+       if(! isset($lang))
+               $lang = 'en';
        $b = basename($s);
        $d = dirname($s);
-       $lang = get_config('system','language');
-       if($lang === false)
-               $lang = 'en';
        if(file_exists("$d/$lang/$b"))
                return file_get_contents("$d/$lang/$b");
        return file_get_contents($s);
@@ -2013,7 +2020,7 @@ function contact_block() {
                        intval($shown)
        );
        if(count($r)) {
-               $o .= '<h4 class="contact-h4">' . $total . ' ' . t('Contacts') . '</h4><div id="contact-block">';
+               $o .= '<h4 class="contact-h4">' .  sprintf(tt('%d Contact','%d Contacts', $total),$total) . '</h4><div id="contact-block">';
                foreach($r as $rr) {
                        $redirect_url = $a->get_baseurl() . '/redir/' . $rr['id'];
                        if(local_user() && ($rr['uid'] == local_user())
@@ -2410,11 +2417,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); 
 
@@ -2424,7 +2439,7 @@ function get_birthdays() {
                        . '</div>' ;
                }
 
-               $o .= '</div>';
+               $o .= '</div></div>';
        }
 
   return $o;
@@ -2651,4 +2666,4 @@ function extract_item_authors($arr,$uid) {
                }
        }
        return array();         
-}}
\ No newline at end of file
+}}