Merge pull request #104 from annando/master
gpluspost: Wrong table used and some beautifying
This commit is contained in:
commit
53d2569833
|
@ -154,13 +154,13 @@ function gpluspost_init() {
|
||||||
if (isset($a->argv[1])) {
|
if (isset($a->argv[1])) {
|
||||||
$uid = (int)$a->argv[1];
|
$uid = (int)$a->argv[1];
|
||||||
if ($uid == 0) {
|
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) {
|
if ($contacts) {
|
||||||
$uid = $contacts[0]["id"];
|
$uid = $contacts[0]["uid"];
|
||||||
$nick = $a->argv[1];
|
$nick = $a->argv[1];
|
||||||
}
|
}
|
||||||
} else {
|
} 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;
|
$nick = $uid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -170,7 +170,7 @@ function gpluspost_init() {
|
||||||
echo '<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">'."\n";
|
echo '<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">'."\n";
|
||||||
echo "\t".'<title type="html"><![CDATA['.$a->config['sitename'].']]></title>'."\n";
|
echo "\t".'<title type="html"><![CDATA['.$a->config['sitename'].']]></title>'."\n";
|
||||||
if ($uid != 0) {
|
if ($uid != 0) {
|
||||||
echo "\t".'<subtitle type="html"><![CDATA['.$contacts[0]["name"]."]]></subtitle>\n";
|
echo "\t".'<subtitle type="html"><![CDATA['.$contacts[0]["username"]."]]></subtitle>\n";
|
||||||
echo "\t".'<link rel="self" href="'.$a->get_baseurl().'/gpluspost/'.$nick.'"/>'."\n";
|
echo "\t".'<link rel="self" href="'.$a->get_baseurl().'/gpluspost/'.$nick.'"/>'."\n";
|
||||||
} else
|
} else
|
||||||
echo "\t".'<link rel="self" href="'.$a->get_baseurl().'/gpluspost"/>'."\n";
|
echo "\t".'<link rel="self" href="'.$a->get_baseurl().'/gpluspost"/>'."\n";
|
||||||
|
@ -216,7 +216,7 @@ function gpluspost_ShareAttributes($match) {
|
||||||
|
|
||||||
//$text = "<br />".$headline."</strong><blockquote>".$match[2]."</blockquote>";
|
//$text = "<br />".$headline."</strong><blockquote>".$match[2]."</blockquote>";
|
||||||
//$text = "\n\t".$match[2].":\t";
|
//$text = "\n\t".$match[2].":\t";
|
||||||
$text = $author.": ".$match[2];
|
$text = html_entity_decode("♲ ", ENT_QUOTES, 'UTF-8').$author.": ".$match[2];
|
||||||
|
|
||||||
return($text);
|
return($text);
|
||||||
}
|
}
|
||||||
|
@ -283,9 +283,6 @@ function gpluspost_feeditem($pid, $uid) {
|
||||||
if ($msglink == "")
|
if ($msglink == "")
|
||||||
$msglink = $item["plink"];
|
$msglink = $item["plink"];
|
||||||
|
|
||||||
if ($image != $msglink)
|
|
||||||
$html = trim(str_replace($msglink, "", $html));
|
|
||||||
|
|
||||||
// Fetching the title - or the first line
|
// Fetching the title - or the first line
|
||||||
if ($item["title"] != "")
|
if ($item["title"] != "")
|
||||||
$title = $item["title"];
|
$title = $item["title"];
|
||||||
|
@ -294,6 +291,11 @@ function gpluspost_feeditem($pid, $uid) {
|
||||||
$title = $lines[0];
|
$title = $lines[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($image != $msglink)
|
||||||
|
$html = trim(str_replace($msglink, "", $html));
|
||||||
|
|
||||||
|
$title = trim(str_replace($msglink, "", $title));
|
||||||
|
|
||||||
if ($uid == 0)
|
if ($uid == 0)
|
||||||
$title = $item["author-name"].": ".$title;
|
$title = $item["author-name"].": ".$title;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user