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


PHP menu::set_where方法代码示例

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


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

示例1: check_power

function check_power()
{
    global $global;
    $flag = 0;
    if ($global['admin_id']) {
        $obj = new admin();
        $obj->set_where('adm_id = ' . $global['admin_id']);
        $one = $obj->get_one();
        if ($one['adm_power'] == 'all') {
            $flag = 1;
        } elseif ($one['adm_power'] != '') {
            $val = $global['channel'] . '/mod-' . $global['mod'];
            $urls = explode('|', $one['adm_power']);
            for ($i = 0; $i < count($urls); $i++) {
                if ($urls[$i] == '/' . $val . '/') {
                    $flag = 1;
                    break;
                }
            }
            if ($flag == 0) {
                $obj = new menu();
                $obj->set_where('');
                $obj->set_where("men_url like '%" . $val . "%'");
                if ($obj->get_count() == 0) {
                    $flag = 1;
                }
            }
        }
    }
    return $flag;
}
开发者ID:jechiy,项目名称:xiu-cms,代码行数:31,代码来源:common.func.php

示例2: get_power_arr

function get_power_arr()
{
    $arr = array();
    $obj = new menu();
    $obj->set_where('');
    $obj->set_where("left(men_type,6) = 'admin_'");
    $list = $obj->get_list();
    for ($i = 0; $i < count($list); $i++) {
        $arr[$i]['name'] = $list[$i]['men_name'];
        $arr[$i]['url'] = '/' . $list[$i]['men_url'];
        $arr[$i]['set'] = 0;
    }
    return $arr;
}
开发者ID:jechiy,项目名称:xiu-cms,代码行数:14,代码来源:admin_power.php

示例3: module_left

function module_left()
{
    global $global, $smarty;
    if ($global['channel'] == 'about' || $global['channel'] == 'recruit' || $global['channel'] == 'download') {
        $type = 'article';
    } else {
        $type = $global['channel'];
    }
    $obj = new menu();
    $obj->set_field('men_name,men_url');
    $obj->set_where('');
    $obj->set_where("men_lang = 'none'");
    $obj->set_where("men_type = 'admin_" . $type . "'");
    $obj->set_where("men_show = 1");
    $smarty->assign('nav_left', $obj->get_list());
}
开发者ID:jechiy,项目名称:xiu-cms,代码行数:16,代码来源:left.php

示例4: edit_nav

function edit_nav()
{
    global $smarty, $lang;
    for ($i = 0; $i < count($_POST['id']); $i++) {
        $word = strict($_POST['word'][$i]);
        $link = strict($_POST['link'][$i]);
        $id = strict($_POST['id'][$i]);
        $obj = new menu();
        $obj->set_value('men_name', $word);
        $obj->set_value('men_url', $link);
        $obj->set_where('');
        $obj->set_where("men_id = {$id}");
        $obj->edit();
    }
    $smarty->assign('info_text', '修改导航成功');
    $smarty->assign('link_text', '返回上一页');
    $smarty->assign('link_href', url(array('channel' => 'super', 'mod' => 'nav_list')));
}
开发者ID:jechiy,项目名称:xiu-cms,代码行数:18,代码来源:deal.php

示例5: module_nav_list

function module_nav_list()
{
    global $smarty;
    $obj = new varia();
    $obj->set_where("left(var_name,10) = 'nav_admin_'");
    $arr = $obj->get_list();
    for ($i = 0; $i < count($arr); $i++) {
        $name = substr($arr[$i]['var_name'], 4);
        $obj = new menu();
        $obj->set_where('');
        $obj->set_where("men_type = '{$name}'");
        $list[$name] = $obj->get_list();
        $nav[$i]['type'] = $name;
        $nav[$i]['name'] = $arr[$i]['var_value'];
    }
    $smarty->assign('nav', $nav);
    $smarty->assign('list', $list);
}
开发者ID:jechiy,项目名称:xiu-cms,代码行数:18,代码来源:nav_list.php

示例6: module_header

function module_header()
{
    global $smarty;
    $obj = new varia();
    $obj->set_where("var_name = 'languages'");
    $list = $obj->get_list();
    for ($i = 0; $i < count($list); $i++) {
        $arr = explode('{v}', $list[$i]['var_value']);
        $list[$i]['pack_name'] = $arr[0];
        $list[$i]['index_entrance'] = $arr[1];
        $list[$i]['admin_entrance'] = $arr[2];
        $list[$i]['chinese_name'] = $arr[3];
        $list[$i]['foreign_name'] = $arr[4];
    }
    $smarty->assign('lang_pack', $list);
    $obj = new menu();
    $obj->set_field('men_name,men_url');
    $obj->set_where('');
    $obj->set_where("men_lang = 'none'");
    $obj->set_where("men_type = 'admin_header'");
    $obj->set_where("men_show = 1");
    $smarty->assign('nav_header', $obj->get_list());
}
开发者ID:jechiy,项目名称:xiu-cms,代码行数:23,代码来源:header.php

