示例#1
0
            if (is_array($id)) {
                $ids = $id;
            } else {
                $ids[] = $id;
            }
        } else {
            errorinfo('变量错误', '');
        }
        foreach ($ids as $key => $value) {
            $value = intval($value);
            if ($value <= 0) {
                errorinfo('变量错误', '');
            }
            //20120719
            checkClassPower('downloads', $value);
            $classNum = $downloads_class->GetClassCount($value);
            if ($classNum > 0) {
                errorinfo('对不起,该分类(' . $value . ')有子分类', '');
            }
            $infoNum = $downloads->GetInfoCount($value);
            if ($infoNum > 0) {
                errorinfo('对不起,该分类(' . $value . ')下有内容', '');
            }
        }
        if ($downloads_class->Del($ids)) {
            errorinfo('删除成功', '');
        } else {
            errorinfo('删除失败', '');
        }
        break;
}
示例#2
0
 }
 if (is_file(WEB_MOD . $modulename . '_class' . '.class.php')) {
     include_once WEB_MOD . $modulename . '_class' . '.class.php';
 } elseif (is_file(WEB_MODULE . $modulename . '/model/' . $modulename . '_class' . '.class.php')) {
     include_once WEB_MODULE . $modulename . '/model/' . $modulename . '_class' . '.class.php';
 }
 $userinfo = array();
 $time = time();
 if (isset($userid)) {
     $userid = intval($userid);
     if ($userid <= 0) {
         errorinfo('变量错误', '');
     }
     $userinfo = $users->GetInfo('', ' id = ' . $userid);
     if (empty($userinfo)) {
         errorinfo('变量错误', '');
     }
 }
 $info = array();
 $info = $users_classpower->GetInfo('', " userid = " . $userid . " and modulename = '" . $modulename . "' ");
 if (!empty($info)) {
     if (isset($info['classpower'])) {
         $power = array();
         $power = explode(",", $info['classpower']);
         foreach ($power as $key => $value) {
             $power_list[$value] = true;
         }
     }
 }
 $theModuleClass = '' . ucfirst($modulename . '_class');
 $theModule = new $theModuleClass();
