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


PHP get_cat_info函数代码示例

本文整理汇总了PHP中get_cat_info函数的典型用法代码示例。如果您正苦于以下问题:PHP get_cat_info函数的具体用法?PHP get_cat_info怎么用?PHP get_cat_info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: elseif

                if (!empty($image_order)) {
                    $image_order .= ',';
                }
                $image_order .= $_POST['image_order'][$i];
            }
        }
    } elseif ($image_order_choice == 'rank') {
        $image_order = 'rank ASC';
    }
    $query = '
UPDATE ' . CATEGORIES_TABLE . ' 
  SET image_order = ' . (isset($image_order) ? '\'' . $image_order . '\'' : 'NULL') . '
  WHERE id=' . $page['category_id'];
    pwg_query($query);
    if (isset($_POST['image_order_subcats'])) {
        $cat_info = get_cat_info($page['category_id']);
        $query = '
UPDATE ' . CATEGORIES_TABLE . '
  SET image_order = ' . (isset($image_order) ? '\'' . $image_order . '\'' : 'NULL') . '
  WHERE uppercats LIKE \'' . $cat_info['uppercats'] . ',%\'';
        pwg_query($query);
    }
    $page['infos'][] = l10n('Your configuration settings are saved');
}
// +-----------------------------------------------------------------------+
// |                             template init                             |
// +-----------------------------------------------------------------------+
$template->set_filenames(array('element_set_ranks' => 'element_set_ranks.tpl'));
$base_url = get_root_url() . 'admin.php';
$query = '
SELECT *
开发者ID:donseba,项目名称:Piwigo,代码行数:31,代码来源:element_set_ranks.php

示例2: sprintf

require_once AT_INCLUDE_PATH . '../mods/_standard/links/lib/links.inc.php';
$linkIndexHeader = sprintf('Location: %smods/_standard/links/tools/index.php', AT_BASE_HREF);
if (!manage_links()) {
    $msg->addError('ACCESS_DENIED');
    header('Location: ' . AT_BASE_HREF . 'mods/_standard/links/index.php');
    exit;
}
$lid = explode('-', $_REQUEST['lid']);
$link_id = intval($lid[0]);
if (isset($_POST['submit_no'])) {
    $msg->addFeedback('CANCELLED');
    header($linkIndexHeader);
    exit;
} else {
    if (isset($_POST['submit_yes'])) {
        $row = get_cat_info(intval($_POST['cat_id']));
        if (!links_authenticate($row['owner_type'], $row['owner_id'])) {
            $msg->addError('ACCESS_DENIED');
            header($linkIndexHeader);
            exit;
        }
        queryDB('DELETE FROM %slinks WHERE link_id=%d', array(TABLE_PREFIX, $_POST[link_id]));
        $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
        header($linkIndexHeader);
        exit;
    }
}
$_section[0][0] = _AT('delete_link');
require_once AT_INCLUDE_PATH . 'header.inc.php';
$row = queryDB('SELECT LinkName, cat_id FROM %slinks WHERE link_id=%d', array(TABLE_PREFIX, $link_id), true);
if (empty($row)) {
开发者ID:genaromendezl,项目名称:ATutor,代码行数:31,代码来源:delete.php

示例3: get_category_child

        $child_list = get_category_child($cat_id, ' AND is_new = 1 ');
        $on_top_goods = get_on_top_goods($cat_id, 10);
        $smarty->assign('cat_child', $child_list);
        $smarty->assign('on_top_goods', $on_top_goods);
        $smarty->assign('cat_info', $cat);
        $smarty->assign('group_buy_goods', index_get_group_buy());
        // 团购商品
    } else {
        $sql = 'SELECT parent_id FROM ' . $GLOBALS['ecs']->table('category') . ' WHERE cat_id = ' . $cat_id;
        $parent_id = $GLOBALS['db']->getOne($sql);
        while ($parent_id != 0) {
            $parent_id_org = $parent_id;
            $sql = 'SELECT parent_id FROM ' . $GLOBALS['ecs']->table('category') . ' WHERE cat_id = ' . $parent_id;
            $parent_id = $GLOBALS['db']->getOne($sql);
        }
        $cat = get_cat_info($parent_id_org);
        // 获得分类的相关信息
        $smarty->assign('cat_info', $cat);
        $smarty->assign('category_org', $parent_id_org);
        // 分类树
    }
    $smarty->assign('script_name', 'category');
    assign_pager('category', $cat_id, $count, $size, $sort, $order, $page, '', $brand, $price_min, $price_max, $display, $filter_attr_str);
    // 分页
    assign_dynamic($dwt_name);
    // 动态内容
}
$smarty->display($dwt_name . '.dwt', $cache_id);
/*------------------------------------------------------ */
//-- PRIVATE FUNCTION
/*------------------------------------------------------ */
开发者ID:shaoslu,项目名称:jumei,代码行数:31,代码来源:category.php

