aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHabeas Codice <habeascodice@federated.social>2015-01-28 17:37:34 -0800
committerHabeas Codice <habeascodice@federated.social>2015-01-28 17:37:34 -0800
commit1a537888333afb052e9eb4954091fd163f5b78d1 (patch)
tree3d0b7bd796164d564fad59e8dc92e175da23bc8b
parent435509f6092e55c7f1d96be23519f67c4db511ad (diff)
downloadvolse-hubzilla-1a537888333afb052e9eb4954091fd163f5b78d1.tar.gz
volse-hubzilla-1a537888333afb052e9eb4954091fd163f5b78d1.tar.bz2
volse-hubzilla-1a537888333afb052e9eb4954091fd163f5b78d1.zip
bookmarkedchats: remove extraneous group by, dupes removed on insert
suggestedchats: normalize to standard SQL
-rw-r--r--include/widgets.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/widgets.php b/include/widgets.php
index 9f9268055..3533e2cea 100644
--- a/include/widgets.php
+++ b/include/widgets.php
@@ -642,7 +642,7 @@ function widget_bookmarkedchats($arr) {
$h = get_observer_hash();
if(! $h)
return;
- $r = q("select * from xchat where xchat_xchan = '%s' group by xchat_url order by xchat_desc",
+ $r = q("select xchat_url, xchat_desc from xchat where xchat_xchan = '%s' order by xchat_desc",
dbesc($h)
);
if($r) {
@@ -664,7 +664,7 @@ function widget_suggestedchats($arr) {
$h = get_observer_hash();
if(! $h)
return;
- $r = q("select *, count(xchat_url) as total from xchat group by xchat_url order by total desc, xchat_desc limit 24");
+ $r = q("select xchat_url, xchat_desc, count(xchat_xchan) as total from xchat group by xchat_url, xchat_desc order by total desc, xchat_desc limit 24");
if($r) {
for($x = 0; $x < count($r); $x ++) {
$r[$x]['xchat_url'] = zid($r[$x]['xchat_url']);