示例#3
0
     $preinfo = $t_r[0];
 }
 $sql = " select * from  {tablepre}articles where classid = {$classid} and id > " . $info['id'] . " order by id asc limit 0,1 ";
 //echo $sql;
 $db->Execute($sql);
 $t_r = $db->GetArray();
 if ($t_r) {
     $nextinfo = $t_r[0];
 }
 //点击统计 待添加
 $clicks = $info['clicks'] + 1;
 $articles->Update(array('clicks' => $clicks), $where);
 //信息审核
 if ($info['isplay'] == '0') {
     $errorInfo = '该信息未审核';
     errorinfo($errorInfo, '');
 }
 //转连接
 if (!empty($info['linkurl'])) {
     header("Location: " . $info['linkurl'] . "");
     exit;
 }
 $topTitle = $info['title'];
 //seo新增 20120409
 if (!empty($info['seotitle'])) {
     $topTitle = $info['seotitle'];
 }
 if (!empty($info['seokeyword'])) {
     $sys['webkeywords'] = $info['seokeyword'];
 }
 if (!empty($info['seointro'])) {
示例#4
0
文件: index.php 项目: zrwlc2008/abhx
* @author LEI
* @version 1.1.2
* @time 20111004
*/
//初始化
$pagetitle = '安装系统';
//功能部分
//安装检测
if (file_exists(WEB_DATA . 'install.lock')) {
    errorinfo('安程程序已经锁定!如果您要重新安装,请删除 install.lock 文件!', '');
}
if (!file_exists('zcncms.sql')) {
    errorinfo("缺少安装文件:zcncms.sql,请检查!", '');
}
if (!file_exists('zcncms_default.sql')) {
    errorinfo("缺少安装文件:zcncms_default.sql,请检查!", '');
}
switch ($a) {
    case 'step1':
    default:
        //list
        $templatefile = 'index.tpl.php';
        break;
    case 'step2':
        $templatefile = 'indexstep2.tpl.php';
        break;
    case 'install':
        include 'install.inc.php';
        break;
    case 'checkconnect_ajax':
        $conn = mysql_connect($mysql_host, $mysql_name, $mysql_pass);
示例#5
0
    $config['moduleName'] = in_module($controller);
    if (!$config['moduleName']) {
        errorinfo('Sorry,module not found!');
    }
    $filepath = WEB_MODULE . $config['moduleName'] . '/' . WEB_APP . 'controller/' . $controller . '_' . $action . '.php';
    $filepath1 = WEB_MODULE . $config['moduleName'] . '/' . WEB_APP . 'controller/' . $controller . '.php';
} else {
    errorinfo('Sorry,method not found!');
}
//echo $filepath;
if (is_file($filepath)) {
    include $filepath;
} elseif (is_file($filepath1)) {
    include $filepath1;
} else {
    errorinfo('Sorry,file not found!');
}
if (!empty($templatefile)) {
    include WEB_INC . '/template.inc.php';
}
//20120717
function in_module($c)
{
    global $config;
    $modtype = $config['modtype_module_arr'];
    foreach ($modtype as $key => $value) {
        if (in_array($c, $value)) {
            return $key;
        }
    }
    return false;
示例#6
0
文件: index.php 项目: zrwlc2008/abhx
<?php

/**
* ZCNCMS
* 后台主显示
* php>=5.0
* @author LEI
* @version 1.1.2
* @time 20111004
*/
//初始化
$pagetitle = '管理主页';
$pagepower = '999';
//基本部分
require 'checkpower.inc.php';
//功能部分
if ($a == 'clear_cache') {
    clear_cache();
    errorinfo('缓存清理完毕', '');
}
$templatefile = 'index.tpl.php';
function clear_cache()
{
    $tmp_path = WEB_CACHE;
    //$tmp_my_path=dir($tmp_path);
    if (!class_exists('files')) {
        include_once WEB_INC . 'file.class.php';
    }
    $FS = new files();
    $FS->file_Delete($tmp_path);
}
示例#7
0
        //插入管理员
        $sql = "insert into {$install_tablepre}" . "users(username,password,classid,email,power) values('{$adminuser}','" . md5($adminpas) . "','1','','')";
        //echo $sql;
        if ($pdo->exec($sql)) {
            //echo '成功';
        }
        //更改配置
        $db_config = "";
        $db_config .= "<?php\n";
        $db_config .= "//数据库配置\n";
        $db_config .= "\$db_type='1';\n";
        $db_config .= "\$db_host='{$sqlite_table}';\n";
        $db_config .= "\$db_name='{$sqlite_name}';\n";
        $db_config .= "\$db_pass='******';\n";
        $db_config .= "\$db_table='{$sqlite_tab}';\n";
        $db_config .= "\$db_tablepre='{$install_tablepre}';\n";
        $db_config .= "\$db_ut='utf8';\n";
        $db_config .= "?>";
        require "../include/file.class.php";
        $f = new FILES();
        $f->setText($db_config);
        $f->saveToFile('../include/dataconfig.inc.php');
        //加安装锁
        @touch("../data/install.lock");
        if ($rs == '1') {
            errorinfo("程序安装成功,请点击<a href='../'>此处</a>进入网站!", '');
        }
    } else {
        errorinfo("数据库信息有误!", '');
    }
}
示例#8
0
文件: books.php 项目: zrwlc2008/abhx
     			);
     */
     //生成成订单号,年月日+时间戳
     $book_code = date('Ymd') . time();
     $info = array('mobile' => $mobile, 'addr' => $addr, 'classid' => $classid, 'niname' => $niname, 'addtime' => $time, 'ipaddr' => GetIP(), 'isok' => '1', 'isplay' => '1', 'product_id' => $product_id, 'pay_type' => $pay_type, 'book_code' => $book_code);
     if (isset($id)) {
         //只有添加
     } else {
         if ($img_code == $_SESSION['randcode']) {
             if ($books->Add($info)) {
                 errorinfo('信息反馈成功', '?c=books&a=add');
             } else {
                 errorinfo('信息反馈失败', '');
             }
         } else {
             errorinfo('验证码输入有误', '');
         }
     }
 } else {
     if (!isset($classid)) {
         $classid = 1;
     }
     $classid = intval($classid);
     if ($classid < 1) {
         $classid = 1;
     }
     if (is_file(WEB_TPL . 'books_add.tpl.php')) {
         $templatefile = 'books_add.tpl.php';
     } else {
         $tpl_in_module = 1;
         $templatefile = $moduleRoot . 'templates/' . 'books_add.tpl.php';