示例4: array

    $data = array('id' => $_GET['cat_id'], 'name' => @$_POST['name'], 'comment' => $conf['allow_html_descriptions'] ? @$_POST['comment'] : strip_tags(@$_POST['comment']));
    if ($conf['activate_comments']) {
        $data['commentable'] = isset($_POST['commentable']) ? $_POST['commentable'] : 'false';
    }
    single_update(CATEGORIES_TABLE, $data, array('id' => $data['id']));
    if (isset($_POST['apply_commentable_on_sub'])) {
        $subcats = get_subcat_ids(array('id' => $data['id']));
        $query = '
UPDATE ' . CATEGORIES_TABLE . '
  SET commentable = \'' . $data['commentable'] . '\'
  WHERE id IN (' . implode(',', $subcats) . ')
;';
        pwg_query($query);
    }
    // retrieve cat infos before continuing (following updates are expensive)
    $cat_info = get_cat_info($_GET['cat_id']);
    if ($_POST['visible'] == 'true_sub') {
        set_cat_visible(array($_GET['cat_id']), true, true);
    } elseif ($cat_info['visible'] != get_boolean($_POST['visible'])) {
        set_cat_visible(array($_GET['cat_id']), $_POST['visible']);
    }
    // in case the use moves his album to the gallery root, we force
    // $_POST['parent'] from 0 to null to be compared with
    // $cat_info['id_uppercat']
    if (empty($_POST['parent'])) {
        $_POST['parent'] = null;
    }
    // only move virtual albums
    if (empty($cat_info['dir']) and $cat_info['id_uppercat'] != $_POST['parent']) {
        move_categories(array($_GET['cat_id']), $_POST['parent']);
    }
开发者ID:HassenLin,项目名称:piwigo_utf8filename,代码行数:31,代码来源:cat_modify.php

示例5: redirect

    // where to redirect the user now?
    //
    // 1. if a category is available in the URL, use it
    // 2. else use the first reachable linked category
    // 3. redirect to gallery root
    if (isset($_GET['cat_id']) and !empty($_GET['cat_id'])) {
        redirect(make_index_url(array('category' => get_cat_info($_GET['cat_id']))));
    }
    $query = '
SELECT category_id
  FROM ' . IMAGE_CATEGORY_TABLE . '
  WHERE image_id = ' . $_GET['image_id'] . '
;';
    $authorizeds = array_diff(array_from_query($query, 'category_id'), explode(',', calculate_permissions($user['id'], $user['status'])));
    foreach ($authorizeds as $category_id) {
        redirect(make_index_url(array('category' => get_cat_info($category_id))));
    }
    redirect(make_index_url());
}
// +-----------------------------------------------------------------------+
// |                          synchronize metadata                         |
// +-----------------------------------------------------------------------+
if (isset($_GET['sync_metadata'])) {
    sync_metadata(array(intval($_GET['image_id'])));
    $page['infos'][] = l10n('Metadata synchronized from file');
}
//--------------------------------------------------------- update informations
if (isset($_POST['submit'])) {
    $data = array();
    $data['id'] = $_GET['image_id'];
    $data['name'] = $_POST['name'];
开发者ID:donseba,项目名称:Piwigo,代码行数:31,代码来源:picture_modify.php

示例6: sys_msg

        $link[1]['text'] = $_LANG['back_list'];
        $link[1]['href'] = 'category.php?act=list';

        sys_msg($_LANG['catadd_succed'], 0, $link);
    }
 }

