define ( 'FRIENDICA_CODENAME', 'Lily of the valley');
define ( 'FRIENDICA_VERSION', '3.4.2' );
define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
-define ( 'DB_UPDATE_VERSION', 1190 );
+define ( 'DB_UPDATE_VERSION', 1191 );
define ( 'EOL', "<br />\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
require_once("boot.php");
require_once("include/text.php");
-define('NEW_UPDATE_ROUTINE_VERSION', 1170);
+define('NEW_UPDATE_ROUTINE_VERSION', 1191);
/*
* send the email and do what is needed to do on update fails
/**
* @file include/forums.php
- * @brief functions related to forum functionality *
+ * @brief Functions related to forum functionality *
*/
/**
- * @brief function to list all forums a user is connected with
+ * @brief Function to list all forums a user is connected with
*
* @param int $uid of the profile owner
* @param boolean $showhidden
- * show frorums which are not hidden
+ * Show frorums which are not hidden
* @param boolean $lastitem
- * sort by lastitem
+ * Sort by lastitem
* @param boolean $showprivate
- * show private groups
+ * Show private groups
*
* @returns array
* 'url' => forum url
$forumlist = array();
- $order = (($showhidden) ? '' : " AND `hidden` = 0 ");
+ $order = (($showhidden) ? '' : ' AND `hidden` = 0 ');
$order .= (($lastitem) ? ' ORDER BY `last-item` ASC ' : ' ORDER BY `name` ASC ');
- $select = "`forum` = 1";
+ $select = '`forum` = 1';
if ($showprivate) {
- $select = "( `forum` = 1 OR `prv` = 1 )";
+ $select = '( `forum` = 1 OR `prv` = 1 )';
}
$contacts = q("SELECT `contact`.`id`, `contact`.`url`, `contact`.`name`, `contact`.`micro` FROM contact
/**
- * @brief forumlist widget
+ * @brief Forumlist widget
*
* Sidebar widget to show subcribed friendica forums. If activated
* in the settings, it appears at the notwork page sidebar
$tpl = get_markup_template('widget_forumlist.tpl');
$o .= replace_macros($tpl,array(
- '$title' => t("Forums"),
+ '$title' => t('Forums'),
'$forums' => $entries,
'$link_desc' => t('External link to forum'),
'$total' => $total,
}
/**
- * @brief format forumlist as contact block
+ * @brief Format forumlist as contact block
*
* This function is used to show the forumlist in
* the advanced profile.
if(count($contacts) > 0)
$o .= $forumlist;
return $o;
-}
\ No newline at end of file
+}
<?php
-define( 'UPDATE_VERSION' , 1190 );
+define( 'UPDATE_VERSION' , 1191 );
/**
*
return UPDATE_SUCCESS;
}
+
+function update_1190() {
+
+ require_once('/include/plugins.php');
+
+ if (plugin_enabled('forumlist')) {
+ $plugin = 'forumlist';
+ $plugins = get_config('system','addon');
+ $plugins_arr = array();
+ if($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));
+ }
+ }
+ }
+
+ $r = q("SELECT `uid`, `cat`, `k`, `v` FROM `pconfig` WHERE `cat` = '%d' ",
+ dbesc('forumlist')
+);
+
+ 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 === 'show_on_profile') {
+ if ($value)
+ set_pconfig($uid,feature,forumlist_profile,$value);
+
+ del_pconfig($uid,$family,$key);
+ }
+
+ if ($key === 'show_on_network') {
+ if ($value)
+ set_pconfig($uid,feature,forumlist,$value);
+
+ del_pconfig($uid,$family,$key);
+ }
+ }
+}
.forumlist-img {
height: 20px;
width: 20px;
-}
\ No newline at end of file
+}
</ul>
{{/if}}
-</div>
\ No newline at end of file
+</div>