]> git.mxchange.org Git - friendica.git/blobdiff - boot.php
Merge pull request #63 from tomtom84/master
[friendica.git] / boot.php
index 03f324749de6d258060092e5820b3c4898e5bdd7..b464d252590b7bd4ad7386977e2976580123a8f3 100755 (executable)
--- a/boot.php
+++ b/boot.php
@@ -9,9 +9,9 @@ require_once('include/nav.php');
 require_once('include/cache.php');
 
 define ( 'FRIENDICA_PLATFORM',     'Friendica');
-define ( 'FRIENDICA_VERSION',      '2.3.1236' );
+define ( 'FRIENDICA_VERSION',      '2.3.1269' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.22'    );
-define ( 'DB_UPDATE_VERSION',      1118      );
+define ( 'DB_UPDATE_VERSION',      1131      );
 
 define ( 'EOL',                    "<br />\r\n"     );
 define ( 'ATOM_TIME',              'Y-m-d\TH:i:s\Z' );
@@ -101,10 +101,12 @@ define ( 'NETWORK_OSTATUS',          'stat');    // status.net, identi.ca, GNU-s
 define ( 'NETWORK_FEED',             'feed');    // RSS/Atom feeds with no known "post/notify" protocol
 define ( 'NETWORK_DIASPORA',         'dspr');    // Diaspora
 define ( 'NETWORK_MAIL',             'mail');    // IMAP/POP
+define ( 'NETWORK_MAIL2',            'mai2');    // extended IMAP/POP
 define ( 'NETWORK_FACEBOOK',         'face');    // Facebook API     
 define ( 'NETWORK_LINKEDIN',         'lnkd');    // LinkedIn
 define ( 'NETWORK_XMPP',             'xmpp');    // XMPP     
 define ( 'NETWORK_MYSPACE',          'mysp');    // MySpace
+define ( 'NETWORK_GPLUS',            'goog');    // Google+
 
 /**
  * Maximum number of "people who like (or don't like) this"  that we will list by name
@@ -123,14 +125,15 @@ define ( 'ZCURL_TIMEOUT' , (-1));
  * email notification options
  */
 
-define ( 'NOTIFY_INTRO',   0x0001 );
-define ( 'NOTIFY_CONFIRM', 0x0002 );
-define ( 'NOTIFY_WALL',    0x0004 );
-define ( 'NOTIFY_COMMENT', 0x0008 );
-define ( 'NOTIFY_MAIL',    0x0010 );
-define ( 'NOTIFY_SUGGEST', 0x0020 );
-define ( 'NOTIFY_PROFILE', 0x0040 );
-
+define ( 'NOTIFY_INTRO',    0x0001 );
+define ( 'NOTIFY_CONFIRM',  0x0002 );
+define ( 'NOTIFY_WALL',     0x0004 );
+define ( 'NOTIFY_COMMENT',  0x0008 );
+define ( 'NOTIFY_MAIL',     0x0010 );
+define ( 'NOTIFY_SUGGEST',  0x0020 );
+define ( 'NOTIFY_PROFILE',  0x0040 );
+define ( 'NOTIFY_TAGSELF',  0x0080 );
+define ( 'NOTIFY_TAGSHARE', 0x0100 );
 
 /**
  * various namespaces we may need to parse
@@ -306,8 +309,12 @@ class App {
                        . 'library/phpsec' . PATH_SEPARATOR 
                        . '.' );
 
-               if((x($_SERVER,'QUERY_STRING')) && substr($_SERVER['QUERY_STRING'],0,2) === "q=")
+               if((x($_SERVER,'QUERY_STRING')) && substr($_SERVER['QUERY_STRING'],0,2) === "q=") {
                        $this->query_string = substr($_SERVER['QUERY_STRING'],2);
+                       // removing trailing / - maybe a nginx problem
+                       if (substr($this->query_string, 0, 1) == "/")
+                               $this->query_string = substr($this->query_string, 1);
+               }
                if(x($_GET,'q'))
                        $this->cmd = trim($_GET['q'],'/\\');
 
@@ -816,7 +823,7 @@ function profile_load(&$a, $nickname, $profile = 0) {
        } 
 
        $r = null;
-
+                          
        if($profile) {
                $profile_int = intval($profile);
                $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile` 
@@ -826,7 +833,7 @@ function profile_load(&$a, $nickname, $profile = 0) {
                        intval($profile_int)
                );
        }
-       if(! count($r)) {       
+       if((! $r) && (!  count($r))) {  
                $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile` 
                        left join `contact` on `contact`.`uid` = `profile`.`uid` LEFT JOIN `user` ON `profile`.`uid` = `user`.`uid`
                        WHERE `user`.`nickname` = '%s' AND `profile`.`is-default` = 1 and `contact`.`self` = 1 LIMIT 1",
@@ -839,6 +846,16 @@ function profile_load(&$a, $nickname, $profile = 0) {
                $a->error = 404;
                return;
        }
+       
+       // fetch user tags if this isn't the default profile
+
+       if(! $r[0]['is-default']) {
+               $x = q("select `pub_keywords` from `profile` where uid = %d and `is-default` = 1 limit 1",
+                       intval($profile_uid)
+               );
+               if($x && count($x))
+                       $r[0]['pub_keywords'] = $x[0]['pub_keywords'];
+       }
 
        $a->profile = $r[0];