forked from lincanbin/Carbon-Forum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
favorites.php
25 lines (25 loc) · 988 Bytes
/
favorites.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
require(dirname(__FILE__) . '/common.php');
require(dirname(__FILE__) . '/language/' . ForumLanguage . '/favorites.php');
Auth(1);
$Page = Request('Get', 'page');
$TotalPage = ceil($CurUserInfo['NumFavTopics'] / $Config['TopicsPerPage']);
if ($Page < 0 || $Page == 1) {
header('location: ' . $Config['WebsitePath'] . '/favorites');
exit;
}
if ($Page > $TotalPage) {
header('location: ' . $Config['WebsitePath'] . '/favorites/page/' . $TotalPage);
exit;
}
if ($Page == 0)
$Page = 1;
if ($Page <= 10)
$TopicsArray = $DB->query('SELECT * FROM ' . $Prefix . 'favorites force index(UsersFavorites) Where UserID=? and Type=1 ORDER BY DateCreated DESC LIMIT ' . ($Page - 1) * $Config['TopicsPerPage'] . ',' . $Config['TopicsPerPage'], array(
$CurUserID
));
$DB->CloseConnection();
$PageTitle = $Lang['My_Favorites'];
$PageTitle .= $Page > 1 ? ' Page' . $Page : '';
$ContentFile = $TemplatePath . 'favorites.php';
include($TemplatePath . 'layout.php');