/*------------------------------------------------------ */
//-- 编辑商品分类信息
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'edit')
{
    admin_priv('cat_manage');   // 权限检查
    $cat_id = intval($_REQUEST['cat_id']);
    $cat_info = get_cat_info($cat_id);  // 查询分类信息数据
    $attr_list = get_attr_list();
    $filter_attr_list = array();

    if ($cat_info['filter_attr'])
    {
        $filter_attr = explode(",", $cat_info['filter_attr']);  //把多个筛选属性放到数组中

        foreach ($filter_attr AS $k => $v)
        {
            $attr_cat_id = $db->getOne("SELECT cat_id FROM " . $ecs->table('attribute') . " WHERE attr_id = '" . intval($v) . "'");
            $filter_attr_list[$k]['goods_type_list'] = goods_type_list($attr_cat_id);  //取得每个属性的商品类型
            $filter_attr_list[$k]['filter_attr'] = $v;
            $attr_option = array();

            foreach ($attr_list[$attr_cat_id] as $val)
开发者ID:norain2050,项目名称:mhFault,代码行数:30,代码来源:category.php

示例7: header

        if (!links_authenticate($owner_type, $owner_id)) {
            $msg->addError('ACCESS_DENIED');
            header('Location: ' . AT_BASE_HREF . 'mods/_standard/links/tools/categories.php');
            exit;
        }
        //check if there are sub cats within this cat, or links
        $result = queryDB('SELECT C.cat_id, L.link_id FROM %slinks_categories C, %slinks L WHERE C.parent_id=%d OR L.cat_id=%d', array(TABLE_PREFIX, TABLE_PREFIX, $cat_id, $cat_id));
        if (empty($result)) {
            queryDB("DELETE FROM %slinks_categories WHERE owner_id=%d AND owner_type=%s AND cat_id=%d", array(TABLE_PREFIX, $owner_id, $owner_type, $cat_id));
            $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
        } else {
            $msg->addError('LINK_CAT_NOT_EMPTY');
        }
        header('Location: categories.php');
        exit;
    }
}
require AT_INCLUDE_PATH . 'header.inc.php';
$row = get_cat_info($cat_id);
if (empty($row)) {
    $msg->printErrors('ITEM_NOT_FOUND');
} else {
    $hidden_vars['cat_name'] = $row['name'];
    $hidden_vars['cat_id'] = $row['cat_id'];
    $hidden_vars['owner_type'] = $row['owner_type'];
    $hidden_vars['owner_id'] = $row['owner_id'];
    $confirm = array('DELETE_CATEGORY', AT_print($row['name'], 'links_categories.name'));
    $msg->addConfirm($confirm, $hidden_vars);
    $msg->printConfirm();
}
require AT_INCLUDE_PATH . 'footer.inc.php';
开发者ID:genaromendezl,项目名称:ATutor,代码行数:31,代码来源:categories_delete.php

示例8: die

    $description = $videoinfo['description'];
    $bigimage = $videoinfo['bigimage'];
} else {
    die('没有指定播放的视频!');
}
?>

<div class="video-center">

    <div id="videoRight" class="panel panel-default">
        <div class="panel-heading">
            <h4 class="panel-title">相关视频</h4>
        </div>
        <div class="panel-body">
                <?php 
$cat = get_cat_info($_GET['id']);
for ($i = 0; $i < count($cat); $i++) {
    echo '<a title="' . $cat[$i]['title'] . '" href="' . $cat[$i]['url'] . '"><img class="relate-video" src="' . $cat[$i]['smallimage'] . '"/></a>';
}
?>
        </div>
    </div>

    <div id="videoCenter" class="panel panel-default">
        <div class="panel-heading">
            <h4 class="panel-title"><?php 
echo $description;
?>
</h4>
        </div>
        <div class="panel-body">
开发者ID:xingtingyang,项目名称:SiteforOurLab,代码行数:31,代码来源:video.php

示例9: get_cat_display_name_from_id

