X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=boot.php;h=b06c2d0bf411d6f2dd6f6763138d52b12c991052;hb=bbebb4c2a050f22e9aa51cb123359b169bcb3b3c;hp=13546d6bb0a6e43c001084d4f059f3bfdeae72fe;hpb=c8d5274ceea95bdf9df5ca2ab698fa9860319e31;p=friendica.git diff --git a/boot.php b/boot.php old mode 100644 new mode 100755 index 13546d6bb0..aee236de33 --- a/boot.php +++ b/boot.php @@ -4,14 +4,14 @@ require_once('include/config.php'); require_once('include/network.php'); require_once('include/plugin.php'); require_once('include/text.php'); -require_once("include/pgettext.php"); +require_once('include/pgettext.php'); require_once('include/nav.php'); require_once('include/cache.php'); define ( 'FRIENDICA_PLATFORM', 'Friendica'); -define ( 'FRIENDICA_VERSION', '2.3.1185' ); +define ( 'FRIENDICA_VERSION', '2.3.1267' ); define ( 'DFRN_PROTOCOL_VERSION', '2.22' ); -define ( 'DB_UPDATE_VERSION', 1109 ); +define ( 'DB_UPDATE_VERSION', 1130 ); define ( 'EOL', "
\r\n" ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); @@ -21,8 +21,9 @@ define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); * * Image storage quality. Lower numbers save space at cost of image detail. * For ease of upgrade, please do not change here. Change jpeg quality with - * set_config('system','jpeg_quality',n) in .htconfig.php - * where n is netween 1 and 100, and with very poor results below about 50 + * $a->config['system']['jpeg_quality'] = n; + * in .htconfig.php, where n is netween 1 and 100, and with very poor results + * below about 50 * */ @@ -88,6 +89,7 @@ define ( 'PAGE_NORMAL', 0 ); define ( 'PAGE_SOAPBOX', 1 ); define ( 'PAGE_COMMUNITY', 2 ); define ( 'PAGE_FREELOVE', 3 ); +define ( 'PAGE_BLOG', 4 ); /** * Network and protocol family types @@ -99,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 @@ -121,11 +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_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 @@ -162,6 +170,7 @@ define ( 'ACTIVITY_UNFOLLOW', NAMESPACE_ACTIVITY_SCHEMA . 'stop-following' ); define ( 'ACTIVITY_POST', NAMESPACE_ACTIVITY_SCHEMA . 'post' ); define ( 'ACTIVITY_UPDATE', NAMESPACE_ACTIVITY_SCHEMA . 'update' ); define ( 'ACTIVITY_TAG', NAMESPACE_ACTIVITY_SCHEMA . 'tag' ); +define ( 'ACTIVITY_FAVORITE', NAMESPACE_ACTIVITY_SCHEMA . 'favorite' ); define ( 'ACTIVITY_OBJ_COMMENT', NAMESPACE_ACTIVITY_SCHEMA . 'comment' ); define ( 'ACTIVITY_OBJ_NOTE', NAMESPACE_ACTIVITY_SCHEMA . 'note' ); @@ -300,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'],'/\\'); @@ -310,6 +323,11 @@ class App { if(substr($this->cmd,0,1) === '~') $this->cmd = 'profile/' . substr($this->cmd,1); + // Diaspora style profile url + + if(substr($this->cmd,0,2) === 'u/') + $this->cmd = 'profile/' . substr($this->cmd,2); + /** * * Break the URL path into C style argc/argv style arguments for our @@ -416,6 +434,10 @@ class App { } function init_pagehead() { + $interval = ((local_user()) ? get_pconfig(local_user(),'system','update_interval') : 40000); + if($interval < 10000) + $interval = 40000; + $this->page['title'] = $this->config['sitename']; $tpl = file_get_contents('view/head.tpl'); $this->page['htmlhead'] = replace_macros($tpl,array( @@ -424,7 +446,8 @@ class App { '$delitem' => t('Delete this item?'), '$comment' => t('Comment'), '$showmore' => t('show more'), - '$showfewer' => t('show fewer') + '$showfewer' => t('show fewer'), + '$update_interval' => $interval )); } @@ -690,7 +713,7 @@ function login($register = false, $hiddens=false) { '$lpassword' => array('password', t('Password: '), '', ''), '$openid' => !$noid, - '$lopenid' => array('openid_url', t('OpenID: '),'',''), + '$lopenid' => array('openid_url', t('Or login using OpenID: '),'',''), '$hiddens' => $hiddens, @@ -800,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` @@ -810,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", @@ -819,10 +842,20 @@ function profile_load(&$a, $nickname, $profile = 0) { } if(($r === false) || (! count($r))) { - notice( t('No profile') . EOL ); + notice( t('Requested profile is not available.') . EOL ); $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]; @@ -954,7 +987,7 @@ function profile_sidebar($profile, $block = 0) { $homepage = ((x($profile,'homepage') == 1) ? t('Homepage:') : False); if(($profile['hidewall'] || $block) && (! local_user()) && (! remote_user())) { - $location = $pdesc = $connect = $gender = $marital = $homepage = False; + $location = $pdesc = $gender = $marital = $homepage = False; } $firstname = ((strpos($profile['name'],' ')) @@ -1025,6 +1058,8 @@ function get_birthdays() { if($r && count($r)) { $total = 0; $now = strtotime('now'); + $cids = array(); + $istoday = false; foreach($r as $rr) { if(strlen($rr['name'])) @@ -1041,6 +1076,13 @@ function get_birthdays() { foreach($r as $rr) { if(! strlen($rr['name'])) continue; + + // avoid duplicates + + if(in_array($rr['cid'],$cids)) + continue; + $cids[] = $rr['cid']; + $today = (((strtotime($rr['start'] . ' +00:00') < $now) && (strtotime($rr['finish'] . ' +00:00') > $now)) ? true : false); $sparkle = ''; $url = $rr['url'];