]> git.mxchange.org Git - friendica.git/blobdiff - boot.php
friend suggest structures, cont.
[friendica.git] / boot.php
index ff4224cfc7ced4c7bac414f8e0b4b1c1200b6302..5a7af9725b5c0540a9eae84afc463cc3b6bbcf80 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -4,9 +4,9 @@ set_time_limit(0);
 ini_set('pcre.backtrack_limit', 250000);
 
 
-define ( 'FRIENDIKA_VERSION',      '2.2.1010' );
+define ( 'FRIENDIKA_VERSION',      '2.2.1022' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.21'    );
-define ( 'DB_UPDATE_VERSION',      1063      );
+define ( 'DB_UPDATE_VERSION',      1068      );
 
 define ( 'EOL',                    "<br />\r\n"     );
 define ( 'ATOM_TIME',              'Y-m-d\TH:i:s\Z' );
@@ -128,6 +128,8 @@ define ( 'NAMESPACE_OSTATUSSUB',      'http://ostatus.org/schema/1.0/subscribe'
 define ( 'NAMESPACE_GEORSS',          'http://www.georss.org/georss' );
 define ( 'NAMESPACE_POCO',            'http://portablecontacts.net/spec/1.0' );
 define ( 'NAMESPACE_FEED',            'http://schemas.google.com/g/2010#updates-from' );
+define ( 'NAMESPACE_OSTATUS',         'http://ostatus.org/schema/1.0' );
+define ( 'NAMESPACE_STATUSNET',       'http://status.net/schema/api/1/' );
 
 /**
  * activity stream defines
@@ -477,9 +479,13 @@ function install_plugin($plugin){
        if(function_exists($plugin . '_install')) {
                $func = $plugin . '_install';
                $func();
-               $r = q("INSERT INTO `addon` (`name`, `installed`, `timestamp`) VALUES ( '%s', 1, %d ) ",
+               
+               $plugin_admin = (function_exists($plugin."_plugin_admin")?1:0);
+               
+               $r = q("INSERT INTO `addon` (`name`, `installed`, `timestamp`, `plugin_admin`) VALUES ( '%s', 1, %d , %d ) ",
                        dbesc($plugin),
-                       intval($t)
+                       intval($t),
+                       $plugin_admin
                );
        }
 }}
@@ -1243,8 +1249,10 @@ function get_config($family, $key, $instore = false) {
                dbesc($key)
        );
        if(count($ret)) {
-               $a->config[$family][$key] = $ret[0]['v'];
-               return $ret[0]['v'];
+               // manage array value
+               $val = (preg_match("|^a:[0-9]+:{.*}$|", $ret[0]['v'])?unserialize( $ret[0]['v']):$ret[0]['v']);
+               $a->config[$family][$key] = $val;
+               return $val;
        }
        else {
                $a->config[$family][$key] = '!<unset>!';
@@ -1258,22 +1266,25 @@ function get_config($family, $key, $instore = false) {
 
 if(! function_exists('set_config')) {
 function set_config($family,$key,$value) {
-
        global $a;
+       
+       // manage array value
+       $dbvalue = (is_array($value)?serialize($value):$value);
 
        if(get_config($family,$key,true) === false) {
                $a->config[$family][$key] = $value;
                $ret = q("INSERT INTO `config` ( `cat`, `k`, `v` ) VALUES ( '%s', '%s', '%s' ) ",
                        dbesc($family),
                        dbesc($key),
-                       dbesc($value)
+                       dbesc($dbvalue)
                );
                if($ret) 
                        return $value;
                return $ret;
        }
+       
        $ret = q("UPDATE `config` SET `v` = '%s' WHERE `cat` = '%s' AND `k` = '%s' LIMIT 1",
-               dbesc($value),
+               dbesc($dbvalue),
                dbesc($family),
                dbesc($key)
        );