]> git.mxchange.org Git - friendica.git/blobdiff - update.php
The "tagged with" message now works again.
[friendica.git] / update.php
index b6faa85081da95d7db136d35556bc807442e59a0..dce397368d72ed01e24741d0115d909feb51412c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-define( 'UPDATE_VERSION' , 1191 );
+define('UPDATE_VERSION' , 1200);
 
 /**
  *
@@ -1595,7 +1595,7 @@ function update_1169() {
        if (!$r)
                return UPDATE_FAILED;
 
-       proc_run('php',"include/threadupdate.php");
+       proc_run(PRIORITY_LOW, "include/threadupdate.php");
 
        return UPDATE_SUCCESS;
 }
@@ -1636,7 +1636,7 @@ function update_1178() {
                set_config('system','community_page_style', CP_NO_COMMUNITY_PAGE);
 
        // Update the central item storage with uid=0
-       proc_run('php',"include/threadupdate.php");
+       proc_run(PRIORITY_LOW, "include/threadupdate.php");
 
        return UPDATE_SUCCESS;
 }
@@ -1644,7 +1644,7 @@ function update_1178() {
 function update_1180() {
 
        // Fill the new fields in the term table.
-       proc_run('php',"include/tagupdate.php");
+       proc_run(PRIORITY_LOW, "include/tagupdate.php");
 
        return UPDATE_SUCCESS;
 }
@@ -1662,48 +1662,64 @@ function update_1188() {
 
 function update_1190() {
 
-       require_once('/include/plugins.php');
+       require_once('include/plugin.php');
+
+       set_config('system', 'maintenance', 1);
 
        if (plugin_enabled('forumlist')) {
                $plugin = 'forumlist';
                $plugins = get_config('system','addon');
                $plugins_arr = array();
+
                if($plugins) {
-                       $plugins_arr = explode(',',str_replace(' ', '',$plugins));
+                       $plugins_arr = explode(",",str_replace(" ", "",$plugins));
+
                        $idx = array_search($plugin, $plugins_arr);
                        if ($idx !== false){
                                unset($plugins_arr[$idx]);
-                               uninstall_plugin($plugin);
-                               set_config('system','addon', implode(', ',$plugins_arr));
+                               //delete forumlist manually from addon and hook table 
+                               // since uninstall_plugin() don't work here
+                               q("DELETE FROM `addon` WHERE `name` = 'forumlist' ");
+                               q("DELETE FROM `hook` WHERE `file` = 'addon/forumlist/forumlist.php' ");
+                               set_config('system','addon', implode(", ",$plugins_arr));
                        }
                }
        }
 
-       $r = q("SELECT `uid`, `cat`, `k`, `v` FROM `pconfig` WHERE `cat` = '%d' ",
+       // select old formlist addon entries
+       $r = q("SELECT `uid`, `cat`, `k`, `v` FROM `pconfig` WHERE `cat` = '%s' ",
                dbesc('forumlist')
-);
+       );
 
-       foreach ($r as $rr) {
-               $uid = $rr['uid'];
-               $family = $rr['cat'];
-               $key = $rr['k'];
-               $value = $rr['v'];
+       // convert old forumlist addon entries in new config entries
+       if (count($r)) {
+               foreach ($r as $rr) {
+                       $uid = $rr['uid'];
+                       $family = $rr['cat'];
+                       $key = $rr['k'];
+                       $value = $rr['v'];
 
-               if ($key === 'randomize')
-                       del_pconfig($uid,$family,$key);
+                       if ($key === 'randomise')
+                               del_pconfig($uid,$family,$key);
 
-               if ($key === 'show_on_profile') {
-                       if ($value)
-                               set_pconfig($uid,feature,forumlist_profile,$value);
+                       if ($key === 'show_on_profile') {
+                               if ($value)
+                                       set_pconfig($uid,feature,forumlist_profile,$value);
 
-                       del_pconfig($uid,$family,$key);
-               }
+                               del_pconfig($uid,$family,$key);
+                       }
 
-               if ($key === 'show_on_network') {
-                       if ($value)
-                               set_pconfig($uid,feature,forumlist,$value);
+                       if ($key === 'show_on_network') {
+                               if ($value)
+                                       set_pconfig($uid,feature,forumlist_widget,$value);
 
-                       del_pconfig($uid,$family,$key);
+                               del_pconfig($uid,$family,$key);
+                       }
                }
        }
+
+       set_config('system', 'maintenance', 0);
+
+       return UPDATE_SUCCESS;
+
 }