aboutsummaryrefslogtreecommitdiffstats
path: root/mod/ratings.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/ratings.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/ratings.php')
-rw-r--r--mod/ratings.php19
1 files changed, 13 insertions, 6 deletions
diff --git a/mod/ratings.php b/mod/ratings.php
index fe7865778..dc98eb238 100644
--- a/mod/ratings.php
+++ b/mod/ratings.php
@@ -35,7 +35,7 @@ function ratings_init(&$a) {
$results = false;
- $x = z_fetch_url($url . '/ratingsearch/' . $hash);
+ $x = z_fetch_url($url . '/ratingsearch/' . urlencode($hash));
if($x['success'])
@@ -48,8 +48,9 @@ function ratings_init(&$a) {
return;
}
- $a->poi = $results['target'];
-
+ if(array_key_exists('xchan_hash',$results['target']))
+ $a->poi = $results['target'];
+
$friends = array();
$others = array();
@@ -62,9 +63,9 @@ function ratings_init(&$a) {
}
}
- $a->data = array_merge($friends,$others);
+ $a->data = array('target' => $results['target'], 'results' => array_merge($friends,$others));
- if(! $a->data) {
+ if(! $a->data['results']) {
notice( t('No ratings') . EOL);
}
@@ -90,11 +91,17 @@ function ratings_content(&$a) {
if(! $poco_rating)
return;
+ $site_target = ((array_key_exists('target',$a->data) && array_key_exists('site_url',$a->data['target'])) ?
+ '<a href="' . $a->data['target']['site_url'] . '" >' . $a->data['target']['site_url'] . '</a>' : '');
+
+
$o = replace_macros(get_markup_template('prep.tpl'),array(
'$header' => t('Ratings'),
'$rating_lbl' => t('Rating: ' ),
+ '$website' => t('Website: '),
+ '$site' => $site_target,
'$rating_text_lbl' => t('Description: '),
- '$raters' => $a->data
+ '$raters' => $a->data['results']
));
return $o;