$faqClass = new faq(); if (check_login_bool() && $item['user_id'] == $_SESSION['user']['user_id'] && isset($_GET['del']) && is_numeric($_GET['del'])) { $faqClass->delete($_GET['del'], $itemID); refresh('/' . $languageURL . 'items/faq/' . $itemID . '/', $langArray['complete_delete_faq'], 'complete'); } #加载FAQ $faq = $faqClass->getAll($itemID); abr('faq', $faq); #标签标记作品 require_once ROOT_PATH . '/apps/items/controllers/bookmark.php'; #是否免费文件 if ($item['free_file'] == 'true') { abr('freeFileMessage', langMessageReplace($langArray['free_file_info'], array('URL' => '/' . $languageURL . 'users/downloads/' . $item['id']))); } #加载其它作品 $otherItems = $itemsClass->getAll(0, 6, " `status` = 'active' AND `id` <> '" . intval($itemID) . "' AND `user_id` = '" . intval($item['user_id']) . "' ", "RAND()"); abr('otherItems', $otherItems); if (!is_array($otherItems)) { abr('otherItemsCount', 0); } else { abr('otherItemsCount', count($otherItems)); } #加载属性 require_once ROOT_PATH . '/apps/attributes/models/attributes.class.php'; $attributesClass = new attributes(); $attributes = $attributesClass->getAll(0, 0, $itemsClass->attributesWhere); abr('attributes', $attributes); $attributeCategories = $attributesClass->getAllCategories(0, 0, $itemsClass->attributeCategoriesWhere); abr('attributeCategories', $attributeCategories); #加载分类 require_once ROOT_PATH . '/apps/categories/models/categories.class.php';
$name = $category['name']; $link = '?category=' . $_GET['category']; } if (isset($_GET['user'])) { $whereQuery .= " AND `user_id` = '" . intval($_GET['user']) . "' "; require_once ROOT_PATH . '/apps/users/models/users.class.php'; $usersClass = new users(); $user = $usersClass->get($_GET['user']); $name = $user['username']; if ($link == '') { $link = '?user='******'user']; } else { $link .= '&user='******'user']; } } echo "<?phpxml version=\"1.0\" encoding=\"utf-8\" ?>\n<rss version=\"2.0\">\n<channel>\n<title>" . $config['domain'] . " - " . $name . " RSS</title>\n<link>http://" . $config['domain'] . "/rss/" . $link . "</link>\n<description></description>\n"; #####加载 require_once ROOT_PATH . '/apps/items/models/items.class.php'; $itemsClass = new items(); $rows = $itemsClass->getAll(0, 20, " `status` = 'active' " . $whereQuery, "`datetime` DESC"); if (is_array($rows)) { foreach ($rows as $r) { echo "\n\t\t\t\t<item>\n\t\t\t\t\t<title><![CDATA[ " . $r['name'] . " ]]></title>\n\t\t\t\t\t<link>http://" . $config['domain'] . "/" . $languageURL . "items/" . $r['id'] . "</link>\n\t\t\t\t\t<description><![CDATA[\n\t\t\t"; if ($r['thumbnail'] != '') { echo "<a href=\"http://" . $config['domain'] . "/" . $languageURL . "items/" . $r['id'] . "\"><img src=\"" . $config['data_server'] . "/uploads/items/" . $r['id'] . "/" . $r['thumbnail'] . "\" alt=\"\" border=\"0\" style=\"float:left; margin:0 10px 0 0;\" /></a>"; } echo "<br />" . mb_substr(strip_tags($r['description']), 0, 200) . ""; echo "]]></description>\n\t\t <guid>http://" . $config['domain'] . "/" . $languageURL . "items/" . $r['id'] . "</guid>\t\t \n\t\t </item>\n\t\t\t"; } } echo "\n</channel>\n</rss>\n";
// | 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: "script", type: "post", url: "/' . $languageURL . 'items/weekly/?p=' . (PAGE - 1) . '"}); 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) { $a_kat = $i['categories']; $s_nazwy_kat = ""; foreach ($a_kat as $a_k) { foreach ($a_k as $kat_id) { $s_nazwy_kat .= $categories[$kat_id]['name'] . " \\ ";
break; case 'cost': $order = '`price`'; 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 = $itemsClass->getAll($start, $limit, " `user_id` = '" . intval($user['user_id']) . "' " . $whereQuery, $order); abr('items', $items); abr('paging', paging('/' . $languageURL . 'user/portfolio/' . $username . '/?p=', '&sort_by=' . $_GET['sort_by'] . '&order=' . $_GET['order'], PAGE, $limit, $itemsClass->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 . 'users/' . $user['username'] . '" title="">' . $user['username'] . '</a> \\ <a href="/' . $languageURL . 'users/' . $user['username'] . '/portfolio" title="">' . $langArray['portfolio'] . '</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'];
default: $orderQuery = "`datetime`"; } switch ($_GET['dir']) { case 'desc': $orderQuery .= " DESC"; abr('orderDir', 'asc'); break; default: $orderQuery .= " ASC"; abr('orderDir', 'desc'); } if (isset($_POST['user'])) { $_GET['user'] = $_POST['user']; } if (!isset($_GET['user'])) { $_GET['user'] = ''; } if (is_numeric($_GET['user'])) { $whereQuery .= " AND `user_id` = '" . intval($_GET['user']) . "' "; } $data = $cms->getAll(START, LIMIT, " `status` = 'active' " . $whereQuery, $orderQuery); abr('data', $data); $p = paging("?m=" . $_GET['m'] . "&c=list&p=", "&q=" . $_GET['q'] . "&order=" . $_GET['order'] . "&dir=" . $_GET['dir'] . "&user=" . $_GET['user'], PAGE, LIMIT, $cms->foundRows); abr('paging', $p); #加载用户 require_once ROOT_PATH . '/apps/users/models/users.class.php'; $usersClass = new users(); $users = $usersClass->getAll(0, 0, '', '`username` ASC'); abr('users', $users); require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';
} 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); #加载用户作品 require_once ROOT_PATH . '/apps/items/models/items.class.php'; $itemsClass = new items(); $items = $itemsClass->getAll(0, 0, " `status` = 'active' AND `user_id` = '" . intval($_SESSION['user']['user_id']) . "' "); abr('items', $items); #更改密码 if (isset($_POST['change_password'])) { $usersClass = new users(); $s = $usersClass->editNewPassword(); if ($s === true) { refresh('/' . $languageURL . 'edit/', $langArray['complete_change_password'], 'complete'); } else { $message = '<ul>'; foreach ($s as $e) { $message .= '<li>' . $e . '</li>'; } $message .= '</ul>'; addErrorMessage($message, '', 'error'); }
<?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/items/models/items.class.php'; $items = new items(); $queue = $items->getAll(0, 0, " `status` = 'queue' "); $queueCount = 0; if ($queue) { $queueCount = count($queue); } abr('queueCount', $queueCount); //更新队列审核 $update = $items->getAllForUpdate(); $updateCount = 0; if ($update) { $updateCount = count($update); } abr('updateCount', $updateCount); //提现队列审核 require_once ROOT_PATH . '/apps/users/models/deposit.class.php'; $deposit = new deposit(); $deposit = $deposit->getWithdraws('', '', ' paid = "false"');
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)); } #加载类别 require_once ROOT_PATH . '/apps/categories/models/categories.class.php'; $categoriesClass = new categories(); $categories = $categoriesClass->getAll(); abr('categories', $categories); break; #在类别中结束搜索 }
if (is_numeric($categoryID)) { $allCategories = $categoriesClass->getAll(0, 0, " `visible` = 'true' "); $categoryParent = $categoriesClass->getCategoryParents($allCategories, $categoryID); $categoryParent = explode(',', $categoryParent); $categoryParent = array_reverse($categoryParent); array_shift($categoryParent); $whereQuery = " AND `id` IN (SELECT `item_id` FROM `items_to_category` WHERE `categories` LIKE '%," . intval($categoryID) . ",%') "; } else { $categoryParent = array('data' => ''); } require_once ROOT_PATH . '/apps/items/models/items.class.php'; require_once ROOT_PATH . '/apps/users/models/users.class.php'; $itemsClass = new items(); $users = new users(); $order = '`datetime` DESC'; $items = $itemsClass->getAll(0, 40, " `status` = 'active' " . $whereQuery, $order); $categories = $categoriesClass->getAll(); $res_data = array(); foreach ($items as $data) { //用户信息 $user_info = $users->getuserinfoById($data['user_id']); $data['user_info']['item-author'] = $user_info['nickname']; $item_categories = array(); foreach ($data['categories'] as $cat) { foreach ($cat as $c_cat) { $item_categories[] = $categories[$c_cat]['name']; } } $data['item_categories'] = $item_categories; $res_data[] = $data; }
$usersClass = new users(); // $users['month'] = $usersClass->getUsersCount(" `register_datetime` > '".date('Y-m')."-01 00:00:00' AND `status` = 'activate' "); // $users['total'] = $usersClass->getUsersCount(" `status` = 'activate' "); abr('users', $users); $topAuthors = $usersClass->getAll(0, 5, " `status` = 'activate' ", "`sales` DESC"); abr('topAuthors', $topAuthors); #LOAD WITHDRAW require_once ROOT_PATH . '/apps/users/models/deposit.class.php'; $depositClass = new deposit(); $withdraw['no'] = $depositClass->getWithdrawCount(" `paid` = 'false' AND `datetime` > '" . date('Y-m') . "-01 00:00:00' "); $withdraw['paid'] = $depositClass->getWithdrawCount(" `paid` = 'true' AND `paid_datetime` > '" . date('Y-m') . "-01 00:00:00' "); abr('withdraw', $withdraw); #LOAD THEMES require_once ROOT_PATH . '/apps/items/models/items.class.php'; $itemsClass = new items(); $items = $itemsClass->getAll(0, 10, " `status` = 'queue' "); abr('items', $items); $updated_items = $itemsClass->getAllForUpdate(0, 10); abr('updated_items', $updated_items); #LOAD LAST REQUEST require_once ROOT_PATH . '/apps/contacts/models/contacts.class.php'; $contactsClass = new contacts(); $lastContact = $contactsClass->getAll(0, 10, " `answer` = '' "); abr('lastContact', $lastContact); #CHECK FOR ATTRIBUTES require_once ROOT_PATH . '/apps/attributes/models/categories.class.php'; $categoriesClass = new categories(); $attributes = $categoriesClass->getAll(); if (!is_array($attributes)) { abr('notHaveAttributes', 'true'); }
// +---------------------------------------------------------------------- // | Email author@demila.org // +---------------------------------------------------------------------- _setView(__FILE__); _setTitle($langArray['queue']); $cms = new items(); if (!isset($_GET['order'])) { $_GET['order'] = ''; } if (!isset($_GET['dir'])) { $_GET['dir'] = ''; } $orderQuery = ''; switch ($_GET['order']) { default: $orderQuery = "`datetime`"; } switch ($_GET['dir']) { case 'desc': $orderQuery .= " DESC"; abr('orderDir', 'asc'); break; default: $orderQuery .= " ASC"; abr('orderDir', 'desc'); } $data = $cms->getAll(START, LIMIT, " `status` = 'queue' ", $orderQuery); abr('data', $data); $p = paging("?m=" . $_GET['m'] . "&c=queue&p=", "&order=" . $_GET['order'] . "&dir=" . $_GET['dir'], PAGE, LIMIT, $cms->foundRows); abr('paging', $p); require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';
$users = $usersClass->getAll(0, 0, $commentsClass->usersQuery); abr('users', $users); $ordersClass = new orders(); $buyFromUsers = $ordersClass->isItemBuyed($itemID, $commentsClass->usersQuery); abr('buyFromUsers', $buyFromUsers); } abr('comments', $comments); abr('paging', paging('/' . $languageURL . 'items/comments/' . $itemID . '/?p=', '', PAGE, LIMIT, $commentsClass->foundRows)); #标签标记作品 require_once ROOT_PATH . '/apps/items/controllers/bookmark.php'; #是否免费文件 if ($item['free_file'] == 'true') { abr('freeFileMessage', langMessageReplace($langArray['free_file_info'], array('URL' => '/' . $languageURL . 'users/downloads/' . $item['id']))); } #加载其它作品 $otherItems = $itemsClass->getAll(0, 7, " `status` = 'active' AND `id` <> '" . intval($itemID) . "' ", "RAND()"); abr('otherItems', $otherItems); abr('otherItemsCount', count($otherItems)); #加载属性 require_once ROOT_PATH . '/apps/attributes/models/attributes.class.php'; $attributesClass = new attributes(); $attributes = $attributesClass->getAll(0, 0, $itemsClass->attributesWhere); abr('attributes', $attributes); $attributeCategories = $attributesClass->getAllCategories(0, 0, $itemsClass->attributeCategoriesWhere); abr('attributeCategories', $attributeCategories); #加载类别 require_once ROOT_PATH . '/apps/categories/models/categories.class.php'; $categoriesClass = new categories(); $categories = $categoriesClass->getAll(); abr('categories', $categories); #面包屑