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


PHP Track::search方法代碼示例

本文整理匯總了PHP中Track::search方法的典型用法代碼示例。如果您正苦於以下問題:PHP Track::search方法的具體用法?PHP Track::search怎麽用?PHP Track::search使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Track的用法示例。


在下文中一共展示了Track::search方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: q_track

 private function q_track()
 {
     $v = $this->view;
     $track_id = Track::get_id($v['artist'] . ' -  ' . $v['title']);
     if ($track_id) {
         $results = Vote::get_votes_by_track_id($track_id);
         $votes = array();
         foreach ($results as $result) {
             $result['nick_link'] = '<a href="' . $this->link_url(array('music_query' => 'nick', 'nick' => $result['nick'])) . '">' . esc_html($result['nick']) . '</a>';
             $votes[] = $result;
         }
         $cols = array('time_utc' => 'Time (UTC)', 'nick_link' => 'Nick', 'value' => 'Vote Value');
         $t = Track::get($track_id);
         //$stream_title = (Track::get( $track_id ))->stream_title;
         $stream_title = $t->stream_title;
         ob_start();
         include PLUGIN_DIR . 'views/results_votes_for_track.php';
         return ob_get_clean();
     } else {
         $results = Track::search($v['artist'], $v['title']);
         $tracks = 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>';
             $tracks[] = $result;
         }
         $cols = array('artist_link' => 'Artist', 'title_link' => 'Title', 'play_count' => 'Play Count', 'vote_count' => 'Vote Count', 'vote_total' => 'Vote Total');
         $title = array();
         if ($v['artist']) {
             $title[] = 'Artist "' . $v['artist'] . '"';
         }
         if ($v['title']) {
             $title[] = 'Title "' . $v['title'] . '"';
         }
         $title = implode(', ', $title);
         ob_start();
         include PLUGIN_DIR . 'views/results_track_search.php';
         return ob_get_clean();
     }
 }
開發者ID:loonix,項目名稱:music-stream-vote,代碼行數:40,代碼來源:History.php


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