本文整理汇总了PHP中feed::getLikes方法的典型用法代码示例。如果您正苦于以下问题:PHP feed::getLikes方法的具体用法?PHP feed::getLikes怎么用?PHP feed::getLikes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类feed
的用法示例。
在下文中一共展示了feed::getLikes方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PageMain
function PageMain()
{
global $TMPL, $LNG, $CONF, $db, $loggedIn, $settings;
$_GET['u'] = htmlspecialchars($_GET['u']);
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");
}
// If the $_GET user is empty, define default user as current logged in user, else redirect to home-page
if ($_GET['u'] == '') {
$_GET['u'] = !empty($verify['username']) ? $verify['username'] : header("Location: " . $CONF['url'] . "/index.php?a=welcome");
}
}
// 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->categories = $feed->getCategories();
$feed->time = $settings['time'];
$feed->c_per_page = $settings['cperpage'];
$feed->c_start = 0;
$feed->l_per_post = $settings['lperpost'];
if ($verify['username']) {
$feed->updateStatus($verify['offline']);
}
// If the $_GET user is empty, define default user as current logged in user, else redirect to home-pag
if ($_GET['u'] == '') {
$_GET['u'] = !empty($feed->username) ? $feed->username : header("Location: " . $CONF['url'] . "/index.php?a=welcome");
}
$feed->profile = $_GET['u'];
$feed->profile_data = $feed->profileData($_GET['u']);
$feed->subscriptionsList = $feed->getSubs($feed->profile_data['idu'], 0, null);
$feed->subscribersList = $feed->getSubs($feed->profile_data['idu'], 1, null);
$TMPL_old = $TMPL;
$TMPL = array();
$skin = new skin('shared/rows');
$rows = '';
if (empty($_GET['filter'])) {
$_GET['filter'] = '';
}
// Allowed types
list($timeline, $message) = $feed->getProfile(0, $_GET['filter']);
if ($_GET['r'] == 'subscriptions') {
if ($message !== 1) {
$feed->s_per_page = $settings['sperpage'];
$feed->subsList = $feed->getSubs($feed->profile_data['idu'], 0, 0);
$TMPL['messages'] = $feed->listSubs(0);
} else {
$TMPL['messages'] = $timeline;
}
$title = $LNG['subscriptions'];
} elseif ($_GET['r'] == 'subscribers') {
if ($message !== 1) {
$feed->s_per_page = $settings['sperpage'];
$feed->subsList = $feed->getSubs($feed->profile_data['idu'], 1, 0);
$TMPL['messages'] = $feed->listSubs(1);
} else {
$TMPL['messages'] = $timeline;
}
$title = $LNG['subscribers'];
} elseif ($_GET['r'] == 'likes') {
if ($message !== 1) {
$likes = $feed->getLikes(0, 1);
$TMPL['messages'] = $likes[0];
} else {
$TMPL['messages'] = $timeline;
}
$title = $LNG['likes'];
} elseif ($_GET['r'] == 'playlists') {
if ($message !== 1) {
$TMPL['messages'] = $feed->getPlaylists(0, 1);
} else {
$TMPL['messages'] = $timeline;
}
$title = $LNG['playlists'];
} else {
$TMPL['messages'] = $timeline;
}
$rows = $skin->make();
$skin = new skin('profile/sidebar');
$sidebar = '';
// If the username doesn't exist
if ($message !== 1) {
$TMPL['about'] = $feed->fetchProfileInfo($feed->profileData($_GET['u']));
$TMPL['dates'] = $feed->sidebarDates($_GET['filter'], 'profile');
$TMPL['ad'] = generateAd($settings['ad4']);
} else {
$skin = new skin('profile/sidebar');
$sidebar = '';
$TMPL['ad'] = generateAd($settings['ad4']);
}
$sidebar = $skin->make();
$TMPL = $TMPL_old;
//.........这里部分代码省略.........
示例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();
}
// 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->categories = $feed->getCategories();
$feed->time = $settings['time'];
$feed->c_per_page = $settings['cperpage'];
$feed->c_start = 0;
$feed->l_per_post = $settings['lperpost'];
$feed->paypalapp = $settings['paypalapp'];
if (isset($_SESSION['usernameAdmin']) && isset($_SESSION['passwordAdmin'])) {
$loggedInAdmin = new loggedInAdmin();
$loggedInAdmin->db = $db;
$loggedInAdmin->url = $CONF['url'];
$loggedInAdmin->username = $_SESSION['usernameAdmin'];
$loggedInAdmin->password = $_SESSION['passwordAdmin'];
$loggedIn = $loggedInAdmin->verify();
if ($loggedIn['username']) {
// Set admin level
$feed->is_admin = 1;
}
}
$TMPL_old = $TMPL;
$TMPL = array();
// Get the track
$track = $feed->getTrack($_GET['id']);
$trackInfo = $feed->getTrackInfo($_GET['id'], 0);
// Verify the track owner for certain pages
if (!$trackInfo[1] && ($_GET['type'] == 'stats' || $_GET['type'] == 'edit')) {
header("Location: " . $CONF['url']);
}
// Match the content from the song-title class in order to set it for the title tag
preg_match_all('/<div.*(class="song-title").*>([\\d\\D]*)<\\/div>/iU', $track[0], $title);
if (empty($title[2][0])) {
preg_match_all('/<div.*(class="page-header").*>([\\d\\D]*)<\\/div>/iU', $track[0], $title);
}
$TMPL['id'] = $_GET['id'];
$TMPL['url'] = $CONF['url'];
$TMPL['title'] = strip_tags($title[2][0]);
$TMPL['url_title'] = $trackInfo[0];
// If the user can view the track, and the report is set
if (!$track[1] && $_GET['type'] == 'report') {
if (!$feed->id) {
header("Location: " . $CONF['url']);
}
$skin = new skin('track/report');
$rows = '';
if (isset($_POST['copyright'])) {
$TMPL['message'] = $feed->report($_GET['id'], 1);
}
} elseif (!$track[1] && $_GET['type'] == 'stats') {
$skin = new skin('track/stats');
$rows = '';
$stats = $feed->getTrackStats($_GET['id'], $_GET['filter'], 0);
$most = $feed->getTrackStats($_GET['id'], $_GET['filter'], 1, 10);
$TMPL['plays'] = $stats['plays'];
$TMPL['likes'] = $stats['likes'];
$TMPL['comments'] = $stats['comments'];
$TMPL['downloads'] = $stats['downloads'];
$TMPL['played_most'] = $most['played'];
$TMPL['downloaded_most'] = $most['downloaded'];
$TMPL['top_countries'] = $most['countries'];
$TMPL['top_cities'] = $most['cities'];
$TMPL['go_pro'] = $most['gopro'];
} elseif (!$track[1] && $_GET['type'] == 'likes') {
$skin = new skin('track/likes');
$rows = '';
$feed->per_page = $settings['qperpage'];
$TMPL['likes'] = $feed->getLikes(0, 2, $_GET['id']);
} elseif (!$track[1] && $_GET['type'] == 'edit') {
$skin = new skin('track/edit');
$rows = '';
$TMPL['page_title'] = $LNG['edit'] . ' -';
$TMPL['form_url'] = $CONF['url'] . '/index.php?a=track&id=' . $_GET['id'] . '&type=edit';
$feed->art_size = $settings['artsize'];
$feed->art_format = $settings['artformat'];
if (!empty($_POST['save'])) {
$update = $feed->updateTrack($_POST, 0);
$TMPL['message'] = $update;
}
$currentTrack = $feed->getTrackInfo($_GET['id'], 1);
foreach ($currentTrack as $key => $info) {
$TMPL[$key] = $info;
}
$date = explode('-', $TMPL['release']);
$TMPL['years'] = generateDateForm(0, $date[0]);
$TMPL['months'] = generateDateForm(1, $date[1]);
$TMPL['days'] = generateDateForm(2, $date[2]);
if ($TMPL['download'] == 0) {
$TMPL['doff'] = ' selected="selected"';
//.........这里部分代码省略.........
示例3: feed
$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->username = $verify['username'];
$feed->id = $verify['idu'];
}
$feed->per_page = $settings['perpage'];
$feed->c_per_page = $settings['cperpage'];
$feed->time = $settings['time'];
$feed->c_start = 0;
$feed->profile = $_POST['profile'];
$feed->profile_data = $feed->profileData($_POST['profile']);
$feed->s_per_page = $settings['sperpage'];
$feed->l_per_post = $settings['lperpost'];
if ($_POST['type'] == 1) {
$feed->categories = $feed->getCategories();
$likes = $feed->getLikes($_POST['start'], 1);
$getLikes = $likes[0];
} else {
$getLikes = $feed->getLikes($_POST['start'], 2, $_POST['query']);
}
echo $getLikes;
}
示例4: feed
$settings = $resultSettings->fetch_assoc();
// The theme complete url
$CONF['theme_url'] = $CONF['theme_path'] . '/' . $settings['theme'];
if (isset($_POST['start']) && ctype_digit($_POST['start'])) {
$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->username = $verify['username'];
$feed->id = $verify['idu'];
}
$feed->per_page = $settings['perpage'];
$feed->censor = $settings['censor'];
$feed->smiles = $settings['smiles'];
$feed->c_per_page = $settings['cperpage'];
$feed->time = $settings['time'];
$feed->c_start = 0;
$feed->profile = $_POST['profile'];
$feed->profile_data = $feed->profileData($_POST['profile']);
$feed->s_per_page = $settings['sperpage'];
$feed->l_per_post = $settings['lperpost'];
$getLikes = $feed->getLikes($_POST['start'], 1);
echo $getLikes;
}