public function move()
 {
     if (IS_POST) {
         $catid = I('category_id');
         if (!empty($catid)) {
             $id = I('id');
             $map = array();
             $map['article_id'] = array('in', $id);
             $result = M('article')->where($map)->save(array('category_id' => $catid));
             //				$sql="update __DB_PREFIX__.'Article set category_id=$catid where id in($id)";
             //				$result=M('article')->query($sql);
             if (0 < $result) {
                 $this->success('文档移动成功', U('index', array('category_id' => $catid)));
             } else {
                 $this->error('文档移动失败');
             }
         }
         //分类树
         $catelist = F('sys_category_tree');
         if (empty($catelist)) {
             $catelist = get_cate_list();
             F('sys_category_tree', $catelist);
         }
         unset($catelist[0]);
         $field = array(array('field' => 'category_id', 'name' => 'category_id', 'type' => 'select', 'title' => '所属分类', 'note' => '', 'extra' => $catelist, 'is_show' => 3));
         $this->assign('fieldarr', $field);
         $this->assign('data', null);
         $this->meta_title = '移动文档';
         $this->display();
     } else {
         redirect(U('/'));
     }
 }
Exemple #2
0
function get_cate_list($pid = 0, $child = false, $type = 'article')
{
    global $menu_lev;
    $menu_lev++;
    $rearr = array();
    if (!$child and empty($rearr)) {
        $rearr[0] = '请选择----';
    }
    $where['status'] = 1;
    $where['pid'] = $pid;
    $where['category_type'] = $type;
    //if(!APP_DEBUG)$where['dev_show']=0;
    $list = M('category')->where($where)->order('sort asc')->select();
    if ($list) {
        foreach ($list as $val) {
            if ($child) {
                $rearr[$val['category_id']] = get_space($menu_lev) . $val['title'];
            } else {
                $rearr[$val['category_id']] = $val['title'];
            }
            $temarr = get_cate_list($val['category_id'], true, $type);
            foreach ($temarr as $key => $v) {
                $rearr[$key] = $v;
            }
        }
    }
    $menu_lev--;
    return $rearr;
}
Exemple #3
0
    header('Location: ' . $settings[phpdisk_url] . urr("hotfile", ""));
    exit;
}
$o_type_tit = array('d_all' => __('d_all_tit'), 'd_day' => date('Y-m-d', strtotime('-1 day')) . __('d_day_tit'), 'd_3day' => __('d_3day_tit'), 'd_now_week' => __('d_now_week_tit'), 'd_week' => __('d_week_tit'), 'd_month' => __('d_month_tit'));
$nav_title = $o_type_tit[$o_type];
$title = $nav_title . ' - ' . $settings['site_title'];
if ($auth[pd_a]) {
    $seo = get_seo('hotfile', $cate_id);
    if ($seo[title]) {
        eval("\$title = \"{$seo['title']}\";");
    }
    eval("\$keywords = \"{$seo['keywords']}\";");
    eval("\$description = \"{$seo['description']}\";");
}
include PHPDISK_ROOT . "./includes/header.inc.php";
$C[cate_list] = get_cate_list();
$cate_sql = $cate_id ? " and cate_id='{$cate_id}'" : '';
if ($o_type == 'd_all') {
    $sql_do = " {$tpf}files fl,{$tpf}users u where fl.userid=u.userid and fl.is_del=0";
} else {
    switch ($o_type) {
        case 'd_day':
            $d_val = date('Ymd', strtotime('-1 day'));
            break;
        case 'd_3day':
            $d = array();
            $d[] = date('Ymd', strtotime('-2 day'));
            $d[] = date('Ymd', strtotime('-1 day'));
            $d[] = date('Ymd');
            $d_str = implode(',', $d);
        case 'd_now_week':
Exemple #4
0
function get_cate_list($cate, $parent, $haschild, $level = 0)
{
    if ($haschild) {
        $level = $level + 1;
        foreach ($cate as $k => $v) {
            if ($parent == $v['cate_parent']) {
                $channel_info = get_cate_info($v['cate_channel'], $GLOBALS['channel']);
                //获得内容模型信息
                $list_php = empty($channel_info['list_php']) ? 'show_list.php' : $channel_info['list_php'];
                $list_php = $v['cate_channel'] == '-9' ? 'order/order.php' : $list_php;
                if ($v['cate_channel'] == 1) {
                    $is_cate_type = '[<font style="color:red">单页</font>]';
                } elseif ($v['cate_channel'] == '-9') {
                    $is_cate_type = '[<font style="color:#0000FF">表单</font>]';
                }
                //$kong=get_kong($level);
                $pd = $level * 10;
                $is_gd = $v['cate_tpl'] == 1 ? '&nbsp;<span style="color:red">引导栏目</span>' : '';
                echo "<div id=\"catagory\" style=\"display:none\">";
                echo "<div id=\"border\" style=\"border-bottom:1px dashed #ccc; padding:2px 0;height:25px; line-height:25px;\"><div class=\"left\" id=\"show\" style=\"padding-left:" . $pd . "px; cursor:pointer\"><span class=\"exp\" onclick=\"show_list(this);\">&nbsp;</span><span class=\"cata\"><a href=\"" . CMS_SELF . $list_php . "?id={$v['id']}\" target=\"_blank\">" . $is_cate_type . $v['cate_name'] . "</a>(<span style=\"color:#999\">排序</span><em rel=\"order\" style=\"font-style:normal; padding:0 8px;\" id=\"order_num\"><span id=\"" . $v['id'] . "\">" . $v['cate_order'] . "</span></em>&nbsp;<span style=\"color:#999\">栏目id</span>:" . $v['id'] . "&nbsp;<span style=\"color:#999\">模板标示ID:</span><em rel=\"tpl\" style=\"font-style:normal; padding:0 8px;\" id=\"order_num\"><span id=\"" . $v['id'] . "\">" . $v['temp_id'] . "</span></em>" . $is_gd . ")";
                $cate_nav = empty($v['cate_nav']) ? array('') : explode(',', $v['cate_nav']);
                echo in_array('2', $cate_nav) ? "<span style=\"color:#3366FF\">导航中部显示</span>" : "";
                echo in_array('3', $cate_nav) ? "<span style=\"color:#FFCC66\">导航底部显示</span>" : "";
                if ($v['cate_hide']) {
                    echo "<span style=\"color:red; padding:0 3px;\">隐藏</span>";
                }
                $href = $v['cate_channel'] == 1 ? "href=\"admin_content_alone.php?cate_id={$v['id']}&lang={$v['lang']}\"" : "href=\"admin_content.php?action=add&id={$v['cate_channel']}&cate={$v['id']}&lang={$v['lang']}\"";
                $href2 = $v['cate_channel'] == 1 ? "href=\"admin_content_alone.php?action=content_list\"" : "href=\"admin_content.php?action=content_list&id={$v['cate_channel']}&cate={$v['id']}&lang={$v['lang']}\"";
                echo "</span></div>";
                echo "<div class=\"right\"><span class=\"caozuo\"><a href=\"?action=child&parent=" . $v['id'] . "&channel_id=" . $v['cate_channel'] . "&lang=" . $GLOBALS['lang'] . "\">增加下级栏目</a>" . $add_content_str . "|<a href=\"?action=xg&lang=" . $GLOBALS['lang'] . "&id=" . $v['id'] . "&parent=" . $v['cate_parent'] . "\">修改栏目</a>|<a href=\"?action=move_cate&cate=" . $v['id'] . "&lang=" . $GLOBALS['lang'] . "\">移动栏目</a>|<a href=\"javascript:if(confirm('确定要删除么,删除后不可恢复!')){location.href='?action=del&lang=" . $GLOBALS['lang'] . "&id=" . $v['id'] . "&parent=" . $parent . "';}\">删除栏目</a></span></div>";
                echo "<div style=\"clear:both\"></div></div>";
                unset($cate[$k]);
                get_cate_list($cate, $v['id'], $v['haschild'], $level);
                echo "</div>";
            }
        }
        $level = $level - 1;
    }
}