Example #1
0
         $templatefile = $moduleRoot . WEB_APP . 'templates/' . 'downloads_class_list.tpl.php';
     }
     break;
 case 'edit':
     //
     if (isset($submit)) {
         $info = array();
         $time = time();
         if (isset($id)) {
             $id = intval($id);
             if ($id <= 0) {
                 errorinfo('变量错误', '');
             }
             //20120719
             checkClassPower('downloads', $id);
             $infoold = $downloads_class->GetInfo('', ' id = ' . $id);
             //改变分类从属判断
             if ($parentid != $infoold['parentid']) {
                 $classNum = $downloads_class->GetClassCount($id);
                 if ($classNum > 0) {
                     errorinfo('对不起,该分类有子分类', '');
                 }
             }
         }
         //分析根分类
         if ($parentid == 0) {
             $rootid = 0;
         } else {
             $parent = $downloads_class->GetInfo('', ' id = ' . $parentid);
             if ($parent['parentid'] == 0) {
                 $rootid = $parentid;
Example #2
0
    $v->Validate($filename, '变量', 'safein', '1', '', 0, 100);
}
$where = ' 1 = 1 ';
switch ($a) {
    case 'list':
    default:
        //list
        if (empty($classid)) {
        } else {
            $where = $where . ' and id = ' . $classid . ' ';
        }
        if (isset($filename) && !empty($filename)) {
            $where = $where . " and `filename` = '" . $filename . "' ";
        }
        $info = array();
        $info = $downloads_class->GetInfo(array('id', 'title', 'seotitle', 'seokeyword', 'seointro', 'filename', 'listnum', 'linkurl', 'intro', 'thumb'), $where);
        if (empty($info)) {
            $errorInfo = '变量错误';
            errorinfo($errorInfo, '');
        }
        //20120919
        if (isset($filename) && !empty($filename)) {
            $classid = $info['id'];
        }
        $topTitle = $info['title'];
        //20120808 //20120919
        if (empty($classid) && empty($filename)) {
            $topTitle = '列表';
        }
        //seo新增 20120706
        if (!empty($info['seotitle'])) {