aboutsummaryrefslogtreecommitdiffstats
path: root/mod/ratingsearch.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-04-23 19:49:41 -0700
committerfriendica <info@friendica.com>2015-04-23 19:49:41 -0700
commit6679734135fb04f4a7beccb81663bf1e9574f062 (patch)
tree887488543d98b5dd297d917718bdd99844e83ba5 /mod/ratingsearch.php
parent08b757a22cd2804bfec8ecf682b6987b8c06ca49 (diff)
parentc696860cc53bc25558d83de5eda65d9b583da382 (diff)
downloadvolse-hubzilla-6679734135fb04f4a7beccb81663bf1e9574f062.tar.gz
volse-hubzilla-6679734135fb04f4a7beccb81663bf1e9574f062.tar.bz2
volse-hubzilla-6679734135fb04f4a7beccb81663bf1e9574f062.zip
Merge branch 'master' into tres
Conflicts: include/Contact.php include/ItemObject.php include/api.php include/attach.php include/diaspora.php include/dir_fns.php include/enotify.php include/event.php include/expire.php include/items.php include/notifier.php include/notify.php include/photos.php include/taxonomy.php include/text.php include/widgets.php include/zot.php mod/admin.php mod/channel.php mod/dirsearch.php mod/display.php mod/editwebpage.php mod/events.php mod/home.php mod/item.php mod/manage.php mod/mood.php mod/network.php mod/page.php mod/photos.php mod/ping.php mod/post.php mod/thing.php mod/viewsrc.php view/css/mod_events.css
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) {