aboutsummaryrefslogtreecommitdiffstats
path: root/include/widgets.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-02-04 15:48:39 -0800
committerfriendica <info@friendica.com>2015-02-04 15:48:39 -0800
commit398894851628ccb99090e9d70b92a9a909ef7015 (patch)
treed97049278536fdbabbc889e6be1cb81d4a72ed43 /include/widgets.php
parent1ceb0a7fbab5957ae077ef4867266314c612f8ea (diff)
downloadvolse-hubzilla-398894851628ccb99090e9d70b92a9a909ef7015.tar.gz
volse-hubzilla-398894851628ccb99090e9d70b92a9a909ef7015.tar.bz2
volse-hubzilla-398894851628ccb99090e9d70b92a9a909ef7015.zip
first cut at rating widget. The flaw is that it is limited because it requires local_channel() (formerly local_user()). We need to extend this to take you home like rpost does if you're logged in as remote_channel() - and/or we need zot to send the rating message to the source channel and target in addition to the directories.
Diffstat (limited to 'include/widgets.php')
-rw-r--r--include/widgets.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/widgets.php b/include/widgets.php
index 523318850..71407ad3d 100644
--- a/include/widgets.php
+++ b/include/widgets.php
@@ -903,3 +903,30 @@ function widget_random_block($arr) {
return $o;
}
+
+
+function widget_rating($arr) {
+ $a = get_app();
+ if(! local_channel())
+ return;
+
+ $channel = $a->get_channel();
+
+ if($arr['target'])
+ $hash = $arr['target'];
+ else
+ $hash = $a->poi['xchan_hash'];
+
+ if(! $hash)
+ return;
+
+ if($hash == $channel['channel_hash'])
+ return;
+
+ head_add_js('ratings.js');
+
+ $o = '<div class="widget rateme">';
+ $o .= '<div class="rateme fakelink" onclick="doRatings(\'' . $hash . '\'); return false;"><i class="icon-pencil"></i> ' . t('Rate Me') . '</div></div>';
+ return $o;
+
+} \ No newline at end of file