X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=boot.php;h=bcc858fa18457c78a5d2bb33439148fc9493bf44;hb=aca8c8a13a8c3a850cad26efbc1e262b99c7b8a3;hp=b7aff697d4eb85c588e3d09ba272001b8f5a32fa;hpb=99a548d4ac195b08fd3928a95d560a6242e28142;p=friendica.git diff --git a/boot.php b/boot.php index b7aff697d4..bcc858fa18 100644 --- a/boot.php +++ b/boot.php @@ -8,10 +8,10 @@ require_once("include/pgettext.php"); require_once('include/nav.php'); require_once('include/cache.php'); -define ( 'FRIENDIKA_PLATFORM', 'Friendica'); -define ( 'FRIENDIKA_VERSION', '2.3.1158' ); +define ( 'FRIENDICA_PLATFORM', 'Friendica'); +define ( 'FRIENDICA_VERSION', '2.3.1208' ); define ( 'DFRN_PROTOCOL_VERSION', '2.22' ); -define ( 'DB_UPDATE_VERSION', 1102 ); +define ( 'DB_UPDATE_VERSION', 1112 ); 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 * */ @@ -100,6 +101,8 @@ define ( 'NETWORK_FEED', 'feed'); // RSS/Atom feeds with no known define ( 'NETWORK_DIASPORA', 'dspr'); // Diaspora define ( 'NETWORK_MAIL', 'mail'); // IMAP/POP define ( 'NETWORK_FACEBOOK', 'face'); // Facebook API +define ( 'NETWORK_LINKEDIN', 'lnkd'); // LinkedIn +define ( 'NETWORK_XMPP', 'xmpp'); // XMPP /** @@ -254,6 +257,8 @@ class App { public $plugins; public $apps = array(); public $identities; + + public $nav_sel; private $scheme; private $hostname; @@ -301,7 +306,15 @@ class App { if(x($_GET,'q')) $this->cmd = trim($_GET['q'],'/\\'); + // unix style "homedir" + + 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); /** * @@ -409,13 +422,20 @@ 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( '$baseurl' => $this->get_baseurl(), // FIXME for z_path!!!! - '$generator' => 'Friendika' . ' ' . FRIENDIKA_VERSION, + '$generator' => 'Friendica' . ' ' . FRIENDICA_VERSION, '$delitem' => t('Delete this item?'), - '$comment' => t('Comment') + '$comment' => t('Comment'), + '$showmore' => t('show more'), + '$showfewer' => t('show fewer'), + '$update_interval' => $interval )); } @@ -652,7 +672,7 @@ function get_guid($size=16) { // returns the complete html for inserting into the page if(! function_exists('login')) { -function login($register = false) { +function login($register = false, $hiddens=false) { $o = ""; $reg = false; if ($register) { @@ -681,8 +701,9 @@ function login($register = 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, '$register' => $reg, @@ -793,23 +814,23 @@ function profile_load(&$a, $nickname, $profile = 0) { if($profile) { $profile_int = intval($profile); - $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `user`.* FROM `profile` - LEFT JOIN `user` ON `profile`.`uid` = `user`.`uid` - WHERE `user`.`nickname` = '%s' AND `profile`.`id` = %d LIMIT 1", + $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`.`id` = %d and `contact`.`self` = 1 LIMIT 1", dbesc($nickname), intval($profile_int) ); } if(! count($r)) { - $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `user`.* FROM `profile` - LEFT JOIN `user` ON `profile`.`uid` = `user`.`uid` - WHERE `user`.`nickname` = '%s' AND `profile`.`is-default` = 1 LIMIT 1", + $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", dbesc($nickname) ); } if(($r === false) || (! count($r))) { - notice( t('No profile') . EOL ); + notice( t('Requested profile is not available.') . EOL ); $a->error = 404; return; } @@ -820,6 +841,14 @@ function profile_load(&$a, $nickname, $profile = 0) { $a->page['title'] = $a->profile['name'] . " @ " . $a->config['sitename']; $_SESSION['theme'] = $a->profile['theme']; + /** + * load/reload current theme info + */ + $theme_info_file = "view/theme/".current_theme()."/theme.php"; + if (file_exists($theme_info_file)){ + require_once($theme_info_file); + } + if(! (x($a->page,'aside'))) $a->page['aside'] = ''; @@ -870,6 +899,8 @@ function profile_sidebar($profile, $block = 0) { if((! is_array($profile)) && (! count($profile))) return $o; + $profile['picdate'] = urlencode($profile['picdate']); + call_hooks('profile_sidebar_enter', $profile); @@ -944,7 +975,7 @@ function profile_sidebar($profile, $block = 0) { $diaspora = array( 'podloc' => $a->get_baseurl(), 'searchable' => (($profile['publish'] && $profile['net-publish']) ? 'true' : 'false' ), - 'nickname ' => $profile['nickname'], + 'nickname' => $profile['nickname'], 'fullname' => $profile['name'], 'firstname' => $firstname, 'lastname' => $lastname, @@ -1005,6 +1036,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'])) @@ -1021,6 +1054,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'];