当前位置: 首页>>代码示例>>PHP>>正文


PHP categories::getAll方法代码示例

本文整理汇总了PHP中categories::getAll方法的典型用法代码示例。如果您正苦于以下问题:PHP categories::getAll方法的具体用法?PHP categories::getAll怎么用?PHP categories::getAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在categories的用法示例。


在下文中一共展示了categories::getAll方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: pages

 }
 #保存推荐人至session
 if (isset($_GET['ref'])) {
     $_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']);
开发者ID:yunsite,项目名称:demila,代码行数:31,代码来源:index.php

示例2: abr

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';
$badges = new badges();
$badges_data = $badges->getAllFront();
$other_badges = array_map('trim', explode(',', $user['badges']));
$user_badges = array();
if ($user['exclusive_author'] == 'true' && isset($badges_data['system']['is_exclusive_author'])) {
    if ($badges_data['system']['is_exclusive_author']['photo'] && file_exists(DATA_SERVER_PATH . "/uploads/badges/" . $badges_data['system']['is_exclusive_author']['photo'])) {
        $user_badges[] = array('name' => $badges_data['system']['is_exclusive_author']['name'], 'photo' => '/uploads/badges/' . $badges_data['system']['is_exclusive_author']['photo']);
开发者ID:yunsite,项目名称:demila,代码行数:31,代码来源:faq.php

示例3: categories

<?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['list']);
$cms = new categories();
if (isset($_GET['up']) || isset($_GET['down'])) {
    $cms->tableName = 'attributes_categories';
    $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']);
    }
}
$data = $cms->getAll(START, LIMIT);
abr('data', $data);
$p = paging("?m=" . $_GET['m'] . "&c=list&p=", "", PAGE, LIMIT, $cms->foundRows);
abr('paging', $p);
require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';
开发者ID:yunsite,项目名称:demila,代码行数:28,代码来源:list.php

示例4: categories

// | 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['list']);
$cms = new categories();
if (!isset($_GET['sub_of']) || !is_numeric($_GET['sub_of'])) {
    $_GET['sub_of'] = 0;
}
if (isset($_GET['up']) || isset($_GET['down'])) {
    $cms->tableName = 'categories';
    $cms->idColumn = 'id';
    $cms->orderWhere = " AND `sub_of` = '" . intval($_GET['sub_of']) . "' ";
    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, " `sub_of` = '" . intval($_GET['sub_of']) . "' ");
abr('data', $data);
$p = paging("?m=" . $_GET['m'] . "&c=list&sub_of=" . $_GET['sub_of'] . "&p=", "", PAGE, LIMIT, $cms->foundRows);
abr('paging', $p);
if ($_GET['sub_of'] != 0) {
    $pdata = $cms->get($_GET['sub_of']);
    abr('pdata', $pdata);
}
require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';
开发者ID:yunsite,项目名称:demila,代码行数:31,代码来源:list.php

示例5: edit


//.........这里部分代码省略.........
                 break;
             }
         }
         if ($attributesError) {
             $error['attributes'] = $langArray['error_set_all_attributes'];
         }
     }
     if (isset($error)) {
         return $error;
     }
     $setQuery = '';
     if ($fromAdmin) {
         $setQuery .= " `price` = '" . sql_quote($_POST['price']) . "', ";
         if (isset($_POST['free_file'])) {
             $setQuery .= " `free_file` = 'true', ";
         }
         //周推荐至-时间
         if (isset($_POST['weekly_to']) && trim($_POST['weekly_to']) != '') {
             $setQuery .= " `weekly_to` = '" . sql_quote($_POST['weekly_to']) . "', ";
         }
     }
     //演示地址
     if (!isset($_POST['demo_url'])) {
         $_POST['demo_url'] = '';
     }
     //作品状态是否为请求免费上架状态
     if (!isset($_POST['free_request'])) {
         $_POST['free_request'] = 'false';
     }
     //更新作品表
     $mysql->query("\n\t\t\tUPDATE `items`\n\t\t\tSET `description` = '" . sql_quote($_POST['description']) . "',\n\t\t\t\t\t`free_request` = '" . sql_quote($_POST['free_request']) . "',\n\t\t\t\t\t{$setQuery}\n\t\t\t\t\t`demo_url` = '" . sql_quote($_POST['demo_url']) . "'\n\t\t\tWHERE `id` = '" . intval($id) . "'\n\t\t\tLIMIT 1\n\t\t");
     require_once ROOT_PATH . '/apps/categories/models/categories.class.php';
     $categoriesClass = new categories();
     $allCategories = $categoriesClass->getAll();
     $mysql->query("DELETE FROM `items_to_category` WHERE `item_id` = '" . intval($id) . "'");
     if (is_array($_POST['category'])) {
         foreach ($_POST['category'] as $category_id) {
             $categories = $categoriesClass->getCategoryParents($allCategories, $category_id);
             $categories = explode(',', $categories);
             array_pop($categories);
             $categories = array_reverse($categories);
             $categories = ',' . implode(',', $categories) . ',';
             $mysql->query("\n\t\t\t\t\tINSERT INTO `items_to_category` (\n\t\t\t\t\t\t`item_id`,\n\t\t\t\t\t\t`categories`\n\t\t\t\t\t) \n\t\t\t\t\tVALUES (\n\t\t\t\t\t\t'" . intval($id) . "',\n\t\t\t\t\t\t'" . sql_quote($categories) . "'\n\t\t\t\t\t)\n\t\t\t\t");
         }
     } else {
         $categories = $categoriesClass->getCategoryParents($allCategories, $_POST['category']);
         $categories = explode(',', $categories);
         array_pop($categories);
         $categories = array_reverse($categories);
         $categories = ',' . implode(',', $categories) . ',';
         $mysql->query("\n\t\t\t\tINSERT INTO `items_to_category` (\n\t\t\t\t\t`item_id`,\n\t\t\t\t\t`categories`\n\t\t\t\t) \n\t\t\t\tVALUES (\n\t\t\t\t\t'" . intval($id) . "',\n\t\t\t\t\t'" . sql_quote($categories) . "'\n\t\t\t\t)\n\t\t\t");
     }
     //更新属性
     $mysql->query("\n\t\t\tDELETE FROM `items_attributes`\n\t\t\tWHERE `item_id` = '" . intval($id) . "'\n\t\t");
     $_POST['attributes'] = (array) (isset($_POST['attributes']) ? $_POST['attributes'] : array());
     foreach ($_POST['attributes'] as $cID => $a) {
         if (is_array($a)) {
             foreach ($a as $ai) {
                 if (!trim($ai)) {
                     continue;
                 }
                 $mysql->query("\n\t\t\t\t\t\tINSERT INTO `items_attributes` (\n\t\t\t\t\t\t\t`item_id`,\n\t\t\t\t\t\t\t`attribute_id`,\n\t\t\t\t\t\t\t`category_id`\n\t\t\t\t\t\t)\n\t\t\t\t\t\tVALUES (\n\t\t\t\t\t\t\t'" . intval($id) . "',\n\t\t\t\t\t\t\t'" . sql_quote($ai) . "',\n\t\t\t\t\t\t\t'" . sql_quote($cID) . "'\n\t\t\t\t\t\t)\n\t\t\t\t\t");
             }
         } else {
             if (!trim($a)) {
                 continue;
开发者ID:yunsite,项目名称:demila,代码行数:67,代码来源:items.class.php

示例6: categories

<?php

//作品分类ajax接口
if (isset($_POST['categoryID'])) {
    $categoryID = $_POST['categoryID'];
    if (is_numeric($categoryID) || $categoryID == 'all') {
        require_once '../../../config.php';
        require_once $config['root_path'] . '/core/functions.php';
        include_once $config['system_core'] . "/initEngine.php";
        require_once ROOT_PATH . "/apps/categories/models/categories.class.php";
        $categoriesClass = new categories();
        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) {
            //用户信息
开发者ID:yunsite,项目名称:demila,代码行数:31,代码来源:categories.php

示例7: items

#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');
}
require_once ROOT_PATH . '/apps/reports/models/javascript.class.php';
$referal_sum = $ordersClass->getSalesStatusByDay(" AND `datetime` > '" . date('Y-m') . "-01 00:00:00' ", 'referal');
$sales_sum = $ordersClass->getSalesStatusByDay(" AND `datetime` > '" . date('Y-m') . "-01 00:00:00' ");
$referal_money = array();
$sales_money = array();
$user_money = array();
$win_money = array();
$sales_num = array();
$days = array();
for ($i = 1; $i <= date('t'); $i++) {
    if (isset($referal_sum[date("Y-m-") . sprintf('%02d', $i)])) {
        $referal_money[] = number_format($referal_sum[date("Y-m-") . sprintf('%02d', $i)]['receive'], 2, '.', '');
开发者ID:yunsite,项目名称:demila,代码行数:31,代码来源:console.php


注:本文中的categories::getAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。