/**
 * Generates breadcrumb for a category.
 * @see get_cat_display_name()
 *
 * @param int $cat_id
 * @param string|null $url
 * @return string
 */
function get_cat_display_name_from_id($cat_id, $url = '')
{
    $cat_info = get_cat_info($cat_id);
    return get_cat_display_name($cat_info['upper_names'], $url);
}
开发者ID:mathieumd,项目名称:Piwigo,代码行数:13,代码来源:functions_html.inc.php

示例10: upload_category_pic

/**
 * 分类商品代表图片
 * @param int $catid 商品分类id
 */
function upload_category_pic($catid)
{
    /* 允许上传的文件类型 */
    $allow_file_types = '|GIF|JPG|PNG|BMP|';
    foreach ($_FILES as $code => $file) {
        /* 判断用户是否选择了文件 */
        if (isset($file['error']) && $file['error'] == 0 || !isset($file['error']) && $file['tmp_name'] != 'none') {
            /* 检查上传的文件类型是否合法 */
            if (!check_file_type($file['tmp_name'], $file['name'], $allow_file_types)) {
                sys_msg(sprintf($_LANG['msg_invalid_file'], $file['name']));
            } else {
                $file_name = "../data/supplier/category/";
                if ($code == 'cat_pic') {
                    $ext = array_pop(explode('.', $file['name']));
                    $file_name .= $_SESSION['supplier_id'] . 'c' . time() . '.' . $ext;
                    if ($catid > 0) {
                        $catpic = get_cat_info($catid);
                        if (file_exists($catpic['cat_pic'])) {
                            @unlink($catpic['cat_pic']);
                        }
                    }
                }
                /* 判断是否上传成功 */
                if (move_upload_file($file['tmp_name'], $file_name)) {
                    return $file_name;
                } else {
                    sys_msg(sprintf($_LANG['msg_upload_failed'], $file['name'], $file_name));
                }
            }
        }
    }
}
开发者ID:moonlight-wang,项目名称:feilun,代码行数:36,代码来源:category.php

