예제 #1
0
파일: attr.php 프로젝트: yunsite/demila
// +----------------------------------------------------------------------
// | 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['attributes']);
if (!isset($_GET['id']) && !is_numeric($_GET['id'])) {
    refresh("/" . $languageURL . adminURL . "/?m=" . $_GET['m'] . "&c=list");
}
$cms = new attributes();
if (isset($_GET['up']) || isset($_GET['down'])) {
    $cms->tableName = 'attributes';
    $cms->idColumn = 'id';
    $cms->orderWhere = " AND `category_id` = '" . intval($_GET['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']);
    }
}
$data = $cms->getAll(START, LIMIT, " `category_id` = '" . intval($_GET['id']) . "' ");
abr('data', $data);
$p = paging("?m=" . $_GET['m'] . "&c=attr&id=" . $_GET['id'] . "&p=", "", PAGE, LIMIT, $cms->foundRows);
abr('paging', $p);
$categoriesClass = new categories();
$pdata = $categoriesClass->get($_GET['id']);
abr('pdata', $pdata);
require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';
예제 #2
0
파일: faq.php 프로젝트: yunsite/demila
#是否免费文件
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';
$categoriesClass = new categories();
$categories = $categoriesClass->getAll();
abr('categories', $categories);
#面包屑
abr('breadcrumb', '<a href="/' . $languageURL . '" title="">' . $langArray['home'] . '</a> \\ <a href="/' . $languageURL . 'items/' . $item['id'] . '" title="">' . $item['name'] . '</a> \\ <a href="/' . $languageURL . 'items/faq/' . $item['id'] . '" title="">' . $langArray['faqs'] . '</a>');
#FAQ
$faqs = $faqClass->CountAll($itemID);
abr('faqs', $faqs);
$user = $item['user'];
require_once ROOT_PATH . '/apps/system/models/badges.class.php';
예제 #3
0
 public function delete($id)
 {
     global $mysql;
     require_once ROOT_PATH . '/apps/attributes/models/attributes.class.php';
     $attributesClass = new attributes();
     $attributes = $attributesClass->getAll(0, 0, " `category_id` = '" . intval($id) . "' ");
     if (is_array($attributes)) {
         foreach ($attributes as $a) {
             $attributesClass->delete($a['id']);
         }
     }
     $mysql->query("\n\t\t\tDELETE FROM `attributes_categories`\n\t\t\tWHERE `id` = '" . intval($id) . "'\n\t\t", __FUNCTION__);
     return true;
 }