diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php
index fc05e720f..a8b39f741 100644
--- a/include/bb2diaspora.php
+++ b/include/bb2diaspora.php
@@ -83,7 +83,6 @@ function bb2diaspora($Text,$preserve_nl = false, $fordiaspora = true) {
'return \'#\'. str_replace(\' \', \'_\', $match[2]);'
), $Text);
-
// Converting images with size parameters to simple images. Markdown doesn't know it.
$Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", '[img]$3[/img]', $Text);
@@ -94,11 +93,12 @@ function bb2diaspora($Text,$preserve_nl = false, $fordiaspora = true) {
// Add all tags that maybe were removed
if (preg_match_all("/#\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",$OriginalText, $tags)) {
$tagline = "";
- foreach($tags[2] as $tag)
- if (!strpos($Text, "#".$tag))
+ foreach($tags[2] as $tag) {
+ $tag = html_entity_decode($tag, ENT_QUOTES, 'UTF-8');
+ if (!strpos(html_entity_decode($Text, ENT_QUOTES, 'UTF-8'), "#".$tag))
$tagline .= "#".$tag." ";
-
- $Text = $Text."
".$tagline;
+ }
+ $Text = $Text." ".$tagline;
}
} else
diff --git a/include/forums.php b/include/forums.php
index 59bf5a6b0..995a29cad 100644
--- a/include/forums.php
+++ b/include/forums.php
@@ -60,10 +60,12 @@ function get_forumlist($uid, $showhidden = true, $lastitem, $showprivate = false
* Sidebar widget to show subcribed friendica forums. If activated
* in the settings, it appears at the notwork page sidebar
*
- * @param App $a
+ * @param int $uid
+ * @param int $cid
+ * The contact id which is used to mark a forum as "selected"
* @return string
*/
-function widget_forumlist($a) {
+function widget_forumlist($uid,$cid = 0) {
if(! intval(feature_enabled(local_user(),'forumlist_widget')))
return;
@@ -73,7 +75,7 @@ function widget_forumlist($a) {
//sort by last updated item
$lastitem = true;
- $contacts = get_forumlist($a->user['uid'],true,$lastitem, true);
+ $contacts = get_forumlist($uid,true,$lastitem, true);
$total = count($contacts);
$visible_forums = 10;
@@ -83,11 +85,14 @@ function widget_forumlist($a) {
foreach($contacts as $contact) {
+ $selected = (($cid == $contact['id']) ? ' forum-selected' : '');
+
$entry = array(
- 'url' => $a->get_baseurl() . '/network?f=&cid=' . $contact['id'],
- 'external_url' => $a->get_baseurl() . '/redir/' . $contact['id'],
+ 'url' => z_root() . '/network?f=&cid=' . $contact['id'],
+ 'external_url' => z_root() . '/redir/' . $contact['id'],
'name' => $contact['name'],
'cid' => $contact['id'],
+ 'selected' => $selected,
'micro' => proxy_url($contact['micro'], false, PROXY_SIZE_MICRO),
'id' => ++$id,
);
diff --git a/include/group.php b/include/group.php
index fe29d39f1..862d06818 100644
--- a/include/group.php
+++ b/include/group.php
@@ -213,9 +213,20 @@ function mini_group_select($uid,$gid = 0) {
}
-
-
-function group_side($every="contacts",$each="group",$edit = false, $group_id = 0, $cid = 0) {
+/**
+ * @brief Create group sidebar widget
+ *
+ * @param string $every
+ * @param string $each
+ * @param string $editmode
+ * 'standard' => include link 'Edit groups'
+ * 'extended' => include link 'Create new group'
+ * 'full' => include link 'Create new group' and provide for each group a link to edit this group
+ * @param int $group_id
+ * @param int $cid
+ * @return string
+ */
+function group_side($every="contacts",$each="group",$editmode = "standard", $group_id = 0, $cid = 0) {
$o = '';
@@ -239,13 +250,13 @@ function group_side($every="contacts",$each="group",$edit = false, $group_id = 0
$member_of = array();
if($cid) {
$member_of = groups_containing(local_user(),$cid);
- }
+ }
if(count($r)) {
foreach($r as $rr) {
$selected = (($group_id == $rr['id']) ? ' group-selected' : '');
- if ($edit) {
+ if ($editmode == "full") {
$groupedit = array(
'href' => "group/".$rr['id'],
'title' => t('edit'),
@@ -269,14 +280,17 @@ function group_side($every="contacts",$each="group",$edit = false, $group_id = 0
$tpl = get_markup_template("group_side.tpl");
$o = replace_macros($tpl, array(
- '$title' => t('Groups'),
+ '$title' => t('Groups'),
+ 'newgroup' => (($editmode == "extended") || ($editmode == "full") ? 1 : ''),
+ '$editgroupstext' => t('Edit groups'),
+ 'grouppage' => "group/",
'$edittext' => t('Edit group'),
'$createtext' => t('Create a new group'),
- '$creategroup' => t('Group Name: '),
- '$form_security_token' => get_form_security_token("group_edit"),
+ '$creategroup' => t('Group Name: '),
+ '$form_security_token' => get_form_security_token("group_edit"),
'$ungrouped' => (($every === 'contacts') ? t('Contacts not in any group') : ''),
- '$groups' => $groups,
- '$add' => t('add'),
+ '$groups' => $groups,
+ '$add' => t('add'),
));
diff --git a/include/identity.php b/include/identity.php
index a785ce981..0282b2d9a 100644
--- a/include/identity.php
+++ b/include/identity.php
@@ -216,7 +216,12 @@ if(! function_exists('profile_sidebar')) {
}
if ($connect AND ($profile['network'] != NETWORK_DFRN) AND !isset($profile['remoteconnect']))
- $connect = false;
+ $connect = false;
+
+ if ($connect)
+ $subscribe_feed = t("Atom feed");
+ else
+ $subscribe_feed = false;
if (isset($profile['remoteconnect']))
$remoteconnect = $profile['remoteconnect'];
@@ -337,6 +342,7 @@ if(! function_exists('profile_sidebar')) {
'$profile' => $p,
'$connect' => $connect,
'$remoteconnect' => $remoteconnect,
+ '$subscribe_feed' => $subscribe_feed,
'$wallmessage' => $wallmessage,
'$location' => $location,
'$gender' => $gender,
diff --git a/mod/contacts.php b/mod/contacts.php
index 017b1d643..1dc886363 100644
--- a/mod/contacts.php
+++ b/mod/contacts.php
@@ -55,7 +55,7 @@ function contacts_init(&$a) {
$findpeople_widget .= findpeople_widget();
}
- $groups_widget .= group_side('contacts','group',false,0,$contact_id);
+ $groups_widget .= group_side('contacts','group','full',0,$contact_id);
$a->page['aside'] .= replace_macros(get_markup_template("contacts-widget-sidebar.tpl"),array(
'$vcard_widget' => $vcard_widget,
diff --git a/mod/dirfind.php b/mod/dirfind.php
index 6a4c7f1ce..3f9c82576 100644
--- a/mod/dirfind.php
+++ b/mod/dirfind.php
@@ -205,6 +205,7 @@ function dirfind_content(&$a, $prefix = "") {
'details' => $contact_details['location'],
'tags' => $contact_details['keywords'],
'about' => $contact_details['about'],
+ 'account_type' => (($contact_details['community']) ? t('Forum') : ''),
'network' => network_to_name($jj->network, $jj->url),
'id' => ++$id,
);
diff --git a/mod/group.php b/mod/group.php
index 263586e2e..e9f9561f4 100644
--- a/mod/group.php
+++ b/mod/group.php
@@ -7,7 +7,7 @@ function validate_members(&$item) {
function group_init(&$a) {
if(local_user()) {
require_once('include/group.php');
- $a->page['aside'] = group_side('contacts','group',false,(($a->argc > 1) ? intval($a->argv[1]) : 0));
+ $a->page['aside'] = group_side('contacts','group','extended',(($a->argc > 1) ? intval($a->argv[1]) : 0));
}
}
diff --git a/mod/item.php b/mod/item.php
index 91a94974e..a2b88a8e3 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -362,8 +362,7 @@ function item_post(&$a) {
if((local_user()) && (local_user() == $profile_uid)) {
$self = true;
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 1 LIMIT 1",
- intval($_SESSION['uid'])
- );
+ intval($_SESSION['uid']));
}
elseif(remote_user()) {
if(is_array($_SESSION['remote'])) {
diff --git a/mod/match.php b/mod/match.php
index db1cac0f7..3b0367b42 100644
--- a/mod/match.php
+++ b/mod/match.php
@@ -79,6 +79,7 @@ function match_content(&$a) {
'details' => $contact_details['location'],
'tags' => $contact_details['keywords'],
'about' => $contact_details['about'],
+ 'account_type' => (($contact_details['community']) ? t('Forum') : ''),
'thumb' => proxy_url($jj->photo, false, PROXY_SIZE_THUMB),
'inttxt' => ' ' . t('is interested in:'),
'conntxt' => t('Connect'),
diff --git a/mod/network.php b/mod/network.php
index 903ee4154..f18e3001d 100644
--- a/mod/network.php
+++ b/mod/network.php
@@ -6,6 +6,8 @@ function network_init(&$a) {
}
$is_a_date_query = false;
+ if(x($_GET['cid']) && intval($_GET['cid']) != 0)
+ $cid = $_GET['cid'];
if($a->argc > 1) {
for($x = 1; $x < $a->argc; $x ++) {
@@ -145,8 +147,8 @@ 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') ? widget_forumlist($a) : '');
+ $a->page['aside'] .= (feature_enabled(local_user(),'groups') ? group_side('network/0','network','standard',$group_id) : '');
+ $a->page['aside'] .= (feature_enabled(local_user(),'forumlist_widget') ? widget_forumlist(local_user(),$cid) : '');
$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);
diff --git a/mod/nogroup.php b/mod/nogroup.php
index 06fa730e0..9f6e97843 100644
--- a/mod/nogroup.php
+++ b/mod/nogroup.php
@@ -15,7 +15,7 @@ function nogroup_init(&$a) {
if(! x($a->page,'aside'))
$a->page['aside'] = '';
- $a->page['aside'] .= group_side('contacts','group',false,0,$contact_id);
+ $a->page['aside'] .= group_side('contacts','group','extended',0,$contact_id);
}
diff --git a/mod/parse_url.php b/mod/parse_url.php
index 97eebb89a..ef051d9f6 100644
--- a/mod/parse_url.php
+++ b/mod/parse_url.php
@@ -280,7 +280,8 @@ function parseurl_getsiteinfo($url, $no_guessing = false, $do_oembed = true, $co
if (isset($keywords)) {
$siteinfo["keywords"] = array();
foreach ($keywords as $keyword)
- $siteinfo["keywords"][] = trim($keyword);
+ if (!in_array(trim($keyword), $siteinfo["keywords"]))
+ $siteinfo["keywords"][] = trim($keyword);
}
//$list = $xpath->query("head/meta[@property]");
diff --git a/mod/suggest.php b/mod/suggest.php
index 578338b50..b73c2cd1b 100644
--- a/mod/suggest.php
+++ b/mod/suggest.php
@@ -36,7 +36,7 @@ function suggest_init(&$a) {
}
// Now check how the user responded to the confirmation query
if(!$_REQUEST['canceled']) {
- q("insert into gcign ( uid, gcid ) values ( %d, %d ) ",
+ q("INSERT INTO `gcign` ( `uid`, `gcid` ) VALUES ( %d, %d ) ",
intval(local_user()),
intval($_GET['ignore'])
);
@@ -90,8 +90,9 @@ function suggest_content(&$a) {
'name' => $rr['name'],
'thumb' => proxy_url($rr['photo'], false, PROXY_SIZE_THUMB),
'details' => $contact_details['location'],
- 'tags' => $contact_details['keywords'],
- 'about' => $contact_details['about'],
+ 'tags' => $contact_details['keywords'],
+ 'about' => $contact_details['about'],
+ 'account_type' => (($contact_details['community']) ? t('Forum') : ''),
'ignlnk' => $ignlnk,
'ignid' => $rr['id'],
'conntxt' => t('Connect'),
diff --git a/mod/viewcontacts.php b/mod/viewcontacts.php
index f199574c6..c7f139e1e 100644
--- a/mod/viewcontacts.php
+++ b/mod/viewcontacts.php
@@ -26,7 +26,7 @@ function viewcontacts_content(&$a) {
}
- $r = q("SELECT COUNT(*) as `total` FROM `contact` WHERE `uid` = %d AND `blocked` = 0 AND `pending` = 0 AND `hidden` = 0 AND `archive` = 0 ",
+ $r = q("SELECT COUNT(*) AS `total` FROM `contact` WHERE `uid` = %d AND `blocked` = 0 AND `pending` = 0 AND `hidden` = 0 AND `archive` = 0 ",
intval($a->profile['uid'])
);
if(count($r))
@@ -68,8 +68,9 @@ function viewcontacts_content(&$a) {
'name' => htmlentities(substr($rr['name'],0,20)),
'username' => htmlentities($rr['name']),
'details' => $contact_details['location'],
- 'tags' => $contact_details['keywords'],
- 'about' => $contact_details['about'],
+ 'tags' => $contact_details['keywords'],
+ 'about' => $contact_details['about'],
+ 'account_type' => (($contact_details['community']) ? t('Forum') : ''),
'url' => $url,
'sparkle' => '',
'itemurl' => (($contact_details['addr'] != "") ? $contact_details['addr'] : $rr['url']),
diff --git a/view/templates/group_side.tpl b/view/templates/group_side.tpl
index 4905c2fa1..466882370 100644
--- a/view/templates/group_side.tpl
+++ b/view/templates/group_side.tpl
@@ -1,38 +1,42 @@