本文整理匯總了PHP中Track::top_hundred_by_vote方法的典型用法代碼示例。如果您正苦於以下問題:PHP Track::top_hundred_by_vote方法的具體用法?PHP Track::top_hundred_by_vote怎麽用?PHP Track::top_hundred_by_vote使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Track
的用法示例。
在下文中一共展示了Track::top_hundred_by_vote方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: top_hundred
/**
* Top 100 tracks by vote
* @param string[] $atts
* @return string
*/
public function top_hundred($atts)
{
$top = Track::top_hundred_by_vote();
$out = array();
$out[] = "<p>";
$n = 1;
$out = array();
foreach ($top as $result) {
$out[] = "<b>#{$n}</b> " . esc_html($result['stream_title']) . " (score: " . $result['vote_total'] . ")<br />\n";
$n++;
}
$out[] = "</p>\n";
return implode($out);
}
示例2: q_top_hundred
private function q_top_hundred()
{
$v = $this->view;
$start_time = trim($v['start_date'] . ' ' . $v['start_time']);
$end_time = trim($v['end_date'] . ' ' . $v['end_time']);
$title = trim($start_time . ' – ' . $end_time);
$results = Track::top_hundred_by_vote($start_time, $end_time);
$votes = array();
foreach ($results as $result) {
$result['artist_link'] = '<a href="' . $this->link_url(array('music_query' => 'track', 'artist' => $result['artist'])) . '">' . esc_html($result['artist']) . '</a>';
$result['title_link'] = '<a href="' . $this->link_url(array('music_query' => 'track', 'artist' => $result['artist'], 'title' => $result['title'])) . '">' . esc_html($result['title']) . '</a>';
$votes[] = $result;
}
$cols = array('artist_link' => 'Artist', 'title_link' => 'Title', 'vote_total' => 'Vote Total');
ob_start();
include PLUGIN_DIR . 'views/results_top_hundred.php';
return ob_get_clean();
}