From dd58a713d8d9e25c12655ee356ee1e269b11cdfa Mon Sep 17 00:00:00 2001
From: rabuzarus <>
Date: Tue, 10 Nov 2015 19:23:45 +0100
Subject: [PATCH 03/48] forumlist: move include to header
---
include/identity.php | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/include/identity.php b/include/identity.php
index fad7c99dd..3e7c6ed3c 100644
--- a/include/identity.php
+++ b/include/identity.php
@@ -1,4 +1,9 @@
Date: Tue, 10 Nov 2015 20:31:13 +0100
Subject: [PATCH 04/48] forumlist: some little code unification
---
include/identity.php | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/include/identity.php b/include/identity.php
index 3e7c6ed3c..5c233a32f 100644
--- a/include/identity.php
+++ b/include/identity.php
@@ -64,15 +64,15 @@ if(! function_exists('profile_load')) {
$profile_int = intval($profile);
$r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile`
INNER JOIN `contact` on `contact`.`uid` = `profile`.`uid` INNER JOIN `user` ON `profile`.`uid` = `user`.`uid`
- WHERE `user`.`nickname` = '%s' AND `profile`.`id` = %d and `contact`.`self` = 1 LIMIT 1",
+ WHERE `user`.`nickname` = '%s' AND `profile`.`id` = %d AND `contact`.`self` = 1 LIMIT 1",
dbesc($nickname),
intval($profile_int)
);
}
if((!$r) && (!count($r))) {
$r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile`
- INNER JOIN `contact` on `contact`.`uid` = `profile`.`uid` INNER JOIN `user` ON `profile`.`uid` = `user`.`uid`
- WHERE `user`.`nickname` = '%s' AND `profile`.`is-default` = 1 and `contact`.`self` = 1 LIMIT 1",
+ INNER JOIN `contact` ON `contact`.`uid` = `profile`.`uid` INNER JOIN `user` ON `profile`.`uid` = `user`.`uid`
+ WHERE `user`.`nickname` = '%s' AND `profile`.`is-default` = 1 AND `contact`.`self` = 1 LIMIT 1",
dbesc($nickname)
);
}
@@ -87,7 +87,7 @@ if(! function_exists('profile_load')) {
// fetch user tags if this isn't the default profile
if(!$r[0]['is-default']) {
- $x = q("select `pub_keywords` from `profile` where uid = %d and `is-default` = 1 limit 1",
+ $x = q("SELECT `pub_keywords` FROM `profile` WHERE `uid` = %d AND `is-default` = 1 LIMIT 1",
intval($r[0]['profile_uid'])
);
if($x && count($x))
@@ -311,7 +311,7 @@ if(! function_exists('profile_sidebar')) {
if(count($r))
$updated = date("c", strtotime($r[0]['updated']));
- $r = q("SELECT COUNT(*) AS `total` FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 and `pending` = 0 AND `hidden` = 0 AND `archive` = 0
+ $r = q("SELECT COUNT(*) AS `total` FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 AND `pending` = 0 AND `hidden` = 0 AND `archive` = 0
AND `network` IN ('%s', '%s', '%s', '')",
intval($profile['uid']),
dbesc(NETWORK_DFRN),
@@ -532,7 +532,7 @@ function advanced_profile(&$a) {
$o = '';
$uid = $a->profile['uid'];
- $o .= replace_macros(get_markup_template("section_title.tpl"),array(
+ $o .= replace_macros(get_markup_template('section_title.tpl'),array(
'$title' => t('Profile')
));
From dac6f39f4184dfd9aa2ab8fc26be75f6e8c8f9bd Mon Sep 17 00:00:00 2001
From: rabuzarus <>
Date: Wed, 11 Nov 2015 01:29:31 +0100
Subject: [PATCH 05/48] forumlist: use a more unique identifier
---
include/features.php | 2 +-
include/forums.php | 2 +-
mod/network.php | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/features.php b/include/features.php
index 8eee2daa1..3aaa22d63 100644
--- a/include/features.php
+++ b/include/features.php
@@ -38,7 +38,7 @@ function get_features() {
'widgets' => array(
t('Network Sidebar Widgets'),
array('archives', t('Search by Date'), t('Ability to select posts by date ranges')),
- array('forumlist', t('List Forums'), t('Enable widget to display the forums your are connected with')),
+ array('forumlist_widget', t('List Forums'), t('Enable widget to display the forums your are connected with')),
array('groups', t('Group Filter'), t('Enable widget to display Network posts only from selected group')),
array('networks', t('Network Filter'), t('Enable widget to display Network posts only from selected network')),
array('savedsearch', t('Saved Searches'), t('Save search terms for re-use')),
diff --git a/include/forums.php b/include/forums.php
index c51516242..425a5e623 100644
--- a/include/forums.php
+++ b/include/forums.php
@@ -64,7 +64,7 @@ function get_forumlist($uid, $showhidden = true, $lastitem, $showprivate = false
*/
function widget_forumlist($a) {
- if(! intval(feature_enabled(local_user(),'forumlist')))
+ if(! intval(feature_enabled(local_user(),'forumlist_widget')))
return;
$o = '';
diff --git a/mod/network.php b/mod/network.php
index 07a6bbd8e..903ee4154 100644
--- a/mod/network.php
+++ b/mod/network.php
@@ -146,7 +146,7 @@ function network_init(&$a) {
}
$a->page['aside'] .= (feature_enabled(local_user(),'groups') ? group_side('network/0','network',true,$group_id) : '');
- $a->page['aside'] .= (feature_enabled(local_user(),'forumlist') ? widget_forumlist($a) : '');
+ $a->page['aside'] .= (feature_enabled(local_user(),'forumlist_widget') ? widget_forumlist($a) : '');
$a->page['aside'] .= posted_date_widget($a->get_baseurl() . '/network',local_user(),false);
$a->page['aside'] .= networks_widget($a->get_baseurl(true) . '/network',(x($_GET, 'nets') ? $_GET['nets'] : ''));
$a->page['aside'] .= saved_searches($search);
From 215205d376feb7bef8b2aa4957d1ed5b5196ea1a Mon Sep 17 00:00:00 2001
From: rabuzarus <>
Date: Wed, 11 Nov 2015 21:31:26 +0100
Subject: [PATCH 06/48] forumlist: nodeinfo_plugin_enabled() is now
plugin_enabled()
---
include/plugin.php | 15 ++++++++++++--
mod/nodeinfo.php | 43 ++++++++++++++++++---------------------
mod/statistics_json.php | 26 +++++++++++------------
view/theme/vier/theme.php | 30 +++++++++++++--------------
4 files changed, 61 insertions(+), 53 deletions(-)
diff --git a/include/plugin.php b/include/plugin.php
index 5a4755c31..91590e8f4 100644
--- a/include/plugin.php
+++ b/include/plugin.php
@@ -1,5 +1,7 @@
0));
+}
diff --git a/mod/nodeinfo.php b/mod/nodeinfo.php
index f013c9084..f329e5445 100644
--- a/mod/nodeinfo.php
+++ b/mod/nodeinfo.php
@@ -67,48 +67,48 @@ function nodeinfo_init(&$a){
$nodeinfo["metadata"] = array("nodeName" => $a->config["sitename"]);
- if (nodeinfo_plugin_enabled("appnet"))
+ if (plugin_enabled("appnet"))
$nodeinfo["services"]["inbound"][] = "appnet";
- if (nodeinfo_plugin_enabled("appnet") OR nodeinfo_plugin_enabled("buffer"))
+ if (plugin_enabled("appnet") OR plugin_enabled("buffer"))
$nodeinfo["services"]["outbound"][] = "appnet";
- if (nodeinfo_plugin_enabled("blogger"))
+ if (plugin_enabled("blogger"))
$nodeinfo["services"]["outbound"][] = "blogger";
- if (nodeinfo_plugin_enabled("dwpost"))
+ if (plugin_enabled("dwpost"))
$nodeinfo["services"]["outbound"][] = "dreamwidth";
- if (nodeinfo_plugin_enabled("fbpost") OR nodeinfo_plugin_enabled("buffer"))
+ if (plugin_enabled("fbpost") OR plugin_enabled("buffer"))
$nodeinfo["services"]["outbound"][] = "facebook";
- if (nodeinfo_plugin_enabled("statusnet")) {
+ if (plugin_enabled("statusnet")) {
$nodeinfo["services"]["inbound"][] = "gnusocial";
$nodeinfo["services"]["outbound"][] = "gnusocial";
}
- if (nodeinfo_plugin_enabled("gpluspost") OR nodeinfo_plugin_enabled("buffer"))
+ if (plugin_enabled("gpluspost") OR plugin_enabled("buffer"))
$nodeinfo["services"]["outbound"][] = "google";
- if (nodeinfo_plugin_enabled("ijpost"))
+ if (plugin_enabled("ijpost"))
$nodeinfo["services"]["outbound"][] = "insanejournal";
- if (nodeinfo_plugin_enabled("libertree"))
+ if (plugin_enabled("libertree"))
$nodeinfo["services"]["outbound"][] = "libertree";
- if (nodeinfo_plugin_enabled("buffer"))
+ if (plugin_enabled("buffer"))
$nodeinfo["services"]["outbound"][] = "linkedin";
- if (nodeinfo_plugin_enabled("ljpost"))
+ if (plugin_enabled("ljpost"))
$nodeinfo["services"]["outbound"][] = "livejournal";
- if (nodeinfo_plugin_enabled("buffer"))
+ if (plugin_enabled("buffer"))
$nodeinfo["services"]["outbound"][] = "pinterest";
- if (nodeinfo_plugin_enabled("posterous"))
+ if (plugin_enabled("posterous"))
$nodeinfo["services"]["outbound"][] = "posterous";
- if (nodeinfo_plugin_enabled("pumpio")) {
+ if (plugin_enabled("pumpio")) {
$nodeinfo["services"]["inbound"][] = "pumpio";
$nodeinfo["services"]["outbound"][] = "pumpio";
}
@@ -118,13 +118,13 @@ function nodeinfo_init(&$a){
if ($smtp)
$nodeinfo["services"]["outbound"][] = "smtp";
- if (nodeinfo_plugin_enabled("tumblr"))
+ if (plugin_enabled("tumblr"))
$nodeinfo["services"]["outbound"][] = "tumblr";
- if (nodeinfo_plugin_enabled("twitter") OR nodeinfo_plugin_enabled("buffer"))
+ if (plugin_enabled("twitter") OR plugin_enabled("buffer"))
$nodeinfo["services"]["outbound"][] = "twitter";
- if (nodeinfo_plugin_enabled("wppost"))
+ if (plugin_enabled("wppost"))
$nodeinfo["services"]["outbound"][] = "wordpress";
$nodeinfo["metadata"]["protocols"] = $nodeinfo["protocols"];
@@ -134,7 +134,7 @@ function nodeinfo_init(&$a){
$nodeinfo["metadata"]["services"] = $nodeinfo["services"];
- if (nodeinfo_plugin_enabled("twitter"))
+ if (plugin_enabled("twitter"))
$nodeinfo["metadata"]["services"]["inbound"][] = "twitter";
header('Content-type: application/json; charset=utf-8');
@@ -142,17 +142,14 @@ function nodeinfo_init(&$a){
exit;
}
-function nodeinfo_plugin_enabled($plugin) {
- $r = q("SELECT * FROM `addon` WHERE `installed` = 1 AND `name` = '%s'", $plugin);
- return((bool)(count($r) > 0));
-}
+
function nodeinfo_cron() {
$a = get_app();
// If the plugin "statistics_json" is enabled then disable it and actrivate nodeinfo.
- if (nodeinfo_plugin_enabled("statistics_json")) {
+ if (plugin_enabled("statistics_json")) {
set_config("system", "nodeinfo", true);
$plugin = "statistics_json";
diff --git a/mod/statistics_json.php b/mod/statistics_json.php
index 9f97d6ac7..92bd1bc1b 100644
--- a/mod/statistics_json.php
+++ b/mod/statistics_json.php
@@ -20,19 +20,19 @@ function statistics_json_init(&$a) {
);
$statistics["services"] = array();
- $statistics["services"]["appnet"] = nodeinfo_plugin_enabled("appnet");
- $statistics["services"]["blogger"] = nodeinfo_plugin_enabled("blogger");
- $statistics["services"]["buffer"] = nodeinfo_plugin_enabled("buffer");
- $statistics["services"]["dreamwidth"] = nodeinfo_plugin_enabled("dwpost");
- $statistics["services"]["facebook"] = nodeinfo_plugin_enabled("fbpost");
- $statistics["services"]["gnusocial"] = nodeinfo_plugin_enabled("statusnet");
- $statistics["services"]["googleplus"] = nodeinfo_plugin_enabled("gpluspost");
- $statistics["services"]["libertree"] = nodeinfo_plugin_enabled("libertree");
- $statistics["services"]["livejournal"] = nodeinfo_plugin_enabled("ljpost");
- $statistics["services"]["pumpio"] = nodeinfo_plugin_enabled("pumpio");
- $statistics["services"]["twitter"] = nodeinfo_plugin_enabled("twitter");
- $statistics["services"]["tumblr"] = nodeinfo_plugin_enabled("tumblr");
- $statistics["services"]["wordpress"] = nodeinfo_plugin_enabled("wppost");
+ $statistics["services"]["appnet"] = plugin_enabled("appnet");
+ $statistics["services"]["blogger"] = plugin_enabled("blogger");
+ $statistics["services"]["buffer"] = plugin_enabled("buffer");
+ $statistics["services"]["dreamwidth"] = plugin_enabled("dwpost");
+ $statistics["services"]["facebook"] = plugin_enabled("fbpost");
+ $statistics["services"]["gnusocial"] = plugin_enabled("statusnet");
+ $statistics["services"]["googleplus"] = plugin_enabled("gpluspost");
+ $statistics["services"]["libertree"] = plugin_enabled("libertree");
+ $statistics["services"]["livejournal"] = plugin_enabled("ljpost");
+ $statistics["services"]["pumpio"] = plugin_enabled("pumpio");
+ $statistics["services"]["twitter"] = plugin_enabled("twitter");
+ $statistics["services"]["tumblr"] = plugin_enabled("tumblr");
+ $statistics["services"]["wordpress"] = plugin_enabled("wppost");
$statistics["appnet"] = $statistics["services"]["appnet"];
$statistics["blogger"] = $statistics["services"]["blogger"];
diff --git a/view/theme/vier/theme.php b/view/theme/vier/theme.php
index 1a4eb3e5a..6c2339f51 100644
--- a/view/theme/vier/theme.php
+++ b/view/theme/vier/theme.php
@@ -284,49 +284,49 @@ function vier_community_info() {
$r = array();
- if (nodeinfo_plugin_enabled("appnet"))
+ if (plugin_enabled("appnet"))
$r[] = array("photo" => "images/appnet.png", "name" => "App.net");
- if (nodeinfo_plugin_enabled("buffer"))
+ if (plugin_enabled("buffer"))
$r[] = array("photo" => "images/buffer.png", "name" => "Buffer");
- if (nodeinfo_plugin_enabled("blogger"))
+ if (plugin_enabled("blogger"))
$r[] = array("photo" => "images/blogger.png", "name" => "Blogger");
- if (nodeinfo_plugin_enabled("dwpost"))
+ if (plugin_enabled("dwpost"))
$r[] = array("photo" => "images/dreamwidth.png", "name" => "Dreamwidth");
- if (nodeinfo_plugin_enabled("fbpost"))
+ if (plugin_enabled("fbpost"))
$r[] = array("photo" => "images/facebook.png", "name" => "Facebook");
- if (nodeinfo_plugin_enabled("ifttt"))
+ if (plugin_enabled("ifttt"))
$r[] = array("photo" => "addon/ifttt/ifttt.png", "name" => "IFTTT");
- if (nodeinfo_plugin_enabled("statusnet"))
+ if (plugin_enabled("statusnet"))
$r[] = array("photo" => "images/gnusocial.png", "name" => "GNU Social");
- if (nodeinfo_plugin_enabled("gpluspost"))
+ if (plugin_enabled("gpluspost"))
$r[] = array("photo" => "images/googleplus.png", "name" => "Google+");
- //if (nodeinfo_plugin_enabled("ijpost"))
+ //if (plugin_enabled("ijpost"))
// $r[] = array("photo" => "images/", "name" => "");
- if (nodeinfo_plugin_enabled("libertree"))
+ if (plugin_enabled("libertree"))
$r[] = array("photo" => "images/libertree.png", "name" => "Libertree");
- //if (nodeinfo_plugin_enabled("ljpost"))
+ //if (plugin_enabled("ljpost"))
// $r[] = array("photo" => "images/", "name" => "");
- if (nodeinfo_plugin_enabled("pumpio"))
+ if (plugin_enabled("pumpio"))
$r[] = array("photo" => "images/pumpio.png", "name" => "pump.io");
- if (nodeinfo_plugin_enabled("tumblr"))
+ if (plugin_enabled("tumblr"))
$r[] = array("photo" => "images/tumblr.png", "name" => "Tumblr");
- if (nodeinfo_plugin_enabled("twitter"))
+ if (plugin_enabled("twitter"))
$r[] = array("photo" => "images/twitter.png", "name" => "Twitter");
- if (nodeinfo_plugin_enabled("wppost"))
+ if (plugin_enabled("wppost"))
$r[] = array("photo" => "images/wordpress", "name" => "Wordpress");
if(function_exists("imap_open") AND !get_config("system","imap_disabled") AND !get_config("system","dfrn_only"))
From 988d0327aea5d0bf7658900593fca512437f021f Mon Sep 17 00:00:00 2001
From: rabuzarus <>
Date: Wed, 11 Nov 2015 21:37:16 +0100
Subject: [PATCH 07/48] forumlist: forgot some required_once for
plugin_enabled()
---
mod/nodeinfo.php | 4 +++-
mod/statistics_json.php | 6 +++++-
view/theme/vier/theme.php | 4 ++--
3 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/mod/nodeinfo.php b/mod/nodeinfo.php
index f329e5445..71aa8135b 100644
--- a/mod/nodeinfo.php
+++ b/mod/nodeinfo.php
@@ -1,6 +1,8 @@
Date: Wed, 11 Nov 2015 22:36:14 +0100
Subject: [PATCH 08/48] forumlist: function get_feature_default()
---
include/features.php | 81 +++++++++++++++++++++++++++++++-------------
1 file changed, 58 insertions(+), 23 deletions(-)
diff --git a/include/features.php b/include/features.php
index 3aaa22d63..263960457 100644
--- a/include/features.php
+++ b/include/features.php
@@ -1,19 +1,54 @@
$uid, 'feature' => $feature, 'enabled' => $x);
call_hooks('feature_enabled',$arr);
return($arr['enabled']);
}
+/**
+ * @brief check if feature is enabled or disabled by default
+ *
+ * @param string $feature
+ * @return boolean
+ */
+function get_feature_default($feature) {
+ $f = get_features();
+ foreach($f as $cat) {
+ foreach($cat as $feat) {
+ if(is_array($feat) && $feat[0] === $feature)
+ return $feat[3];
+ }
+ }
+ return false;
+}
+
+/**
+ * @ brief get a list of all available features
+ * The array includes the setting group, the setting name,
+ * explainations for the setting and if it's enabled or disabled
+ * by default
+ *
+ * @return array
+ */
function get_features() {
$arr = array(
@@ -22,53 +57,53 @@ function get_features() {
'general' => array(
t('General Features'),
//array('expire', t('Content Expiration'), t('Remove old posts/comments after a period of time')),
- array('multi_profiles', t('Multiple Profiles'), t('Ability to create multiple profiles')),
+ array('multi_profiles', t('Multiple Profiles'), t('Ability to create multiple profiles'),false),
array('photo_location', t('Photo Location'), t('Photo metadata is normally stripped. This extracts the location (if present) prior to stripping metadata and links it to a map.'),false),
),
// Post composition
'composition' => array(
t('Post Composition Features'),
- array('richtext', t('Richtext Editor'), t('Enable richtext editor')),
- array('preview', t('Post Preview'), t('Allow previewing posts and comments before publishing them')),
- array('aclautomention', t('Auto-mention Forums'), t('Add/remove mention when a fourm page is selected/deselected in ACL window.')),
+ array('richtext', t('Richtext Editor'), t('Enable richtext editor'),false),
+ array('preview', t('Post Preview'), t('Allow previewing posts and comments before publishing them'),false),
+ array('aclautomention', t('Auto-mention Forums'), t('Add/remove mention when a fourm page is selected/deselected in ACL window.'),false),
),
// Network sidebar widgets
'widgets' => array(
t('Network Sidebar Widgets'),
- array('archives', t('Search by Date'), t('Ability to select posts by date ranges')),
- array('forumlist_widget', t('List Forums'), t('Enable widget to display the forums your are connected with')),
- array('groups', t('Group Filter'), t('Enable widget to display Network posts only from selected group')),
- array('networks', t('Network Filter'), t('Enable widget to display Network posts only from selected network')),
- array('savedsearch', t('Saved Searches'), t('Save search terms for re-use')),
+ array('archives', t('Search by Date'), t('Ability to select posts by date ranges'),false),
+ array('forumlist_widget', t('List Forums'), t('Enable widget to display the forums your are connected with'),true),
+ array('groups', t('Group Filter'), t('Enable widget to display Network posts only from selected group'),false),
+ array('networks', t('Network Filter'), t('Enable widget to display Network posts only from selected network'),false),
+ array('savedsearch', t('Saved Searches'), t('Save search terms for re-use'),false),
),
// Network tabs
'net_tabs' => array(
t('Network Tabs'),
- array('personal_tab', t('Network Personal Tab'), t('Enable tab to display only Network posts that you\'ve interacted on')),
- array('new_tab', t('Network New Tab'), t('Enable tab to display only new Network posts (from the last 12 hours)')),
- array('link_tab', t('Network Shared Links Tab'), t('Enable tab to display only Network posts with links in them')),
+ array('personal_tab', t('Network Personal Tab'), t('Enable tab to display only Network posts that you\'ve interacted on'),false),
+ array('new_tab', t('Network New Tab'), t('Enable tab to display only new Network posts (from the last 12 hours)'),false),
+ array('link_tab', t('Network Shared Links Tab'), t('Enable tab to display only Network posts with links in them'),false),
),
// Item tools
'tools' => array(
t('Post/Comment Tools'),
- array('multi_delete', t('Multiple Deletion'), t('Select and delete multiple posts/comments at once')),
- array('edit_posts', t('Edit Sent Posts'), t('Edit and correct posts and comments after sending')),
- array('commtag', t('Tagging'), t('Ability to tag existing posts')),
- array('categories', t('Post Categories'), t('Add categories to your posts')),
- array('filing', t('Saved Folders'), t('Ability to file posts under folders')),
+ array('multi_delete', t('Multiple Deletion'), t('Select and delete multiple posts/comments at once'),false),
+ array('edit_posts', t('Edit Sent Posts'), t('Edit and correct posts and comments after sending'),false),
+ array('commtag', t('Tagging'), t('Ability to tag existing posts'),false),
+ array('categories', t('Post Categories'), t('Add categories to your posts'),false),
+ array('filing', t('Saved Folders'), t('Ability to file posts under folders'),false),
array('dislike', t('Dislike Posts'), t('Ability to dislike posts/comments')),
- array('star_posts', t('Star Posts'), t('Ability to mark special posts with a star indicator')),
- array('ignore_posts', t('Mute Post Notifications'), t('Ability to mute notifications for a thread')),
+ array('star_posts', t('Star Posts'), t('Ability to mark special posts with a star indicator'),false),
+ array('ignore_posts', t('Mute Post Notifications'), t('Ability to mute notifications for a thread'),false),
),
// Advanced Profile Settings
'advanced_profile' => array(
t('Advanced Profile Settings'),
- array('forumlist_profile', t('List Forums'), t('Show visitors public community forums at the Advanced Profile Page')),
+ array('forumlist_profile', t('List Forums'), t('Show visitors public community forums at the Advanced Profile Page'),false),
),
);
From 862ccb95d2554eab9c8f106ec52992ed526796c0 Mon Sep 17 00:00:00 2001
From: rabuzarus <>
Date: Wed, 11 Nov 2015 22:41:44 +0100
Subject: [PATCH 09/48] forumlist: doxygen corrections
---
include/forums.php | 4 ++--
include/identity.php | 2 +-
include/plugin.php | 4 ++--
mod/nodeinfo.php | 2 +-
mod/statistics_json.php | 2 +-
5 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/include/forums.php b/include/forums.php
index 425a5e623..475658069 100644
--- a/include/forums.php
+++ b/include/forums.php
@@ -53,7 +53,7 @@ function get_forumlist($uid, $showhidden = true, $lastitem, $showprivate = false
}
-/*
+/**
* @brief forumlist widget
*
* Sidebar widget to show subcribed friendica forums. If activated
@@ -107,7 +107,7 @@ function widget_forumlist($a) {
return $o;
}
-/*
+/**
* @brief format forumlist as contact block
*
* This function is used to show the forumlist in
diff --git a/include/identity.php b/include/identity.php
index 5c233a32f..3ab65d9e6 100644
--- a/include/identity.php
+++ b/include/identity.php
@@ -1,5 +1,5 @@
Date: Wed, 11 Nov 2015 23:39:14 +0100
Subject: [PATCH 10/48] forumlist: dbupdate
---
boot.php | 2 +-
include/dbstructure.php | 2 +-
include/forums.php | 24 +++++++-------
update.php | 50 ++++++++++++++++++++++++++++-
view/global.css | 2 +-
view/templates/widget_forumlist.tpl | 2 +-
6 files changed, 65 insertions(+), 17 deletions(-)
diff --git a/boot.php b/boot.php
index d1f0d705f..6e9e45873 100644
--- a/boot.php
+++ b/boot.php
@@ -19,7 +19,7 @@ define ( 'FRIENDICA_PLATFORM', 'Friendica');
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', "
\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
diff --git a/include/dbstructure.php b/include/dbstructure.php
index 0dd74ab15..7d8f89df6 100644
--- a/include/dbstructure.php
+++ b/include/dbstructure.php
@@ -2,7 +2,7 @@
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
diff --git a/include/forums.php b/include/forums.php
index 475658069..e604a3156 100644
--- a/include/forums.php
+++ b/include/forums.php
@@ -2,20 +2,20 @@
/**
* @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
@@ -27,11 +27,11 @@ function get_forumlist($uid, $showhidden = true, $lastitem, $showprivate = false
$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
@@ -54,7 +54,7 @@ function get_forumlist($uid, $showhidden = true, $lastitem, $showprivate = false
/**
- * @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
@@ -95,7 +95,7 @@ function widget_forumlist($a) {
$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,
@@ -108,7 +108,7 @@ function widget_forumlist($a) {
}
/**
- * @brief format forumlist as contact block
+ * @brief Format forumlist as contact block
*
* This function is used to show the forumlist in
* the advanced profile.
@@ -145,4 +145,4 @@ function forumlist_profile_advanced($uid) {
if(count($contacts) > 0)
$o .= $forumlist;
return $o;
-}
\ No newline at end of file
+}
diff --git a/update.php b/update.php
index 33b4560c0..b6faa8508 100644
--- a/update.php
+++ b/update.php
@@ -1,6 +1,6 @@
{{/if}}
-