Exemplo n.º 1
0
    $collection['rate'] = $collectionsClass->isRate($collectionID);
}
abr('collection', $collection);
#删除作品
if (isset($_GET['delete']) && check_login_bool() && $collection['user_id'] == $_SESSION['user']['user_id']) {
    $collectionsClass->deleteBookmark($collectionID, $_GET['delete']);
    refresh('/' . $languageURL . 'collections/view/' . $collectionID, $langArray['complete_delete_bookmark'], 'complete');
}
#更新书签集
if (check_login_bool() && isset($_POST['edit']) && $collection['user_id'] == $_SESSION['user']['user_id']) {
    $collectionsClass->edit($collectionID);
    refresh('/' . $languageURL . 'collections/view/' . $collectionID, $langArray['complete_edit_collection'], 'complete');
}
#删除书签集
if (check_login_bool() && isset($_POST['delete']) && $collection['user_id'] == $_SESSION['user']['user_id']) {
    $collectionsClass->delete($collectionID);
    refresh('/' . $languageURL . 'user/bookmarks/', $langArray['complete_delete_collection'], 'complete');
}
#加载书签集作品
$limit = 20;
$start = (PAGE - 1) * $limit;
$order = '';
if (!isset($_GET['sort_by'])) {
    $_GET['sort_by'] = '';
}
switch ($_GET['sort_by']) {
    case 'name':
        $order = '`name`';
        break;
    case 'average_rating':
        $order = '`rating`';
Exemplo n.º 2
0
<?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
// +----------------------------------------------------------------------
define('USING_LANGUAGE', false);
require_once '../../../config.php';
require_once $config['root_path'] . '/core/functions.php';
include_once $config['system_core'] . "/initEngine.php";
admin_login();
if (isset($_POST['delete']) && isset($_POST['id']) && isset($_SESSION['user']['access']['collections'])) {
    require_once ROOT_PATH . "/apps/collections/models/collections.class.php";
    $cms = new collections();
    $cms->delete(intval($_POST['id']));
    die(json_encode(array_merge($_POST, array('status' => 'true'))));
}
echo json_encode(array_merge($_POST, array('status' => 'unknown error')));
die;