示例7: module_footer

function module_footer()
{
    global $smarty;
    $obj = new menu();
    $obj->set_where("men_type = 'footer'");
    $smarty->assign('footer_nav', $obj->get_list());
    $obj = new varia();
    $site['domain'] = $obj->get_value('site_domain');
    $site['record'] = $obj->get_value('site_record');
    $site['record_url'] = $obj->get_value('site_record_url');
    $site['tech'] = $obj->get_value('site_tech');
    $site['tech_url'] = $obj->get_value('site_tech_url');
    $site['statistical_code'] = im_filter($obj->get_value('statistical_code', true));
    $smarty->assign('site', $site);
}
开发者ID:jechiy,项目名称:xiu-cms,代码行数:15,代码来源:footer.php

示例8: do_del_channel

function do_del_channel($channel_id)
{
    //判断频道是否已存在
    $obj = new channel();
    $obj->set_where('');
    $obj->set_where("cha_id = {$channel_id}");
    $channel = $obj->get_one();
    if (count($channel)) {
        $cha_code = $channel['cha_code'];
        $obj->del();
    } else {
        return 0;
    }
    //删除前台导航(导航管理)
    $obj = new varia();
    $obj->set_where("var_name = 'nav_stage_" . $cha_code . "'");
    $obj->del();
    //删除后台导航(导航管理)
    $obj->set_where('');
    $obj->set_where("var_name = 'nav_admin_" . $cha_code . "'");
    $obj->del();
    //删除后台导航菜单
    $obj = new menu();
    $obj->set_where("men_type = '{$cha_code}'");
    $obj->del();
    $obj->set_where('');
    $obj->set_where("men_type = 'admin_header'");
    $obj->set_where("men_url = '" . $cha_code . "/mod-sheet/'");
    $obj->del();
    $obj->set_where('');
    $obj->set_where("men_type = 'admin_" . $cha_code . "'");
    $obj->set_where("men_url = '" . $cha_code . "/mod-sheet/'");
    $obj->del();
    $obj->set_where('');
    $obj->set_where("men_type = 'admin_" . $cha_code . "'");
    $obj->set_where("men_url = '" . $cha_code . "/mod-add/'");
    $obj->del();
    $obj->set_where('');
    $obj->set_where("men_type = 'admin_" . $cha_code . "'");
    $obj->set_where("men_url = '" . $cha_code . "/mod-cat_list/'");
    $obj->del();
    $obj->set_where('');
    $obj->set_where("men_type = 'admin_" . $cha_code . "'");
    $obj->set_where("men_url = '" . $cha_code . "/mod-att_list/'");
    $obj->del();
    //删除前台导航菜单
    $obj = new menu();
    $obj->set_where("men_type = 'header'");
    $obj->set_where("men_url = '" . $cha_code . "/'");
    $obj->del();
    //删除分类
    $obj = new cat_art();
    $obj->set_where('');
    $obj->set_where("cat_channel_id = {$channel_id}");
    $obj->del();
    //删除内容
    $obj = new article();
    $obj->set_where('');
    $obj->set_where("art_channel_id = {$channel_id}");
    $obj->del();
    //删除属性
    $obj = new att_art();
    $obj->set_where('');
    $obj->set_where("att_channel_id = {$channel_id}");
    $obj->del();
    //删除语言包
    $path = 'languages/' . S_LANG . '/admin/' . $cha_code . '.txt';
    if (file_exists($path)) {
        unlink($path);
    }
    $path = 'languages/' . S_LANG . '/index/' . $cha_code . '.txt';
    if (file_exists($path)) {
        unlink($path);
    }
    //修改伪静态文件
    $path = 'admin/module/basic/htaccess.txt';
    if (file_exists($path)) {
        $str = file_get_contents($path);
        $rule = "\n" . 'RewriteRule ^' . $cha_code . '/(.*)$ index.php?/' . $cha_code . '/$1';
        $str = str_replace($rule, '', $str);
        file_put_contents($path, $str);
    }
    return 1;
}
开发者ID:jechiy,项目名称:xiu-cms,代码行数:84,代码来源:function.php


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