]> git.mxchange.org Git - friendica.git/blobdiff - boot.php
Adds theme info file to define 'parent' theme from where load tpl files
[friendica.git] / boot.php
index d7c00428fd3bc8b008d8ded304f28d34deb29a24..5b32e05736321831575ede3201a8c9d9e58e4429 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -8,9 +8,9 @@ require_once("include/pgettext.php");
 require_once('include/nav.php');
 
 
-define ( 'FRIENDIKA_VERSION',      '2.2.1093' );
+define ( 'FRIENDIKA_VERSION',      '2.3.1116' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.21'    );
-define ( 'DB_UPDATE_VERSION',      1087      );
+define ( 'DB_UPDATE_VERSION',      1092      );
 
 define ( 'EOL',                    "<br />\r\n"     );
 define ( 'ATOM_TIME',              'Y-m-d\TH:i:s\Z' );
@@ -165,6 +165,7 @@ define ( 'ACTIVITY_OBJ_PHOTO',   NAMESPACE_ACTIVITY_SCHEMA . 'photo' );
 define ( 'ACTIVITY_OBJ_P_PHOTO', NAMESPACE_ACTIVITY_SCHEMA . 'profile-photo' );
 define ( 'ACTIVITY_OBJ_ALBUM',   NAMESPACE_ACTIVITY_SCHEMA . 'photo-album' );
 define ( 'ACTIVITY_OBJ_EVENT',   NAMESPACE_ACTIVITY_SCHEMA . 'event' );
+define ( 'ACTIVITY_OBJ_TAGTERM', NAMESPACE_DFRN            . '/tagterm' );
 
 /**
  * item weight for query ordering
@@ -185,7 +186,9 @@ define ( 'GRAVITY_COMMENT',      6);
 function startup() {
        error_reporting(E_ERROR | E_WARNING | E_PARSE);
        set_time_limit(0);
-       ini_set('pcre.backtrack_limit', 250000);
+
+       // This has to be quite large to deal with embedded private photos
+       ini_set('pcre.backtrack_limit', 350000);
 
 
        if (get_magic_quotes_gpc()) {
@@ -721,14 +724,16 @@ function remote_user() {
 if(! function_exists('notice')) {
 function notice($s) {
        $a = get_app();
+       if(! x($_SESSION,'sysmsg'))     $_SESSION['sysmsg'] = array();
        if($a->interactive)
-               $_SESSION['sysmsg'] .= $s;
+               $_SESSION['sysmsg'][] = $s;
 }}
 if(! function_exists('info')) {
 function info($s) {
        $a = get_app();
+       if(! x($_SESSION,'sysmsg_info')) $_SESSION['sysmsg_info'] = array();
        if($a->interactive)
-               $_SESSION['sysmsg_info'] .= $s;
+               $_SESSION['sysmsg_info'][] = $s;
 }}
 
 
@@ -857,6 +862,43 @@ function profile_sidebar($profile, $block = 0) {
        if((remote_user()) && ($_SESSION['visitor_visiting'] == $profile['uid']))
                $connect = False; 
 
+
+       // show edit profile to yourself
+       if ($profile['uid'] == local_user()) {
+               $profile['edit'] = array($a->get_baseurl(). '/profiles', t('Profiles'),"", t('Manage/edit profiles'));
+               
+               $r = q("SELECT * FROM `profile` WHERE `uid` = %d",
+                               local_user());
+               
+               $profile['menu'] = array(
+                       'chg_photo' => t('Change profile photo'),
+                       'cr_new' => t('Create New Profile'),
+                       'entries' => array(),
+               );
+                               
+               if(count($r)) {
+
+                       foreach($r as $rr) {
+                               $profile['menu']['entries'][] = array(
+                                       'photo' => $rr['thumb'],
+                                       'id' => $rr['id'],
+                                       'alt' => t('Profile Image'),
+                                       'profile_name' => $rr['profile-name'],
+                                       'isdefault' => $rr['is-default'],
+                                       'visibile_to_everybody' =>  t('visible to everybody'),
+                                       'edit_visibility' => t('Edit visibility'),
+                                       
+                               );
+                       }
+
+
+               }
+               
+               
+       }
+
+
+
        
        if((x($profile,'address') == 1) 
                || (x($profile,'locality') == 1) 
@@ -881,21 +923,22 @@ function profile_sidebar($profile, $block = 0) {
                'searchable' => (($profile['publish'] && $profile['net-publish']) ? 'true' : 'false' ),
                'nickname ' => $profile['nickname'],
                'fullname' => $profile['name'],
-               'photo300 ' => $a->get_baseurl() . '/photo/custom/300/' . $profile['uid'] . '.jpg',
-               'photo100 ' => $a->get_baseurl() . '/photo/custom/100/' . $profile['uid'] . '.jpg',
-               'photo50  ' => $a->get_baseurl() . '/photo/custom/50/'  . $profile['uid'] . '.jpg',
+               'photo300' => $a->get_baseurl() . '/photo/custom/300/' . $profile['uid'] . '.jpg',
+               'photo100' => $a->get_baseurl() . '/photo/custom/100/' . $profile['uid'] . '.jpg',
+               'photo50' => $a->get_baseurl() . '/photo/custom/50/'  . $profile['uid'] . '.jpg',
        );
 
        if (!$block){
                $contact_block = contact_block();
        }
 
+
        $tpl = get_markup_template('profile_vcard.tpl');
 
        $o .= replace_macros($tpl, array(
                '$profile' => $profile,
                '$connect'  => $connect,                
-               '$location' => $location,
+               '$location' => template_escape($location),
                '$gender'   => $gender,
                '$pdesc'        => $pdesc,
                '$marital'  => $marital,
@@ -951,7 +994,7 @@ function get_birthdays() {
                                $now = strtotime('now');
                                $today = (((strtotime($rr['start'] . ' +00:00') < $now) && (strtotime($rr['finish'] . ' +00:00') > $now)) ? true : false); 
        
-                               $o .= '<div class="birthday-list" id="birthday-' . $rr['eid'] . '"><a class="sparkle" href="' 
+                               $o .= '<div class="birthday-list" id="birthday-' . $rr['eid'] . '"><a class="sparkle" target="redir" href="' 
                                . $a->get_baseurl() . '/redir/'  . $rr['cid'] . '">' . $rr['name'] . '</a> ' 
                                . day_translate(datetime_convert('UTC', $a->timezone, $rr['start'], $bd_format)) . (($today) ?  ' ' . t('[today]') : '')
                                . '</div>' ;