diff options
Diffstat (limited to 'include/widgets.php')
-rw-r--r-- | include/widgets.php | 27 |
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 |