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'; } $items = $collectionsClass->getItems($collectionID, $start, $limit, " AND `status` = 'active' ", $order); if (is_array($items)) { require_once ROOT_PATH . '/apps/users/models/users.class.php'; $usersClass = new users(); $users = $usersClass->getAll(0, 0, $collectionsClass->usersWhere); abr('users', $users); } abr('items', $items); abr('paging', paging('/' . $languageURL . 'collections/view/' . $collectionID . '/?p=', '&sort_by=' . $_GET['sort_by'] . '&order=' . $_GET['order'], PAGE, $limit, $collectionsClass->foundRows)); #加载类别 require_once ROOT_PATH . '/apps/categories/models/categories.class.php'; $categoriesClass = new categories(); $categories = $categoriesClass->getAll(); abr('categories', $categories); #面包屑 abr('breadcrumb', '<a href="/' . $languageURL . '" title="">' . $langArray['home'] . '</a> \\ <a href="/' . $languageURL . 'collections/" title="">' . $langArray['public_collections'] . '</a> \\ <a href="/' . $languageURL . 'collections/view/' . $collection['id'] . '" title="">' . $collection['name'] . '</a>');
$pagingUrl .= '&categories[' . $c . ']=1'; } $whereQuery = " AND (" . $whereQuery . ") "; } if (isset($_GET['collection_id'])) { $_GET['collection_id'] = get_new_str($_GET['collection_id']); $_GET['collection_id'] = htmlspecialchars($_GET['collection_id']); if (!is_numeric($_GET['collection_id'])) { unset($_GET['collection_id']); } } #加载书签集作品 if (isset($_GET['collection_id']) && is_numeric($_GET['collection_id'])) { require_once ROOT_PATH . '/apps/collections/models/collections.class.php'; $collectionsClass = new collections(); $items = $collectionsClass->getItems($_GET['collection_id'], $start, $limit, " AND `status` = 'active' AND (`name` = '" . sql_quote($s) . "' OR `description` LIKE '%" . sql_quote($s) . "%') " . $whereQuery, "{$order}", true); if (is_array($items)) { $users = $usersClass->getAll(0, 0, $collectionsClass->usersWhere); abr('users', $users); } abr('results', $items); abr('paging', paging('/' . $languageURL . 'search/?type=files&term=' . $s . '&p=', $pagingUrl . '&sort_by=' . $_GET['sort_by'], PAGE, $limit, $collectionsClass->foundRows)); } else { $items = $itemsClass->getAll($start, $limit, " `status` = 'active' AND (`name` = '" . sql_quote($s) . "' OR `description` LIKE '%" . sql_quote($s) . "%') " . $whereQuery, "{$order}"); if (is_array($items)) { $users = $usersClass->getAll(0, 0, $itemsClass->usersWhere); abr('users', $users); } abr('results', $items); abr('paging', paging('/' . $languageURL . 'search/?type=files&term=' . $s . '&p=', $pagingUrl . '&sort_by=' . $_GET['sort_by'], PAGE, $limit, $itemsClass->foundRows)); }