aboutsummaryrefslogtreecommitdiffstats
path: root/mod/ratingsearch.php
diff options
context:
space:
mode:
authorHabeas Codice <habeascodice@federated.social>2015-02-16 15:13:31 -0800
committerHabeas Codice <habeascodice@federated.social>2015-02-16 15:13:31 -0800
commitd9d029470f188796988e002eb90e9dbf96d3dd29 (patch)
treeef922432ae326f358374535bf68492729134e49e /mod/ratingsearch.php
parentca8e22101803454be60af35d2cf71ae80224805a (diff)
parent1d1676094dd82482f113d6de9c2a95407a1a692f (diff)
downloadvolse-hubzilla-d9d029470f188796988e002eb90e9dbf96d3dd29.tar.gz
volse-hubzilla-d9d029470f188796988e002eb90e9dbf96d3dd29.tar.bz2
volse-hubzilla-d9d029470f188796988e002eb90e9dbf96d3dd29.zip
Merge branch 'master' of https://github.com/friendica/red
Diffstat (limited to 'mod/ratingsearch.php')
-rw-r--r--mod/ratingsearch.php19
1 files changed, 15 insertions, 4 deletions
diff --git a/mod/ratingsearch.php b/mod/ratingsearch.php
index ec2db570b..9c4f2f827 100644
--- a/mod/ratingsearch.php
+++ b/mod/ratingsearch.php
@@ -33,17 +33,28 @@ function ratingsearch_init(&$a) {
);
if($p)
- $ret['target'] = $p[0];
+ $target = $p[0]['xchan_hash'];
else {
- $ret['message'] = 'channel not found';
- json_return_and_die($ret);
+ $p = q("select * from site where site_url like '%s' ",
+ dbesc('%' . $hash)
+ );
+ if($p) {
+ $target = strtolower($hash);
+ }
+ else {
+ $ret['message'] = 'Rating target not found';
+ json_return_and_die($ret);
+ }
}
+ if($p)
+ $ret['target'] = $p[0];
+
$ret['success'] = true;
$r = q("select * from xlink left join xchan on xlink_xchan = xchan_hash
where xlink_link = '%s' and xlink_rating != 0 and xlink_static = 1 order by xchan_name asc",
- dbesc($p[0]['xchan_hash'])
+ dbesc($target)
);
if($r) {