本文整理汇总了PHP中feed::sidebarTrending方法的典型用法代码示例。如果您正苦于以下问题:PHP feed::sidebarTrending方法的具体用法?PHP feed::sidebarTrending怎么用?PHP feed::sidebarTrending使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类feed
的用法示例。
在下文中一共展示了feed::sidebarTrending方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: PageMain
function PageMain()
{
global $TMPL, $LNG, $CONF, $db, $loggedIn, $settings;
if (isset($_SESSION['username']) && isset($_SESSION['password']) || isset($_COOKIE['username']) && isset($_COOKIE['password'])) {
$verify = $loggedIn->verify();
if (empty($verify['username'])) {
// If fake cookies are set, or they are set wrong, delete everything and redirect to home-page
$loggedIn->logOut();
header("Location: " . $CONF['url'] . "/index.php?a=welcome");
} else {
// Start displaying the Feed
$feed = new feed();
$feed->db = $db;
$feed->url = $CONF['url'];
$feed->user = $verify;
$feed->id = $verify['idu'];
$feed->username = $verify['username'];
$feed->per_page = $settings['perpage'];
$feed->time = $settings['time'];
$feed->censor = $settings['censor'];
$feed->smiles = $settings['smiles'];
$feed->c_per_page = $settings['cperpage'];
$feed->c_start = 0;
$feed->l_per_post = $settings['lperpost'];
$feed->online_time = $settings['conline'];
$feed->friends_online = $settings['ronline'];
$feed->subscriptionsList = $feed->getSubs($verify['idu'], 0);
$feed->subscribersList = $feed->getSubs($verify['idu'], 1);
$feed->updateStatus($verify['offline']);
// Useed in timeline javascript which checks for new messages
$TMPL['subs'] = 1;
$TMPL_old = $TMPL;
$TMPL = array();
$skin = new skin('shared/rows');
$rows = '';
if (empty($_GET['filter'])) {
$_GET['filter'] = '';
}
// Allowed types
list($timeline, $message) = $feed->getFeed(0, $_GET['filter']);
$TMPL['messages'] = $timeline;
$rows = $skin->make();
$skin = new skin('feed/sidebar');
$sidebar = '';
$TMPL['editprofile'] = $feed->fetchProfileWidget($verify['username'], realName($verify['username'], $verify['first_name'], $verify['last_name']), $verify['image']);
$TMPL['sidebar'] = $feed->sidebarTypes($_GET['filter'], $feed->subscriptions);
$TMPL['dates'] = $feed->sidebarDates($_GET['filter'], $feed->subscriptions);
$TMPL['trending'] = $feed->sidebarTrending($_GET['tag'], 5);
$TMPL['users'] = $feed->onlineUsers();
$TMPL['subscriptions'] = $feed->sidebarSubs(0, 0);
$TMPL['subscribers'] = $feed->sidebarSubs(1, 0);
$TMPL['friendsactivity'] = $feed->sidebarFriendsActivity(20, 1);
if (count($feed->subscriptionsList[0]) < 6) {
$TMPL['suggestions'] = $feed->sidebarSuggestions();
}
$TMPL['ad'] = generateAd($settings['ad3']);
$sidebar = $skin->make();
$skin = new skin('shared/top');
$top = '';
// $TMPL['top'] = $feed->getForm();
$TMPL['theme_url'] = $CONF['theme_url'];
$TMPL['private_message'] = $verify['privacy'];
$TMPL['avatar'] = $verify['image'];
$TMPL['url'] = $CONF['url'];
$top = $skin->make();
$TMPL = $TMPL_old;
unset($TMPL_old);
$TMPL['top'] = $top;
$TMPL['rows'] = $rows;
$TMPL['sidebar'] = $sidebar;
// If the username input string is an e-mail, switch the query
if (isset($_SESSION['username'])) {
if (filter_var($_SESSION['username'], FILTER_VALIDATE_EMAIL)) {
$result = $db->query("SELECT * FROM `users` WHERE `email` = '" . $_SESSION['username'] . "' AND `password` = '" . $_SESSION['password'] . "'");
} else {
$result = $db->query("SELECT * FROM `users` WHERE `username` = '" . $_SESSION['username'] . "' AND `password` = '" . $_SESSION['password'] . "'");
}
} elseif (isset($_COOKIE['username'])) {
if (filter_var($_COOKIE['username'], FILTER_VALIDATE_EMAIL)) {
$result = $db->query("SELECT * FROM `users` WHERE `email` = '" . $_COOKIE['username'] . "' AND `password` = '" . $_COOKIE['password'] . "'");
} else {
$result = $db->query("SELECT * FROM `users` WHERE `username` = '" . $_COOKIE['username'] . "' AND `password` = '" . $_COOKIE['password'] . "'");
}
}
while ($row = $result->fetch_assoc()) {
$status = $row['status'];
}
if ($status == 0) {
header("Location: " . $CONF['url'] . "/index.php?a=contact");
} elseif ($status == 1) {
header("Location: " . $CONF['url'] . "/index.php?a=employee");
}
}
} else {
// If the session or cookies are not set, redirect to home-page
header("Location: " . $CONF['url'] . "/index.php?a=welcome");
}
if (isset($_GET['logout']) == 1) {
$loggedIn->logOut();
header("Location: " . $CONF['url'] . "/index.php?a=welcome");
//.........这里部分代码省略.........
示例3: PageMain
function PageMain()
{
global $TMPL, $LNG, $CONF, $db, $loggedIn, $settings;
if (isset($_SESSION['username']) && isset($_SESSION['password']) || isset($_COOKIE['username']) && isset($_COOKIE['password'])) {
$verify = $loggedIn->verify();
if (empty($verify['username'])) {
// If fake cookies are set, or they are set wrong, delete everything and redirect to home-page
$loggedIn->logOut();
header("Location: " . $CONF['url'] . "/index.php?a=welcome");
} else {
// Start displaying the Feed
$feed = new feed();
$feed->db = $db;
$feed->url = $CONF['url'];
$feed->user = $verify;
$feed->id = $verify['idu'];
$feed->username = $verify['username'];
$feed->per_page = $settings['perpage'];
$feed->time = $settings['time'];
$feed->censor = $settings['censor'];
$feed->smiles = $settings['smiles'];
$feed->c_per_page = $settings['cperpage'];
$feed->c_start = 0;
$feed->l_per_post = $settings['lperpost'];
$feed->online_time = $settings['conline'];
$feed->friends_online = $settings['ronline'];
$feed->subscriptionsList = $feed->getSubs($verify['idu'], 0);
$feed->subscribersList = $feed->getSubs($verify['idu'], 1);
$feed->updateStatus($verify['offline']);
$TMPL['uid'] = $verify['idu'];
$TMPL_old = $TMPL;
$TMPL = array();
$skin = new skin('shared/rows');
$rows = '';
if (empty($_GET['filter'])) {
$_GET['filter'] = '';
}
// Allowed types
list($timeline, $message) = $feed->getTimeline(0, $_GET['filter']);
$TMPL['messages'] = $timeline;
$rows = $skin->make();
$skin = new skin('timeline/sidebar');
$sidebar = '';
$TMPL['editprofile'] = $feed->fetchProfileWidget($verify['username'], realName($verify['username'], $verify['first_name'], $verify['last_name']), $verify['image']);
$TMPL['sidebar'] = $feed->sidebarTypes($_GET['filter'], 'timeline');
$TMPL['dates'] = $feed->sidebarDates($_GET['filter'], 'timeline');
$TMPL['trending'] = $feed->sidebarTrending($_GET['tag'], 5);
$TMPL['users'] = $feed->onlineUsers();
$TMPL['subscriptions'] = $feed->sidebarSubs(0, 0);
$TMPL['subscribers'] = $feed->sidebarSubs(1, 0);
$TMPL['friendsactivity'] = $feed->sidebarFriendsActivity(20, 1);
if (count($feed->subscriptionsList[0]) < 6) {
$TMPL['suggestions'] = $feed->sidebarSuggestions();
}
$TMPL['ad'] = generateAd($settings['ad2']);
$sidebar = $skin->make();
$skin = new skin('shared/top');
$top = '';
// $TMPL['top'] = $feed->getForm();
$TMPL['theme_url'] = $CONF['theme_url'];
$TMPL['private_message'] = $verify['privacy'];
$TMPL['avatar'] = $verify['image'];
$TMPL['url'] = $CONF['url'];
$top = $skin->make();
$TMPL = $TMPL_old;
unset($TMPL_old);
$TMPL['top'] = $top;
$TMPL['rows'] = $rows;
$TMPL['sidebar'] = $sidebar;
}
} else {
// If the session or cookies are not set, redirect to home-page
header("Location: " . $CONF['url'] . "/index.php?a=welcome");
}
if (isset($_GET['logout']) == 1) {
$loggedIn->logOut();
header("Location: " . $CONF['url'] . "/index.php?a=welcome");
}
$TMPL['url'] = $CONF['url'];
$TMPL['title'] = $LNG['title_timeline'] . ' - ' . $settings['title'];
$skin = new skin('shared/timeline');
return $skin->make();
}
示例4: 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'];
if (isset($_GET['tag'])) {
$skin = new skin('shared/top');
$top = '';
$TMPL['theme_url'] = $CONF['theme_url'];
$TMPL['private_message'] = $verify['privacy'];
$TMPL['avatar'] = $verify['image'];
$TMPL['url'] = $CONF['url'];
$top = $skin->make();
}
}
}
$feed->per_page = $settings['perpage'];
$feed->time = $settings['time'];
$feed->censor = $settings['censor'];
$feed->smiles = $settings['smiles'];
$feed->c_per_page = $settings['cperpage'];
$feed->c_start = 0;
$feed->l_per_post = $settings['lperpost'];
$TMPL_old = $TMPL;
$TMPL = array();
$skin = new skin('shared/rows');
$rows = '';
if (empty($_GET['filter'])) {
$_GET['filter'] = '';
}
// Allowed types
if (isset($_GET['tag'])) {
// If the $_GET keyword is empty [hashtag]
if ($_GET['tag'] == '') {
header("Location: " . $CONF['url'] . "/index.php?a=welcome");
}
$hashtags = $feed->getHashtags(0, $settings['qperpage'], $_GET['tag'], null);
$TMPL['messages'] = $hashtags[0];
} else {
// If the $_GET keyword is empty [user]
if ($_GET['q'] == '') {
header("Location: " . $CONF['url'] . "/index.php?a=welcome");
}
$TMPL['messages'] = $feed->getSearch(0, $settings['qperpage'], $_GET['q'], $_GET['filter']);
}
$rows = $skin->make();
$skin = new skin('search/sidebar');
$sidebar = '';
if (isset($_GET['tag'])) {
$TMPL['trending'] = $feed->sidebarTrending($_GET['tag'], 10);
} else {
$TMPL['genre'] = $feed->sidebarGender($_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'];
if (isset($_GET['tag'])) {
$TMPL['title'] = '#' . $_GET['tag'] . ' - ' . $settings['title'];
} else {
$TMPL['title'] = $LNG['title_search'] . ' - ' . $_GET['q'] . ' - ' . $settings['title'];
}
$skin = new skin('shared/timeline_x');
return $skin->make();
}