當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Track::top_hundred_by_vote方法代碼示例

本文整理匯總了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);
 }
開發者ID:loonix,項目名稱:music-stream-vote,代碼行數:19,代碼來源:ShortCodes.php

示例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();
 }
開發者ID:loonix,項目名稱:music-stream-vote,代碼行數:18,代碼來源:History.php


注:本文中的Track::top_hundred_by_vote方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。