本文整理汇总了PHP中Track::update_vote方法的典型用法代码示例。如果您正苦于以下问题:PHP Track::update_vote方法的具体用法?PHP Track::update_vote怎么用?PHP Track::update_vote使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Track
的用法示例。
在下文中一共展示了Track::update_vote方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: web_undo_vote
/**
* (Web service method) Undo vote for current track (for this nick)
* @param mixed[] $args nick
* @return mixed[] status; error_message; output (what to announce in IRC chat room)
*/
private function web_undo_vote($args)
{
$nick = $args['nick'];
$vote = Vote::get_undoable_vote($nick);
$opt = Options::get_instance();
if ($vote == NULL) {
$this->fail($nick . ': Can\'t delete last vote if it is over 10 minutes old.');
}
if ($vote->deleted == 1) {
$this->fail($nick . ': Your most recent vote has already been deleted.');
}
Vote::delete($vote->id);
Track::update_vote($vote->track_id);
$out = str_ireplace('${stream_title}', $vote->stream_title, $opt->txt_unvote_response);
$out = str_ireplace('${nick}', $nick, $out);
$out = str_ireplace('${value}', $num_txt, $out);
return array('status' => 'ok', 'error_message' => '', 'output' => $out, 'private' => $opt->txt_unvote_response_switch);
}