本文整理汇总了PHP中feed::sidebarStatistics方法的典型用法代码示例。如果您正苦于以下问题:PHP feed::sidebarStatistics方法的具体用法?PHP feed::sidebarStatistics怎么用?PHP feed::sidebarStatistics使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类feed
的用法示例。
在下文中一共展示了feed::sidebarStatistics方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PageMain
//.........这里部分代码省略.........
$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"';
} else {
$TMPL['don'] = ' selected="selected"';
}
if ($TMPL['public'] == 0) {
$TMPL['poff'] = ' selected="selected"';
} else {
$TMPL['pon'] = ' selected="selected"';
}
if ($TMPL['license'] == 0) {
$TMPL['ar'] = 'checked';
} else {
$TMPL['cc'] = 'checked';
$license = str_split($TMPL['license']);
$TMPL['nc'] = $license[1];
$TMPL['nd_sa'] = $license[2];
}
$TMPL['display'] = 'none';
$TMPL['btntext'] = $LNG['save'];
} else {
$skin = new skin('track/rows');
$rows = '';
// If the track id is not set, or it doesn't consist from digits
if (!isset($_GET['id']) || !ctype_digit($_GET['id'])) {
header("Location: " . $CONF['url']);
}
$TMPL['messages'] = $track[0];
// If the output is empty redirect to home-page
if (empty($TMPL['messages'])) {
header("Location: " . $CONF['url']);
}
}
$rows = $skin->make();
$skin = new skin('track/sidebar');
$sidebar = '';
$TMPL['ad'] = generateAd($settings['ad5']);
// If the track can be viewed
if (!$track[1]) {
$TMPL['edit'] = $feed->sidebarButton($_GET['id'], 1);
if (isset($_GET['type']) && $_GET['type'] !== 'edit') {
unset($TMPL['edit']);
}
if ($_GET['type'] == 'stats') {
$TMPL['statistics'] = $feed->sidebarStatsFilters($_GET['filter']);
} else {
$TMPL['statistics'] = $feed->sidebarStatistics($_GET['id'], 1, $trackInfo[1]);
}
$TMPL['description'] = $feed->sidebarDescription($_GET['id'], 0);
$TMPL['tags'] = $feed->sidebarKeywords($_GET['id'], 0);
$TMPL['report'] = $feed->sidebarReport($_GET['id']);
}
$sidebar = $skin->make();
$TMPL = $TMPL_old;
unset($TMPL_old);
$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'];
$title = strip_tags(trim($title[2][0]));
$TMPL['title'] = ($_GET['type'] == 'report' || $_GET['type'] == 'stats' || $_GET['type'] == 'likes' || $_GET['type'] == 'edit' ? $LNG["{$_GET['type']}"] . ' - ' : '') . $title . ' - ' . $settings['title'];
$TMPL['meta_description'] = $title . ' ' . $feed->sidebarDescription($_GET['id'], 0, 1);
$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 {
$feed = new feed();
$feed->db = $db;
$feed->url = $CONF['url'];
$feed->user = $verify;
$feed->id = $verify['idu'];
$feed->username = $verify['username'];
$feed->time = $settings['time'];
$feed->updateStatus($verify['offline']);
$TMPL_old = $TMPL;
$TMPL = array();
$skin = new skin('track/edit');
$rows = '';
$TMPL['url'] = $CONF['url'];
$TMPL['page_title'] = $LNG['upload'];
$TMPL['form_url'] = $CONF['url'] . '/requests/post_track.php';
$feed->art_size = $settings['artsize'];
$feed->art_format = $settings['artformat'];
$feed->paypalapp = $settings['paypalapp'];
$feed->track_size_total = $feed->getProStatus($feed->id, 1) ? $settings['protracktotal'] : $settings['tracksizetotal'];
$feed->track_size = $feed->getProStatus($feed->id, 1) ? $settings['protracksize'] : $settings['tracksize'];
$feed->track_format = $settings['trackformat'];
$TMPL['art'] = 'default.png';
$date = explode('-', $TMPL['release']);
$TMPL['years'] = generateDateForm(0, $date[0]);
$TMPL['months'] = generateDateForm(1, $date[1]);
$TMPL['days'] = generateDateForm(2, $date[2]);
// Se the download to off by default
$TMPL['doff'] = ' selected="selected"';
// Set the visiblity to public by default
$TMPL['pon'] = ' selected="selected"';
if ($TMPL['license'] == 0) {
$TMPL['ar'] = 'checked';
} else {
$TMPL['cc'] = 'checked';
$license = str_split($TMPL['license']);
$TMPL['nc'] = $license[1];
$TMPL['nd_sa'] = $license[2];
}
$TMPL['display'] = 'inhert';
$TMPL['onclick'] = 'startUpload()';
$TMPL['btntext'] = $LNG['upload'];
$rows = $skin->make();
$skin = new skin('upload/sidebar');
$sidebar = '';
$TMPL['statistics'] = $feed->sidebarStatistics(null, 2);
$TMPL['go_pro'] = $feed->goProMessage(1, 1);
$sidebar = $skin->make();
$TMPL = $TMPL_old;
unset($TMPL_old);
$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['upload'] . ' - ' . $settings['title'];
$skin = new skin('upload/content');
return $skin->make();
}
示例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->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'];
$feed->online_time = $settings['conline'];
$feed->friends_online = $settings['ronline'];
$feed->subscriptionsList = $feed->getSubs($verify['idu'], 0);
$feed->trackList = implode(',', $feed->getTrackList(!empty($feed->profile_id) ? $feed->profile_id : $feed->id));
$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->stream(0, $_GET['filter']);
$TMPL['messages'] = $timeline;
$rows = $skin->make();
$skin = new skin('stream/sidebar');
$sidebar = '';
$TMPL['upload'] = $feed->sidebarButton();
$TMPL['go_pro'] = $feed->goProMessage(null, 1, 1);
$TMPL['statistics'] = $feed->sidebarStatistics(null, 0);
$TMPL['users'] = $feed->onlineUsers();
$TMPL['friendsactivity'] = $feed->sidebarFriendsActivity(5, 1);
if (count($feed->subscriptionsList[0]) < 3) {
$TMPL['suggestions'] = $feed->sidebarSuggestions();
}
$TMPL['ad'] = generateAd($settings['ad3']);
$sidebar = $skin->make();
$TMPL = $TMPL_old;
unset($TMPL_old);
$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'];
$date = explode('-', wordwrap($_GET['filter'], 4, '-', true));
$month = intval($date[1]);
$TMPL['title'] = $LNG['stream'] . (!empty($_GET['filter']) ? ' - ' . $LNG["month_{$month}"] . ' ' . $date[0] . ' - ' : ' - ') . $settings['title'];
// $TMPL['header'] = pageHeader($LNG['stream']);
$skin = new skin('shared/content');
return $skin->make();
}