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