aboutsummaryrefslogtreecommitdiffstats
path: root/mod/dirsearch.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-01-31 00:50:20 -0800
committerfriendica <info@friendica.com>2015-01-31 00:50:20 -0800
commite6a5f7800390e5091743d6a97c6fd8f54c5d1530 (patch)
tree20c49c7d11b411b91530ef43374a208274ebbb57 /mod/dirsearch.php
parent4a243b63f7019a1e56ecf03b138cd7fc396236c2 (diff)
parent3e5226adc70838c784a0b208de25fffde37a6679 (diff)
downloadvolse-hubzilla-e6a5f7800390e5091743d6a97c6fd8f54c5d1530.tar.gz
volse-hubzilla-e6a5f7800390e5091743d6a97c6fd8f54c5d1530.tar.bz2
volse-hubzilla-e6a5f7800390e5091743d6a97c6fd8f54c5d1530.zip
Merge branch 'master' into tres
Conflicts: include/zot.php
Diffstat (limited to 'mod/dirsearch.php')
-rw-r--r--mod/dirsearch.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/mod/dirsearch.php b/mod/dirsearch.php
index f62320378..ad0dd5373 100644
--- a/mod/dirsearch.php
+++ b/mod/dirsearch.php
@@ -125,7 +125,7 @@ function dirsearch_content(&$a) {
if($hash) {
- $sql_extra = " AND xchan_hash = '" . dbesc($hash) . "' ";
+ $sql_extra = " AND xchan_hash like '" . dbesc($hash) . protect_sprintf('%') . "' ";
}
@@ -221,8 +221,18 @@ function dirsearch_content(&$a) {
foreach($r as $rr) {
+
$entry = array();
+ $pc = q("select count(xlink_rating) as total_ratings from xlink where xlink_link = '%s' and xlink_rating != 0 and xlink_static = 1 group by xlink_rating",
+ dbesc($rr['xchan_hash'])
+ );
+
+ if($pc)
+ $entry['total_ratings'] = intval($pc[0]['total_ratings']);
+ else
+ $entry['total_ratings'] = 0;
+
$entry['name'] = $rr['xchan_name'];
$entry['hash'] = $rr['xchan_hash'];