Beispiel #1
0
// | 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'];
    }
}
abr('data', $tmp);
$p = paging("?m=" . $_GET['m'] . "&c=list&p=", "", PAGE, LIMIT, $cms->foundRows);
abr('paging', $p);
require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';
Beispiel #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>');