Exemple #1
1
<?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__);
$itemID = get_id(2);
$itemsClass = new items();
$item = $itemsClass->get($itemID);
if (!is_array($item) || check_login_bool() && $item['status'] == 'unapproved' && $item['user_id'] != $_SESSION['user']['user_id'] || $item['status'] == 'queue' || $item['status'] == 'extended_buy') {
    header("HTTP/1.0 404 Not Found");
    header("Location: http://" . DOMAIN . "/" . $languageURL . "error");
}
abr('item', $item);
Exemple #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
// +----------------------------------------------------------------------
require_once 'init.php';
//define ( 'LIMIT', 50 );
//加载管理员模板
if (!isset($_GET['m']) && !isset($_GET['c'])) {
    require_once ROOT_PATH . '/apps/admin/index.php';
}
$_templateFile = ROOT_PATH . 'templates/admin/' . $meta["admin_template"] . '/admin/index.html';
abr('content_template', $_templateFile);
require_once 'system/checkInstalledModules.php';
Exemple #3
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
// +----------------------------------------------------------------------
_setView(__FILE__);
_setTitle($langArray['add']);
$cms = new system();
if (isset($_POST['add'])) {
    $status = $cms->add();
    if ($status !== true) {
        abr('error', $status);
    } else {
        refresh("?m=" . $_GET['m'] . "&c=list", $langArray['add_complete']);
    }
}
require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';
Exemple #4
0
// +----------------------------------------------------------------------
// | 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']);
$cms = new categories();
if (!isset($_GET['sub_of']) || !is_numeric($_GET['sub_of'])) {
    $_GET['sub_of'] = 0;
}
if (isset($_POST['add'])) {
    $status = $cms->add();
    if ($status !== true) {
        abr('error', $status);
    } else {
        refresh("?m=" . $_GET['m'] . "&c=list&sub_of=" . $_GET['sub_of'], $langArray['add_complete']);
    }
} else {
    $_POST['visible'] = 'true';
}
if ($_GET['sub_of'] != 0) {
    $pdata = $cms->get($_GET['sub_of']);
    abr('pdata', $pdata);
}
require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';
Exemple #5
0
            if ($v['photo'] && file_exists(DATA_SERVER_PATH . "/uploads/badges/" . $v['photo'])) {
                $user_badges[] = array('name' => $v['name'], 'photo' => '/uploads/badges/' . $v['photo']);
            }
            break;
        }
    }
}
if (isset($badges_data['other']) && is_array($badges_data['other'])) {
    foreach ($badges_data['other'] as $k => $b) {
        if (in_array($k, $other_badges) && $b['photo'] && file_exists(DATA_SERVER_PATH . "/uploads/badges/" . $b['photo'])) {
            $user_badges[] = array('name' => $b['name'], 'photo' => '/uploads/badges/' . $b['photo']);
        }
    }
}
if (isset($user['country']['photo']) && $user['country']['photo'] && file_exists(DATA_SERVER_PATH . "/uploads/countries/" . $user['country']['photo'])) {
    $user_badges[] = array('name' => $user['country']['name'], 'photo' => '/uploads/countries/' . $user['country']['photo']);
} elseif (isset($badges_data['system']['location_global_community']) && $badges_data['system']['location_global_community']['photo'] && file_exists(DATA_SERVER_PATH . "/uploads/badges/" . $badges_data['system']['location_global_community']['photo'])) {
    $user_badges[] = array('name' => $badges_data['system']['location_global_community']['name'], 'photo' => '/uploads/badges/' . $badges_data['system']['location_global_community']['photo']);
}
if ($user['power_elite_author'] == 'true' && isset($badges_data['system']['power_elite_author'])) {
    if ($badges_data['system']['power_elite_author']['photo'] && file_exists(DATA_SERVER_PATH . "/uploads/badges/" . $badges_data['system']['has_been_featured']['photo'])) {
        $user_badges[] = array('name' => $badges_data['system']['power_elite_author']['name'], 'photo' => '/uploads/badges/' . $badges_data['system']['power_elite_author']['photo']);
    }
}
if ($user['elite_author'] == 'true' && isset($badges_data['system']['elite_author'])) {
    if ($badges_data['system']['elite_author']['photo'] && file_exists(DATA_SERVER_PATH . "/uploads/badges/" . $badges_data['system']['has_been_featured']['photo'])) {
        $user_badges[] = array('name' => $badges_data['system']['elite_author']['name'], 'photo' => '/uploads/badges/' . $badges_data['system']['elite_author']['photo']);
    }
}
abr('user_badges', $user_badges);
Exemple #6
0
// +----------------------------------------------------------------------
// | Email author@demila.org
// +----------------------------------------------------------------------
_setView(ROOT_PATH . "/apps/" . $_GET['m'] . "/admin/add.php");
_setTitle($langArray['edit']);
if (!isset($_GET['id']) || !is_numeric($_GET['id'])) {
    refresh('?m=' . $_GET['m'] . '&c=list', 'INVALID ID', 'error');
}
if (!isset($_GET['p'])) {
    $_GET['p'] = '';
}
$cms = new categories();
if (isset($_POST['edit'])) {
    $status = $cms->edit($_GET['id']);
    if ($status !== true) {
        abr('error', $status);
    } else {
        refresh("?m=" . $_GET['m'] . "&c=list&p=" . $_GET['p'], $langArray['edit_complete']);
    }
} else {
    $_POST = $cms->get($_GET['id']);
}
#加载主类别
$mysql->query("\n\t\tSELECT *\n\t\tFROM `categories`\n\t\tWHERE `sub_of` = '0'\n\t\tORDER BY `order_index` ASC\n\t", __FUNCTION__);
if ($mysql->num_rows() > 0) {
    while ($d = $mysql->fetch_array()) {
        $categories[$d['id']] = $d;
    }
    abr('categories', $categories);
}
require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';
Exemple #7
0
        $usersClass->editExclusiveAuthor('false', $_GET['id']);
    } elseif (isset($_POST['exclusive_true'])) {
        $usersClass = new users();
        $usersClass->editExclusiveAuthor('true', $_GET['id']);
    }
    $_POST = $cms->get($_GET['id']);
    $badges = explode(',', $_POST['badges']);
    $_POST['badges'] = array();
    foreach ($badges as $badge) {
        $_POST['badges'][] = $badge;
    }
}
$users = $cms->get($_GET['id']);
$users['stats'] = $cms->getStatistic($_GET['id']);
abr('user', $users);
require_once ROOT_PATH . '/apps/' . $_GET['m'] . '/models/groups.class.php';
$g = new groups();
$groups = $g->getAll();
abr('groups', $groups);
require_once ROOT_PATH . '/apps/system/models/badges.class.php';
$badges = new badges();
$badges_data = $badges->getAll(0, 0, "`type` = 'other'");
abr('badges', $badges_data);
if (isset($_POST['badges'])) {
    if (!is_array($_POST['badges'])) {
        $_POST['badges'] = explode(',', $_POST['badges']);
    }
} else {
    $_POST['badges'] = array();
}
require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';
Exemple #8
0
            die('0');
        }
    }
    #用户注册操作
    if (isset($_POST['add'])) {
        require_once ROOT_PATH . '/apps/system/models/system.class.php';
        $cms = new system();
        $data = $cms->getAll(0, 0, null, "send_mail");
        if ($data[0]["value"] == 0) {
            $_POST['status'] = 'activate';
        }
        $usersClass = new users();
        $s = $usersClass->add();
        if ($s === true) {
            if ($data[0]["value"] == 0) {
                refresh('/' . $languageURL . 'sign_in/');
            }
            refresh('/' . $languageURL . 'sign_up/verify/');
        } else {
            $message = '<ul>';
            foreach ($s as $e) {
                $message .= '<li>' . $e . '</li>';
            }
            $message .= '</ul>';
            addErrorMessage($message, '', 'error');
        }
    }
}
#面包屑
abr('breadcrumb', '<a href="/' . $languageURL . '" title="">' . $langArray['home'] . '</a> \\ <a href="/' . $languageURL . 'users/registration/" title="">' . $langArray['sign_up'] . '</a>');
Exemple #9
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
// +----------------------------------------------------------------------
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);
}
Exemple #10
0
    $depositClass = new deposit();
    $info = $depositClass->get($depositID);
    if ($info && $info['paid'] == 'true') {
        refresh('http://' . $config['domain'] . '/' . $languageURL . 'deposit/', $langArray['complete_deposit'], 'complete');
    } else {
        refresh('http://' . $config['domain'] . '/' . $languageURL . 'deposit/', $langArray['error_deposit'], 'error');
    }
}
if (isset($_POST['amount'])) {
    $depositClass = new deposit();
    $depositID = $depositClass->add();
    if ($depositID !== FALSE) {
        if (isset($_SESSION['tmp']['order_id'])) {
            unset($_SESSION['tmp']['order_id']);
        }
        $_SESSION['tmp']['deposit_id'] = $depositID;
        refresh('/' . $languageURL . 'users/payment/');
    }
}
#面包屑
abr('breadcrumb', '<a href="/' . $languageURL . '" title="">' . $langArray['home'] . '</a> \\ <a href="/' . $languageURL . 'users/deposit/" title="">' . $langArray['deposit'] . '</a>');
$discount = array();
if ($meta['prepaid_price_discount']) {
    if (strpos($meta['prepaid_price_discount'], '%')) {
        $discount = $meta['prepaid_price_discount'];
    } else {
        $discount = $currency['symbol'] . $meta['prepaid_price_discount'];
    }
}
abr('right_discount', $discount);
Exemple #11
0
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Email author@demila.org
// +----------------------------------------------------------------------
_setView(__FILE__);
$itemID = get_id(2);
$itemsClass = new items();
$item = $itemsClass->get($itemID);
if (!is_array($item) || check_login_bool() && $item['status'] == 'unapproved' && $item['user_id'] != $_SESSION['user']['user_id'] || $item['status'] == 'queue' || $item['status'] == 'extended_buy') {
    die;
}
abr('item', $item);
if (!isset($_GET['index']) || !is_numeric($_GET['index'])) {
    $_GET['index'] = 0;
}
$files = scandir(DATA_SERVER_PATH . '/uploads/items/' . $itemID . '/preview/');
$previewFiles = array();
if (is_array($files)) {
    foreach ($files as $f) {
        if (file_exists(DATA_SERVER_PATH . '/uploads/items/' . $itemID . '/preview/' . $f)) {
            $fileInfo = pathinfo(DATA_SERVER_PATH . '/uploads/items/' . $itemID . '/preview/' . $f);
            if (isset($fileInfo['extension']) && (strtolower($fileInfo['extension']) == 'jpg' || strtolower($fileInfo['extension']) == 'png')) {
                $previewFiles[] = $f;
            }
        }
    }
}
if (isset($previewFiles[$_GET['index']])) {
    abr('previewFile', $previewFiles[$_GET['index']]);
}
Exemple #12
0
            $data[$date] = array();
        }
    }
    if (is_array($data)) {
        foreach ($data as $k => $v) {
            if (isset($reportData[$k])) {
                $data[$k]['total'] = $reportData[$k]['total'];
                $data[$k]['receive'] = $reportData[$k]['receive'];
                $data[$k]['referal'] = $reportData[$k]['referal'];
                $data[$k]['win'] = $reportData[$k]['win'];
            } else {
                $data[$k]['total'] = 0;
                $data[$k]['receive'] = 0;
                $data[$k]['referal'] = 0;
                $data[$k]['win'] = 0;
            }
            if (isset($depositData[$k])) {
                $data[$k]['deposit'] = $depositData[$k]['deposit'];
            } else {
                $data[$k]['deposit'] = 0;
            }
            if (isset($withdrawData[$k])) {
                $data[$k]['withdraw'] = $withdrawData[$k]['amount'];
            } else {
                $data[$k]['withdraw'] = 0;
            }
        }
    }
    abr('reportData', $data);
}
require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';
Exemple #13
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
// +----------------------------------------------------------------------
_setView(__FILE__);
_setTitle($langArray['sendmail']);
$system = new system();
$smtp = $system->is_smtp();
$is_smtp = false;
if ($smtp) {
    $is_smtp = true;
}
abr('is_smtp', $is_smtp);
require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';
Exemple #14
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
// +----------------------------------------------------------------------
_setView(__FILE__);
_setTitle($langArray['free_file']);
$usersClass = new users();
$limit = 60;
$start = (PAGE - 1) * $limit;
abr('number', $start + 1);
//$users = $usersClass->getAll($start, $limit, " `items` > 0 AND `status` = 'activate' ", "`sales` DESC");
//免费作品
$freeItem = $itemsClass->getAll($start, $limit, " `status` = 'active' AND `free_file` = 'true' ");
abr('freeItem', $freeItem);
abr('paging', paging('/' . $languageURL . 'free_file/?p=', '', PAGE, $limit, $itemsClass->foundRows));
#面包屑
abr('breadcrumb', '<a href="/' . $languageURL . '" title="">' . $langArray['home'] . '</a> \\ <a href="/' . $languageURL . 'users/free_file/" title="">' . $langArray['free_file'] . '</a>');
Exemple #15
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
// +----------------------------------------------------------------------
//用户数量
require_once ROOT_PATH . '/apps/users/models/users.class.php';
$usersClass = new users();
abr('usersCount', $usersClass->getUsersCount(" `status` = 'activate' "));
//作品数量
require_once ROOT_PATH . '/apps/items/models/items.class.php';
$itemsClass = new items();
abr('itemsCount', $itemsClass->getItemsCount());
$admin_config = array('show' => true, 'add' => true, 'list' => true, 'edit' => false);
Exemple #16
0
_setView(__FILE__);
_setTitle($langArray['language']);
$cms = new system();
$buff = scandir(ROOT_PATH . '/lang/');
$languages = array();
if (is_array($buff)) {
    foreach ($buff as $f) {
        if (is_file(ROOT_PATH . '/lang/' . $f)) {
            $f = basename($f, '.php');
            $languages[$f] = $f;
        }
    }
}
abr('languages', $languages);
$filename = ROOT_PATH . '/config/current.txt';
if (is_file($filename)) {
    $handle = fopen($filename, "r");
    $currentLanguage = fread($handle, filesize($filename));
    abr('currentLanguage', $currentLanguage);
    fclose($handle);
}
if (isset($_POST['save']) && isset($_POST['lang'])) {
    if (is_file(ROOT_PATH . '/lang/' . $_POST['lang'] . '.php')) {
        copy(ROOT_PATH . '/lang/' . $_POST['lang'] . '.php', ROOT_PATH . '/config/lang.php');
        $handle = fopen($filename, 'w');
        fwrite($handle, $_POST['lang']);
        fclose($handle);
        refresh('?m=' . $_GET['m'] . '&c=' . $_GET['c'], $langArray['complete_change_language'], 'complete');
    }
}
require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';
Exemple #17
0
// +----------------------------------------------------------------------
// | Email author@demila.org
// +----------------------------------------------------------------------
if (!isset($_GET['type']) || !in_array($_GET['type'], array('other', 'buyers', 'authors', 'referrals', 'system'))) {
    refresh('?m=' . $_GET['m'] . '&c=badges&type=system', 'INVALID TYPE', 'error');
}
_setView(__FILE__);
_setTitle($langArray['add'] . ' ' . $langArray['badges'] . ' › ' . ucfirst($_GET['type']));
$is_from_to = false;
if (in_array($_GET['type'], array('buyers', 'authors', 'referrals'))) {
    $is_from_to = true;
}
abr('is_from_to', $is_from_to);
require_once ROOT_PATH . '/apps/system/models/badges.class.php';
$badges = new badges();
if (isset($_POST['add'])) {
    $status = $badges->add();
    if ($status !== true) {
        abr('error', $status);
    } else {
        refresh("?m=" . $_GET['m'] . "&c=badges&type=" . $_GET['type'], $langArray['add_complete']);
    }
} else {
    $_POST['visible'] = 'true';
}
$types_system = array();
if ($_GET['type'] == 'system') {
    $types_system = array('location_global_community' => $langArray['location_global_community'], 'has_free_file_month' => $langArray['has_free_file_month'], 'has_been_featured' => $langArray['has_been_featured'], 'power_elite_author' => $langArray['power_elite_author'], 'elite_author' => $langArray['elite_author'], 'has_had_item_featured' => $langArray['has_had_item_featured'], 'is_exclusive_author' => $langArray['is_exclusive_author']);
}
abr('types_system', $types_system);
require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';
Exemple #18
0
// +----------------------------------------------------------------------
// | Email author@demila.org
// +----------------------------------------------------------------------
_setView(__FILE__);
$orderID = 0;
if (isset($_SESSION['tmp']['order_id'])) {
    $orderID = (int) $_SESSION['tmp']['order_id'];
}
require_once ROOT_PATH . '/apps/items/models/orders.class.php';
$cms = new orders();
$order_info = $cms->get($orderID);
if ($order_info) {
    $payments = glob(dirname(dirname(dirname(__FILE__))) . '/payments/controllers/*.php');
    $payments_data = array();
    if ($payments) {
        $order_obj = array();
        $key = 'chinabank';
        require_once ROOT_PATH . '/apps/payments/models/' . $key . '.class.php';
        $order_obj[$key] = new $key();
        $payments_data[$key] = array('title' => '网银在线', 'description' => '网银在线订单支付', 'form' => $order_obj[$key]->generateForm($order_info), 'logo' => '');
        if ($payments_data) {
            abr('payments_data', $payments_data);
        } else {
            addErrorMessage($langArray['no_payment_methods'], '', 'error');
        }
    } else {
        addErrorMessage($langArray['no_payment_methods'], '', 'error');
    }
} else {
    addErrorMessage($langArray['order_is_expired'], '', 'error');
}
Exemple #19
0
}
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>');
Exemple #20
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
// +----------------------------------------------------------------------
_setView(__FILE__);
require_once ROOT_PATH . '/apps/users/models/users.class.php';
$usersClass = new users();
$users = $usersClass->getAll(0, 0, $itemsClass->usersWhere);
abr('users', $users);
$itemsClass = new items();
$limit = 4;
$start = (PAGE - 1) * $limit;
$text = '';
$items = $itemsClass->getAll($start, $limit, " `status` = 'active' AND `weekly_to` >= '" . date('Y-m-d') . "' ", "`datetime` DESC");
$categories = $categoriesClass->getAll();
if (PAGE > 1) {
    $text .= '<a href="javascript: void(0);" onclick="$.ajax({complete: function(request) { screenshotPreview(); hideLoading(); }, beforeSend: function() { showLoading(); }, dataType: &quot;script&quot;, type: &quot;post&quot;, url: &quot;/' . $languageURL . 'items/weekly/?p=' . (PAGE - 1) . '&quot;}); return false;" title="" class="slider-control slider-prev"></a>';
} else {
    $text .= '<span class="slider-control slider-prev-disabled"></span>';
}
$backslash = chr();
if (is_array($items)) {
    $text .= '<ul id="weekly-featured-items">';
    foreach ($items as $i) {
Exemple #21
0
    $user_badges[] = array('name' => $badges_data['system']['location_global_community']['name'], 'photo' => '/uploads/badges/' . $badges_data['system']['location_global_community']['photo']);
}
if ($user['power_elite_author'] == 'true' && isset($badges_data['system']['power_elite_author'])) {
    if ($badges_data['system']['power_elite_author']['photo'] && file_exists(DATA_SERVER_PATH . "/uploads/badges/" . $badges_data['system']['has_been_featured']['photo'])) {
        $user_badges[] = array('name' => $badges_data['system']['power_elite_author']['name'], 'photo' => '/uploads/badges/' . $badges_data['system']['power_elite_author']['photo']);
    }
}
if ($user['elite_author'] == 'true' && isset($badges_data['system']['elite_author'])) {
    if ($badges_data['system']['elite_author']['photo'] && file_exists(DATA_SERVER_PATH . "/uploads/badges/" . $badges_data['system']['has_been_featured']['photo'])) {
        $user_badges[] = array('name' => $badges_data['system']['elite_author']['name'], 'photo' => '/uploads/badges/' . $badges_data['system']['elite_author']['photo']);
    }
}
#获取粉丝
$follow['to'] = $usersClass->getFollowers($user['user_id'], 0, 9, 'RAND()', true);
$follow['to_count'] = $usersClass->foundRows;
$follow['from'] = $usersClass->getFollowers($user['user_id'], 0, 9, 'RAND()');
$follow['from_count'] = $usersClass->foundRows;
abr('follow', $follow);
$follow['toto'] = $usersClass->getFollowers($user['user_id'], 0, 10000000, 'RAND()', true);
$follow['toto_count'] = $usersClass->foundRows;
$follow['fromfrom'] = $usersClass->getFollowers($user['user_id'], 0, 10000000, 'RAND()');
$follow['fromfrom_count'] = $usersClass->foundRows;
abr('follow', $follow);
abr('user_badges', $user_badges);
abr('meta', $meta);
#FAQ
require_once ROOT_PATH . '/apps/items/models/faq.class.php';
$faqClass = new faq();
$faqs = $faqClass->CountAll($itemID);
abr('faqs', $faqs);
Exemple #22
0
        $_SESSION['temp']['referal'] = $_GET['ref'];
    }
    #加载页面至菜单
    require_once ROOT_PATH . '/apps/pages/models/pages.class.php';
    $pagesClass = new pages();
    $menuPages = $pagesClass->getAll(0, 0, " `visible` = 'true' AND `menu` = 'true' ", true);
    abr('menuPages', $menuPages);
    $footerPages = $pagesClass->getAll(0, 0, " `visible` = 'true' AND `footer` = 'true' ", true);
    abr('footerPages', $footerPages);
    #加载主分类
    require_once ROOT_PATH . '/apps/categories/models/categories.class.php';
    $categoriesClass = new categories();
    $mainCategories = $categoriesClass->getAll(0, 0, " `visible` = 'true' AND `sub_of` = '0' ");
    $allCats = $categoriesClass->getAllWithChilds(0, '`visible` = \'true\'');
    abr('mainCategories', $allCats[0]);
    unset($allCats[0]);
    abr('allCats', $allCats);
    //abr('mainCategories', $mainCategories);
    #加载计数器
    require_once ROOT_PATH . '/apps/items/models/items.class.php';
    $itemsClass = new items();
    abr('itemsCount', $itemsClass->getItemsCount());
    require_once ROOT_PATH . '/apps/users/models/users.class.php';
    $usersClass = new users();
    abr('usersCount', $usersClass->getUsersCount(" `status` = 'activate' "));
    #更新用户数据
    if (check_login_bool()) {
        $_SESSION['user'] = $usersClass->get($_SESSION['user']['user_id']);
    }
}
include_once $config['system_core'] . "/endEngine.php";
Exemple #23
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
// +----------------------------------------------------------------------
_setView(__FILE__);
_setTitle($langArray['template']);
$arr = getDirList(ROOT_PATH . "/templates/admin");
abr("templates", $arr);
$template = $meta["admin_template"];
abr("template", $template);
require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';
Exemple #24
0
        $s = $itemsClass->add();
        if ($s === true) {
            refresh('/' . $languageURL . 'author_dashboard/', $langArray['complete_upload_item'], 'complete');
        } else {
            $message = '<ul>';
            foreach ($s as $e) {
                $message .= '<li>' . $e . '</li>';
            }
            $message .= '</ul>';
            addErrorMessage($message, '', 'error');
        }
    }
    $fileTypes = '';
    foreach ($config['upload_ext'] as $ext) {
        if ($fileTypes != '') {
            $fileTypes .= ';';
        }
        $fileTypes .= '*.' . $ext;
    }
    abr('fileTypes', $fileTypes);
    abr('sessID', session_id());
}
//获取所有推荐标签
require_once ROOT_PATH . '/apps/tags/models/tags.class.php';
$tagsClass = new tags();
$tags_all = $tagsClass->getAll();
$all_tags = json_encode($tags_all);
abr('all_tags', $all_tags);
#面包屑
abr('breadcrumb', '<a href="/' . $languageURL . '" title="">' . $langArray['home'] . '</a> \\ <a href="/' . $languageURL . 'upload/form/?category=' . $_GET['category'] . '" title="">' . $langArray['upload_theme'] . '</a>');
Exemple #25
0
$categoriesClass = new ccategories();
$categories = $categoriesClass->getAll(0, 0, " `visible` = 'true'");
abr('categories', $categories);
#发送联系支持请求
if (isset($_POST['action'])) {
    //验证码验证
    if (isset($_POST['verify'])) {
        if (empty($_POST['verify'])) {
            addErrorMessage($langArray['error_verify_invalid_empty'], '', 'error');
        }
        require_once ROOT_PATH . '/classes/Verify.class.php';
        $verify = new Verify();
        $yz_verify = $verify->check($_POST['verify'], 1);
        if (!$yz_verify) {
            addErrorMessage($langArray['error_invalid_verify'], '', 'error');
        } else {
            $contactsClass = new contacts();
            $s = $contactsClass->add();
            if ($s === true) {
                refresh('/' . $languageURL . 'support/', $langArray['complete_send_email'], 'complete');
            } else {
                addErrorMessage($langArray['error_all_fields_required'], '', 'error');
            }
        }
    } else {
        addErrorMessage($langArray['error_verify_invalid_empty'], '', 'error');
    }
}
#面包屑
abr('breadcrumb', '<a href="/' . $languageURL . '" title="">' . $langArray['home'] . '</a> \\ <a href="/' . $languageURL . 'contacts/" title="">' . $langArray['contacts'] . '</a>');
Exemple #26
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
// +----------------------------------------------------------------------
_setView(__FILE__);
_setTitle($langArray['view']);
if (!isset($_GET['id']) || !is_numeric($_GET['id'])) {
    refresh('?m=' . $_GET['m'] . '&c=list', 'WRONG ID', 'error');
}
require_once ROOT_PATH . "/apps/bulletin/models/bulletin.class.php";
$cms = new bulletin();
$data = $cms->get($_GET['id']);
if ($data['send_to'] == 'city') {
    $cities = loadCities();
    $data['send_city'] = $cities[$data['send_id']]['name'];
} elseif ($data['send_to'] == 'group') {
    $bulletinGroupsClass = new bulletinGroups();
    $bGroup = $bulletinGroupsClass->get($data['send_id']);
    $data['send_group'] = $bGroup['name'];
}
abr('data', $data);
require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';
Exemple #27
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
// +----------------------------------------------------------------------
_setView(__FILE__);
_setTitle($langArray['withdraws']);
$cms = new deposit();
$data = $cms->getWithdraws(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=withdraws&p=", "", PAGE, LIMIT, $cms->foundRows);
abr('paging', $p);
require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';
Exemple #28
0
            $mimeTypes = array('zip' => 'application/zip');
            if (isset($mimeTypes[$fileInfo['extension']])) {
                header('Content-Type: ' . $mimeTypes[$fileInfo['extension']]);
            } else {
                header('Content-Type: application/octet-stream');
            }
            header('Content-Disposition: attachment; filename="' . $item['main_file_name'] . '"');
            header("Content-Length:" . filesize(DATA_SERVER_PATH . '/uploads/items/' . $item['id'] . '/' . $item['main_file']));
            header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
            header('Pragma: public');
            header("Content-Transfer-Encoding: binary");
            header('Expires: 0');
            header('Content-Description: ' . $config['domain'] . ' Download');
            @ob_clean();
            @flush();
            readfile(DATA_SERVER_PATH . '/uploads/items/' . $item['id'] . '/' . $item['main_file']) or die("ERROR!");
            die;
        }
    } else {
        header("HTTP/1.0 404 Not Found");
        header("Location: http://" . DOMAIN . "/" . $languageURL . "error");
    }
}
#加载作品
$items = $ordersClass->getAllBuyed(" `user_id` = '" . intval($_SESSION['user']['user_id']) . "' AND `paid` = 'true' ");
abr('items', $items);
$ratedItems = $itemsClass->getRates(str_replace('`id`', '`item_id`', $ordersClass->whereQuery));
abr('ratedItems', $ratedItems);
#面包屑
abr('breadcrumb', '<a href="/' . $languageURL . '" title="">' . $langArray['home'] . '</a> \\ <a href="/' . $languageURL . 'users/dashboard/" title="">' . $langArray['my_account'] . '</a> \\ <a href="/' . $languageURL . 'users/downloads/" title="">' . $langArray['downloads'] . '</a>');
Exemple #29
0
// +----------------------------------------------------------------------
// | 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['payments'] . ' › ' . ucfirst($_GET['c']));
$payments = scandir(dirname(dirname(__FILE__)) . '/controllers/');
if (!in_array($_GET['c'] . '.php', $payments)) {
    refresh("/" . $languageURL . adminURL . "/?m=" . $_GET['m'] . "&c=list");
}
$key = $_GET['c'];
$form = isset($_POST['form']) ? $_POST['form'] : array();
if (isset($_POST['edit'])) {
    $cms = new system();
    $cms->editGroup($key, $form);
    refresh("?m=" . $_GET['m'] . "&c=list", $langArray['edit_complete']);
}
abr('pay_info', $meta);
abr('group', $key);
//DEMILAappkey
if (isset($form[$key . '_key'])) {
    abr('v_key', $form[$key . '_key']);
} else {
    abr('v_key', isset($meta[$key . '_key']) ? $meta[$key . '_key'] : '');
}
require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';
Exemple #30
0
$startMonthlyDate2 = date('Y-m-d', mktime(0, 0, 0, $month, 1, date('Y')));
abr('month', $month);
#获取作品
$ordersClass = new orders();
require_once ROOT_PATH . '/apps/users/models/users.class.php';
$usersClass = new users();
$users = $usersClass->getAll(0, 0, $itemsClass->usersWhere);
abr('users', $users);
$topSellItems = $ordersClass->getTopSellers(0, 50, " AND `paid_datetime` > '{$startDate} 23:59:59' AND `paid_datetime` < '{$endDate} 23:59:59' ");
if (is_array($topSellItems)) {
    $users = $usersClass->getAll(0, 0, $ordersClass->usersWhere);
    abr('users', $users);
}
abr('topSellItems', $topSellItems);
$topMonthlyItems = $ordersClass->getTopSellers(0, 50, " AND `paid_datetime` > '{$startMonthlyDate} 00:00:00' AND `paid_datetime` < '{$endMonthlyDate} 23:59:59' ");
if (is_array($topMonthlyItems)) {
    $users2 = $usersClass->getAll(0, 0, $ordersClass->usersWhere);
    abr('users2', $users2);
}
abr('topMonthlyItems', $topMonthlyItems);
#加载分类
require_once ROOT_PATH . '/apps/categories/models/categories.class.php';
$categoriesClass = new categories();
$categories = $categoriesClass->getAll();
abr('categories', $categories);
#王牌作者
$topAuthors = $ordersClass->getTopAuthors(0, 20, " AND `paid_datetime` > '{$startMonthlyDate2} 00:00:00' AND `paid_datetime` < '{$endMonthlyDate2} 23:59:59' ");
abr('topAuthors', $topAuthors);
#面包屑
abr('breadcrumb', '<a href="/' . $languageURL . '" title="">' . $langArray['home'] . '</a> \\ <a href="/' . $languageURL . 'items/top_sellers/" title="">' . $langArray['popular_files'] . '</a>');