$_GET['sort_by'] = ''; } switch ($_GET['sort_by']) { case 'name': $order = '`name`'; break; case 'average_rating': $order = '`rating`'; break; default: $order = '`datetime`'; break; } if (!isset($_GET['order']) || $_GET['order'] == '' || $_GET['order'] == 'desc') { $_GET['order'] = 'desc'; $order .= ' DESC'; } else { $_GET['order'] = 'asc'; $order .= ' ASC'; } $collections = $collectionsClass->getAll(START, LIMIT, " `public` = 'true' ", false, $order); if (is_array($collections)) { require_once ROOT_PATH . '/apps/users/models/users.class.php'; $usersClass = new users(); $users = $usersClass->getAll(0, 0, $collectionsClass->usersWhere); abr('users', $users); } abr('collections', $collections); abr('paging', paging('/' . $languageURL . 'collections/?p=', '&sort_by=' . $_GET['sort_by'] . '&order=' . $_GET['order'], PAGE, $limit, $collectionsClass->foundRows)); #面包屑 abr('breadcrumb', '<a href="/' . $languageURL . '" title="">' . $langArray['home'] . '</a> \\ <a href="/' . $languageURL . 'collections/" title="">' . $langArray['public_collections'] . '</a>');
<?php // +---------------------------------------------------------------------- // | Demila [ Beautiful Digital Content Trading System ] // +---------------------------------------------------------------------- // | Copyright (c) 2015 http://demila.org All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- // | Email author@demila.org // +---------------------------------------------------------------------- _setView(__FILE__); _setTitle($langArray['list']); $cms = new collections(); $data = $cms->getAll(START, LIMIT); if (is_array($data)) { require_once ROOT_PATH . '/apps/users/models/users.class.php'; $usersClass = new users(); $users = $usersClass->getAll(0, 0, $cms->usersWhere); abr('users', $users); } abr('data', $data); $p = paging("?m=" . $_GET['m'] . "&c=list&p=", "", PAGE, LIMIT, $cms->foundRows); abr('paging', $p); require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';
$_GET['sort_by'] = ''; } else { $_GET['sort_by'] = htmlspecialchars($_GET['sort_by']); } switch ($_GET['sort_by']) { case 'name': $order = '`name`'; break; case 'average_rating': $order = '`rating`'; break; default: $order = '`datetime`'; break; } $collections = $collectionsClass->getAll($start, $limit, " `public` = 'true' AND (`name` = '" . sql_quote($s) . "' OR `text` LIKE '%" . sql_quote($s) . "%') ", false, "{$order} ASC"); if (is_array($collections)) { $users = $usersClass->getAll(0, 0, $collectionsClass->usersWhere); abr('users', $users); } abr('results', $collections); abr('paging', paging('/' . $languageURL . 'search/?type=collections&term=' . $s . '&p=', '&sort_by=' . $_GET['sort_by'], PAGE, $limit, $collectionsClass->foundRows)); break; #在书签集中结束搜索 #在书签集中结束搜索 default: abr('type', 'files'); require_once ROOT_PATH . '/apps/items/models/items.class.php'; $itemsClass = new items(); if (!isset($_GET['sort_by'])) { $_GET['sort_by'] = '';
<?php // +---------------------------------------------------------------------- // | Demila [ Beautiful Digital Content Trading System ] // +---------------------------------------------------------------------- // | Copyright (c) 2015 http://demila.org All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- // | Email author@demila.org // +---------------------------------------------------------------------- require_once ROOT_PATH . '/apps/collections/models/collections.class.php'; $collectionsClass = new collections(); if (check_login_bool() && isset($_POST['add_collection'])) { $s = $collectionsClass->bookmark($itemID); if ($s === true) { refresh('/' . $languageURL . 'items/' . $itemID, $langArray['complete_bookmark_item'], 'complete'); } else { addErrorMessage($s, '还没有创建书签集', 'error'); } } if (check_login_bool()) { $collections = $collectionsClass->getAll(0, 0, " `user_id` = '" . intval($_SESSION['user']['user_id']) . "' "); abr('bookCollections', $collections); }
if (isset($_POST)) { if ($users['is_follow']) { $text = $langArray['follow']; } else { $text = $langArray['unfollow']; } die(' jQuery("#follow").html("' . $text . '"); '); } refresh('/' . $languageURL . 'user/' . $users['username']); } #加载公开书签集 require_once ROOT_PATH . '/apps/collections/models/collections.class.php'; $collectionsClass = new collections(); $collections = $collectionsClass->getAll(0, 2, " `public` = 'true' AND `user_id` = '" . intval($users['user_id']) . "' "); abr('collections', $collections); #获取推荐文件 if ($users['featured_item_id'] != '0') { require_once ROOT_PATH . '/apps/items/models/items.class.php'; $itemsClass = new items(); $featureItem = $itemsClass->get($users['featured_item_id'], true); abr('featureItem', $featureItem); } #获取粉丝 $follow['to'] = $usersClass->getFollowers($users['user_id'], 0, 9, 'RAND()', true); $follow['to_count'] = $usersClass->foundRows; $follow['from'] = $usersClass->getFollowers($users['user_id'], 0, 9, 'RAND()'); $follow['from_count'] = $usersClass->foundRows; abr('follow', $follow); $follow['toto'] = $usersClass->getFollowers($users['user_id'], 0, 10000000, 'RAND()', true);