From 30da149c90a5b96a1954f7ba29840633398abb94 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 3 Mar 2013 23:43:35 +0100 Subject: [PATCH 1/3] gpluspost: Showing a "recycle" sign when displaying repeated items. --- gpluspost/gpluspost.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gpluspost/gpluspost.php b/gpluspost/gpluspost.php index 22fccdef..76cf237b 100644 --- a/gpluspost/gpluspost.php +++ b/gpluspost/gpluspost.php @@ -216,7 +216,7 @@ function gpluspost_ShareAttributes($match) { //$text = "
".$headline."
".$match[2]."
"; //$text = "\n\t".$match[2].":\t"; - $text = $author.": ".$match[2]; + $text = html_entity_decode("♲ ", ENT_QUOTES, 'UTF-8').$author.": ".$match[2]; return($text); } From 63404c06c9aff3a8945ec166640f7f9fd515b38b Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Mon, 4 Mar 2013 00:51:55 +0100 Subject: [PATCH 2/3] gpluspost: Wrong table used. You should never mix "contact" with "user" :) --- gpluspost/gpluspost.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gpluspost/gpluspost.php b/gpluspost/gpluspost.php index 76cf237b..2a3037b9 100644 --- a/gpluspost/gpluspost.php +++ b/gpluspost/gpluspost.php @@ -154,13 +154,13 @@ function gpluspost_init() { if (isset($a->argv[1])) { $uid = (int)$a->argv[1]; if ($uid == 0) { - $contacts = q("SELECT `name`, `id` FROM contact WHERE `nick` = '%s' LIMIT 1", dbesc($a->argv[1])); + $contacts = q("SELECT `username`, `uid` FROM `user` WHERE `nickname` = '%s' LIMIT 1", dbesc($a->argv[1])); if ($contacts) { - $uid = $contacts[0]["id"]; + $uid = $contacts[0]["uid"]; $nick = $a->argv[1]; } } else { - $contacts = q("SELECT `name` FROM contact WHERE ID=%d LIMIT 1", intval($uid)); + $contacts = q("SELECT `username` FROM `user` WHERE `uid`=%d LIMIT 1", intval($uid)); $nick = $uid; } } @@ -170,7 +170,7 @@ function gpluspost_init() { echo ''."\n"; echo "\t".'<![CDATA['.$a->config['sitename'].']]>'."\n"; if ($uid != 0) { - echo "\t".'\n"; + echo "\t".'\n"; echo "\t".''."\n"; } else echo "\t".''."\n"; From e0eaaf7b23640b7b63c215cb8d43ac2d578a5632 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Mon, 4 Mar 2013 00:58:54 +0100 Subject: [PATCH 3/3] gpluspost: URL in title is removed when it points to the URL of the message --- gpluspost/gpluspost.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gpluspost/gpluspost.php b/gpluspost/gpluspost.php index 2a3037b9..be710242 100644 --- a/gpluspost/gpluspost.php +++ b/gpluspost/gpluspost.php @@ -283,9 +283,6 @@ function gpluspost_feeditem($pid, $uid) { if ($msglink == "") $msglink = $item["plink"]; - if ($image != $msglink) - $html = trim(str_replace($msglink, "", $html)); - // Fetching the title - or the first line if ($item["title"] != "") $title = $item["title"]; @@ -294,6 +291,11 @@ function gpluspost_feeditem($pid, $uid) { $title = $lines[0]; } + if ($image != $msglink) + $html = trim(str_replace($msglink, "", $html)); + + $title = trim(str_replace($msglink, "", $title)); + if ($uid == 0) $title = $item["author-name"].": ".$title;