本文整理匯總了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);
}