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.
This commit is contained in:
@@ -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;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user