本文整理汇总了PHP中feed::searchTracks方法的典型用法代码示例。如果您正苦于以下问题:PHP feed::searchTracks方法的具体用法?PHP feed::searchTracks怎么用?PHP feed::searchTracks使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类feed
的用法示例。
在下文中一共展示了feed::searchTracks方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PageMain
function PageMain()
{
global $TMPL, $LNG, $CONF, $db, $loggedIn, $settings;
$feed = new feed();
$feed->db = $db;
$feed->url = $CONF['url'];
if (isset($_SESSION['username']) && isset($_SESSION['password']) || isset($_COOKIE['username']) && isset($_COOKIE['password'])) {
$verify = $loggedIn->verify();
if ($verify['username']) {
$feed->user = $verify;
$feed->username = $verify['username'];
$feed->id = $verify['idu'];
}
}
$feed->per_page = $settings['qperpage'];
$feed->categories = $feed->getCategories();
$feed->time = $settings['time'];
$feed->l_per_post = $settings['lperpost'];
$TMPL_old = $TMPL;
$TMPL = array();
$skin = new skin('shared/rows');
$rows = '';
// If the $_GET keyword is empty [user]
if ($_GET['q'] == '') {
header("Location: " . $CONF['url'] . "/index.php?a=welcome");
}
if ($_GET['filter'] == 'tracks') {
list($tracks, $error) = $feed->searchTracks(0, $_GET['q']);
$TMPL['messages'] = $tracks;
} elseif ($_GET['filter'] == 'playlists') {
$playlist = $feed->getPlaylists(0, 2, $_GET['q']);
$error = $feed->showError('no_results', 1);
$TMPL['messages'] = empty($playlist) ? $error[0] : $playlist;
} else {
$TMPL['messages'] = $feed->getSearch(0, $settings['qperpage'], $_GET['q'], $_GET['filter']);
}
$rows = $skin->make();
$skin = new skin('search/sidebar');
$sidebar = '';
$TMPL['trending'] = $feed->sidebarTrending($_GET['tag'], 10);
$TMPL['filters'] = $feed->sidebarFilters($_GET['filter'], $_GET['q']);
$TMPL['ad'] = generateAd($settings['ad6']);
$sidebar = $skin->make();
$TMPL = $TMPL_old;
unset($TMPL_old);
$TMPL['top'] = $top;
$TMPL['rows'] = $rows;
$TMPL['sidebar'] = $sidebar;
if (isset($_GET['logout']) == 1) {
$loggedIn->logOut();
header("Location: " . $CONF['url'] . "/index.php?a=welcome");
}
$TMPL['url'] = $CONF['url'];
$TMPL['title'] = $LNG['search'] . ' - ' . htmlspecialchars($_GET['q']) . ' - ' . $settings['title'];
$TMPL['header'] = pageHeader($LNG['search'] . ' - ' . $_GET['q']);
$skin = new skin('shared/content');
return $skin->make();
}
示例2: feed
if ($db->connect_errno) {
echo "Failed to connect to MySQL: (" . $db->connect_errno . ") " . $db->connect_error;
}
$db->set_charset("utf8");
$resultSettings = $db->query(getSettings());
$settings = $resultSettings->fetch_assoc();
// The theme complete url
$CONF['theme_url'] = $CONF['theme_path'] . '/' . $settings['theme'];
if (!empty($_POST['start']) && !empty($_POST['q'])) {
$feed = new feed();
$feed->db = $db;
$feed->url = $CONF['url'];
if (isset($_SESSION['username']) && isset($_SESSION['password']) || isset($_COOKIE['username']) && isset($_COOKIE['password'])) {
$loggedIn = new loggedIn();
$loggedIn->db = $db;
$loggedIn->url = $CONF['url'];
$loggedIn->username = isset($_SESSION['username']) ? $_SESSION['username'] : $_COOKIE['username'];
$loggedIn->password = isset($_SESSION['password']) ? $_SESSION['password'] : $_COOKIE['password'];
$verify = $loggedIn->verify();
$feed->user = $verify;
$feed->id = $verify['idu'];
$feed->username = $verify['username'];
}
$feed->per_page = $settings['qperpage'];
$feed->categories = $feed->getCategories();
$feed->l_per_post = $settings['lperpost'];
$feed->profile = $_POST['profile'];
$feed->profile_data = $feed->profileData($_POST['profile']);
$messages = $feed->searchTracks($_POST['start'], $_POST['q']);
echo $messages[0];
}