示例#1
0
文件: list.php 项目: yunsite/demila
<?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__);
$cms = new qnews();
if (isset($_GET['up']) || isset($_GET['down'])) {
    $cms->tableName = 'qnews';
    $cms->idColumn = 'id';
    if (isset($_GET['up']) && is_numeric($_GET['up'])) {
        $cms->moveUp($_GET['up']);
    } elseif (isset($_GET['down']) && is_numeric($_GET['down'])) {
        $cms->moveDown($_GET['down']);
    }
}
require_once ENGINE_PATH . '/classes/image.class.php';
$imageClass = new Image();
$data = $cms->getAll(START, LIMIT);
$tmp = array();
if ($data) {
    foreach ($data as $key => $d) {
        $tmp[$key] = $d;
        $tmp[$key]['thumb'] = '/static/uploads/qnews/192x64/' . $d['photo'];
    }
示例#2
0
    $referals = $buff;
    unset($buff);
}
abr('referals', $referals);
abr('earnings', $earnings);
abr('earningArr', $earningArr);
if (is_array($earningArr)) {
    $maxSales = 0;
    foreach ($earningArr as $e) {
        foreach ($e as $r) {
            if ($r > $maxSales) {
                $maxSales = $r;
            }
        }
    }
    $earningIndex = $maxSales > 0 ? 300 / floatval($maxSales) : 0;
    abr('earningIndex', $earningIndex);
}
//推荐
require_once ROOT_PATH . '/apps/qnews/models/qnews.class.php';
$qnews = new qnews();
$data = array();
foreach ($qnews->getAll(0, 1, "`visible` = 'true'") as $key => $value) {
    if ($value['photo']) {
        $data[$key] = $value;
        $data[$key]['thumb'] = 'static/uploads/qnews/260x140/' . $value['photo'];
    }
}
abr('qnews_data', $data);
#面包屑
abr('breadcrumb', '<a href="/' . $languageURL . '" title="">' . $langArray['home'] . '</a> \\ <a href="/' . $languageURL . 'users/dashboard/" title="">' . $langArray['my_account'] . '</a>');
示例#3
0
文件: delete.php 项目: yunsite/demila
<?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']['countries'])) {
    require_once ROOT_PATH . "/apps/qnews/models/qnews.class.php";
    $cms = new qnews();
    $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;
示例#4
0
文件: edit.php 项目: yunsite/demila
<?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(ROOT_PATH . "/apps/" . $_GET['m'] . "/admin/add.php");
_setTitle($langArray['edit'] . ' ' . @$langArray['qnews']);
if (!isset($_GET['fid']) || !is_numeric($_GET['fid'])) {
    refresh('?m=' . $_GET['m'] . '&c=list&id=' . $_GET['id'], 'INVALID ID', 'error');
}
$cms = new qnews();
if (isset($_POST['edit'])) {
    $status = $cms->edit($_GET['fid']);
    if ($status !== true) {
        abr('error', $status);
    } else {
        refresh("?m=" . $_GET['m'] . "&c=list", $langArray['edit_complete']);
    }
} else {
    $_POST = $cms->get($_GET['fid']);
    $_POST['thumb'] = '/static/uploads/qnews/192x64/' . $_POST['photo'];
}
require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';
示例#5
0
文件: add.php 项目: yunsite/demila
<?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['add'] . ' ' . @$langArray['qnews']);
$cms = new qnews();
if (isset($_POST['add'])) {
    $status = $cms->add();
    if ($status !== true) {
        abr('error', $status);
    } else {
        refresh("?m=" . $_GET['m'] . "&c=list", $langArray['add_complete']);
    }
} else {
    $_POST['visible'] = 'true';
}
require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';