示例11: in_array

    $order   = (isset($_REQUEST['order']) && in_array(trim(strtoupper($_REQUEST['order'])), array('ASC', 'DESC')))                              ? trim($_REQUEST['order']) : $default_sort_order_method;
    $display = (isset($_REQUEST['display']) && in_array(trim(strtolower($_REQUEST['display'])), array('list', 'grid', 'text'))) ? trim($_REQUEST['display'])  : (isset($_COOKIE['ECS']['display']) ? $_COOKIE['ECS']['display'] : $default_display_type);
    $display  = in_array($display, array('list', 'grid', 'text')) ? $display : 'text';
    setcookie('ECS[display]', $display, gmtime() + 86400 * 7);

    /* 页面的缓存ID */
    $cache_id = sprintf('%X', crc32($cat_id . '-' . $display . '-' . $sort  .'-' . $order  .'-' . $page . '-' . $size . '-' . $_SESSION['user_rank'] . '-' .
        $_CFG['lang'] . '-' . $integral_max . '-' .$integral_min));

    if (!$smarty->is_cached('exchange.dwt', $cache_id))
    {
        /* 如果页面没有被缓存则重新获取页面的内容 */

        $children = get_children($cat_id);

        $cat = get_cat_info($cat_id);   // 获得分类的相关信息

        if (!empty($cat))
        {
            $smarty->assign('keywords',    htmlspecialchars($cat['keywords']));
            $smarty->assign('description', htmlspecialchars($cat['cat_desc']));
        }

        assign_template();

        $position = assign_ur_here('exchange');
        $smarty->assign('page_title',       $position['title']);    // 页面标题
        $smarty->assign('ur_here',          $position['ur_here']);  // 当前位置

        $smarty->assign('categories',       get_categories_tree());        // 分类树
        $smarty->assign('helps',            get_shop_help());              // 网店帮助
开发者ID:xiaoxiaowu007,项目名称:jicai,代码行数:31,代码来源:exchange.php

示例12: search

	public function search () {
		 /**
	     * 参数描述:
	     * @var id 分类id.
	     * @var page 当前页.
	     * @var brand  品牌id.
	     * @var price_max 最高价格.
	     * @var price_min 最低价格.
	     * @var order 排序方式. @enum.<'ASC', 'DESC'>
	     * @var sort 排序字段.@enum.<'goods_id', 'shop_price', 'last_update'>
	     * @var filter_attr table goods_attr 中goods_attr_id使用"."连接。例如9.10.11
	 	*/
		global $_CFG,$ecs,$db;
		$cat_id = isset($_REQUEST['id']) ? intval($_REQUEST['id'])  : 0;
	    if (!$cat_id) {
	    	$result = rpcLang('category.php', 'goodslist_failure');
	        jsonExit("{\"status\":\"$result\"}");
	    }
	    $cat = get_cat_info($cat_id);   // 获得分类的相关信息
	    if (empty($cat)) {
	    	$result = rpcLang('category.php', 'search_cat_failure');
	        jsonExit("{\"status\":\"$result\"}");
	    }	    
	    $page = isset($_REQUEST['page'])   && intval($_REQUEST['page'])  > 0 ? intval($_REQUEST['page'])  : 1;
	    // $size = isset($_CFG['page_size'])  && intval($_CFG['page_size']) > 0 ? intval($_CFG['page_size']) : 1;
	    $size = 10;
	    //品牌筛选.
	    $brand = isset($_REQUEST['brand']) && intval($_REQUEST['brand']) > 0 ? intval($_REQUEST['brand']) : 0;
	    //价格区间
	    $price_max = isset($_REQUEST['price_max']) && intval($_REQUEST['price_max']) > 0 ? intval($_REQUEST['price_max']) : 0;
	    $price_min = isset($_REQUEST['price_min']) && intval($_REQUEST['price_min']) > 0 ? intval($_REQUEST['price_min']) : 0;
	    
	    //属性筛选.格式1.2.3  / attr_id使用.分割
	    $filter_attr_str = isset($_REQUEST['filter_attr']) ? htmlspecialchars(trim($_REQUEST['filter_attr'])) : '0';
	    $filter_attr_str = urldecode($filter_attr_str);
	    
	    $filter_attr = empty($filter_attr_str) ? '' : explode('.', trim($filter_attr_str));
	    
	    
	    /* 排序、方式及类型 */
	    $default_sort_order_method = $_CFG['sort_order_method'] == '0' ? 'DESC' : 'ASC';
	    $default_sort_order_type   = $_CFG['sort_order_type'] == '0' ? 'goods_id' : ($_CFG['sort_order_type'] == '1' ? 'shop_price' : 'last_update');
	    
	    $sort  = (isset($_REQUEST['sort'])  && in_array(trim(strtolower($_REQUEST['sort'])), array('goods_id', 'shop_price', 'last_update'))) ? trim($_REQUEST['sort'])  : $default_sort_order_type;
	    $order = (isset($_REQUEST['order']) && in_array(trim(strtoupper($_REQUEST['order'])), array('ASC', 'DESC')))                              ? trim($_REQUEST['order']) : $default_sort_order_method;
	    
	    $children = get_children($cat_id);
	    
	    //属性筛选
	    $ext = '';
	    if (!empty($filter_attr))
	    {
	        $ext_sql = "SELECT DISTINCT(b.goods_id) FROM " . $ecs->table('goods_attr') . " AS a, " . $ecs->table('goods_attr') . " AS b " .  "WHERE ";
	        $ext_group_goods = array();
	    
	        foreach ($filter_attr AS $k => $v)// 查出符合所有筛选属性条件的商品id */
	        {
	            if (!is_numeric($v) || $v == 0) continue;
	            $sql = $ext_sql . "b.attr_value = a.attr_value  AND a.goods_attr_id = " . $v;
	            $ext_group_goods = $db->getColCached($sql);
	            $ext .= ' AND ' . db_create_in($ext_group_goods, 'g.goods_id');
	        }
	    }
	    $count = get_cagtegory_goods_count($children, $brand, $price_min, $price_max, $ext);
	    $max_page = ($count> 0) ? ceil($count / $size) : 1;
	    if ($page > $max_page) $page = $max_page;
	    
	    $goodslist = category_get_goods($children, $brand, $price_min, $price_max, $ext, $size, $page, $sort, $order);
	    if (!$goodslist) {
			$goodslist = rpcLang('category.php', 'goodslist_empty');
		} 
		$goodslist = array_values($goodslist);
		$pager = get_pager('category.php', $_GET, $count, $page, $size);
		//print_r(array('goods_list'=>$goodslist, 'pager'=>$pager));exit;
	    jsonExit(array('goods_list'=>$goodslist, 'pager'=>$pager));
	}
开发者ID:noikiy,项目名称:mdwp,代码行数:76,代码来源:category.action.php

示例13: create_navigation_bar

if (count($page['cat_elements_id']) > 0) {
    $nav_bar = create_navigation_bar($base_url . get_query_string_diff(array('start')), count($page['cat_elements_id']), $page['start'], $page['nb_images']);
    $template->assign(array('navbar' => $nav_bar));
    $element_ids = array();
    $is_category = false;
    if (isset($_SESSION['bulk_manager_filter']['category']) and !isset($_SESSION['bulk_manager_filter']['category_recursive'])) {
        $is_category = true;
    }
    if (isset($_SESSION['bulk_manager_filter']['prefilter']) and 'duplicates' == $_SESSION['bulk_manager_filter']['prefilter']) {
        $conf['order_by'] = ' ORDER BY file, id';
    }
    $query = '
SELECT *
  FROM ' . IMAGES_TABLE;
    if ($is_category) {
        $category_info = get_cat_info($_SESSION['bulk_manager_filter']['category']);
        $conf['order_by'] = $conf['order_by_inside_category'];
        if (!empty($category_info['image_order'])) {
            $conf['order_by'] = ' ORDER BY ' . $category_info['image_order'];
        }
        $query .= '
    JOIN ' . IMAGE_CATEGORY_TABLE . ' ON id = image_id';
    }
    $query .= '
  WHERE id IN (' . implode(',', $page['cat_elements_id']) . ')';
    if ($is_category) {
        $query .= '
    AND category_id = ' . $_SESSION['bulk_manager_filter']['category'];
    }
    $query .= '
  ' . $conf['order_by'] . '
开发者ID:donseba,项目名称:Piwigo,代码行数:31,代码来源:batch_manager_unit.php

示例14: parse_section_url

/**
 * the reverse of make_section_in_url
 * returns the 'section' (categories/tags/...) and the data associated with it
 *
 * Depending on section, other parameters are returned (category/tags/list/...)
 *
 * @param array of url tokens to parse
 * @param int the index in the array of url tokens; in/out
 * @return array
 */
function parse_section_url($tokens, &$next_token)
{
    $page = array();
    if (strncmp(@$tokens[$next_token], 'categor', 7) == 0) {
        $page['section'] = 'categories';
        $next_token++;
        if (isset($tokens[$next_token])) {
            if (preg_match('/^(\\d+)(?:-(.+))?$/', $tokens[$next_token], $matches)) {
                if (isset($matches[2])) {
                    $page['hit_by']['cat_url_name'] = $matches[2];
                }
                $page['category'] = $matches[1];
                $next_token++;
            } else {
                // try a permalink
                $maybe_permalinks = array();
                $current_token = $next_token;
                while (isset($tokens[$current_token]) and strpos($tokens[$current_token], 'created-') !== 0 and strpos($tokens[$current_token], 'posted-') !== 0 and strpos($tokens[$next_token], 'start-') !== 0 and strpos($tokens[$next_token], 'startcat-') !== 0 and $tokens[$current_token] != 'flat') {
                    if (empty($maybe_permalinks)) {
                        $maybe_permalinks[] = $tokens[$current_token];
                    } else {
                        $maybe_permalinks[] = $maybe_permalinks[count($maybe_permalinks) - 1] . '/' . $tokens[$current_token];
                    }
                    $current_token++;
                }
                if (count($maybe_permalinks)) {
                    $cat_id = get_cat_id_from_permalinks($maybe_permalinks, $perma_index);
                    if (isset($cat_id)) {
                        $next_token += $perma_index + 1;
                        $page['category'] = $cat_id;
                        $page['hit_by']['cat_permalink'] = $maybe_permalinks[$perma_index];
                    } else {
                        page_not_found(l10n('Permalink for album not found'));
                    }
                }
            }
        }
        if (isset($page['category'])) {
            $result = get_cat_info($page['category']);
            if (empty($result)) {
                page_not_found(l10n('Requested album does not exist'));
            }
            $page['category'] = $result;
        }
    } elseif ('tags' == @$tokens[$next_token]) {
        global $conf;
        $page['section'] = 'tags';
        $page['tags'] = array();
        $next_token++;
        $i = $next_token;
        $requested_tag_ids = array();
        $requested_tag_url_names = array();
        while (isset($tokens[$i])) {
            if (strpos($tokens[$i], 'created-') === 0 or strpos($tokens[$i], 'posted-') === 0 or strpos($tokens[$i], 'start-') === 0) {
                break;
            }
            if ($conf['tag_url_style'] != 'tag' and preg_match('/^(\\d+)(?:-(.*)|)$/', $tokens[$i], $matches)) {
                $requested_tag_ids[] = $matches[1];
            } else {
                $requested_tag_url_names[] = $tokens[$i];
            }
            $i++;
        }
        $next_token = $i;
        if (empty($requested_tag_ids) && empty($requested_tag_url_names)) {
            bad_request('at least one tag required');
        }
        $page['tags'] = find_tags($requested_tag_ids, $requested_tag_url_names);
        if (empty($page['tags'])) {
            page_not_found(l10n('Requested tag does not exist'), get_root_url() . 'tags.php');
        }
    } elseif ('favorites' == @$tokens[$next_token]) {
        $page['section'] = 'favorites';
        $next_token++;
    } elseif ('most_visited' == @$tokens[$next_token]) {
        $page['section'] = 'most_visited';
        $next_token++;
    } elseif ('best_rated' == @$tokens[$next_token]) {
        $page['section'] = 'best_rated';
        $next_token++;
    } elseif ('recent_pics' == @$tokens[$next_token]) {
        $page['section'] = 'recent_pics';
        $next_token++;
    } elseif ('recent_cats' == @$tokens[$next_token]) {
        $page['section'] = 'recent_cats';
        $next_token++;
    } elseif ('search' == @$tokens[$next_token]) {
        $page['section'] = 'search';
        $next_token++;
        preg_match('/(\\d+)/', @$tokens[$next_token], $matches);
//.........这里部分代码省略.........
开发者ID:HassenLin,项目名称:piwigo_utf8filename,代码行数:101,代码来源:functions_url.inc.php

示例15: sys_msg

        // 清除缓存
        /*添加链接*/
        $link[0]['text'] = $_LANG['continue_add'];
        $link[0]['href'] = 'category.php?act=add';
        $link[1]['text'] = $_LANG['back_list'];
        $link[1]['href'] = 'category.php?act=list';
        sys_msg($_LANG['catadd_succed'], 0, $link);
    }
}
/*------------------------------------------------------ */
//-- 编辑商品分类信息
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'edit') {
    admin_priv('cat_manage');
    // 权限检查
    $cat_info = get_cat_info(intval($_REQUEST['cat_id']));
    // 查询分类信息数据
    $attr_list = get_attr_list();
    if ($cat_info['filter_attr']) {
        $attr_cat_id = $db->getOne("SELECT cat_id FROM " . $ecs->table('attribute') . " WHERE attr_id = '{$cat_info['filter_attr']}'");
        $attr_option = array();
        foreach ($attr_list[$attr_cat_id] as $val) {
            $attr_option[key($val)] = current($val);
        }
        $smarty->assign('attr_option', $attr_option);
    } else {
        $attr_cat_id = 0;
    }
    /* 模板赋值 */
    $smarty->assign('goods_type_list', goods_type_list($attr_cat_id));
    // 取得商品类型
开发者ID:songtaiwu,项目名称:m-cmsold,代码行数:31,代码来源:category.php


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