本文整理汇总了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();
}