Beispiel #1
0
    $yhadd = ReturnYhSql($yhid, $yhvar, 1);
}
//总数
$totalnum = (int) $_GET['totalnum'];
if ($totalnum < 1) {
    if ($yhadd) {
        $totalquery = "select count(*) as total from {$dbtbpre}ecms_" . $tbname . " where " . $yhadd . $add;
        $num = $empire->gettotal($totalquery);
    } else {
        $num = ReturnClassInfoNum($cr, 0);
    }
} else {
    $num = $totalnum;
}
$search .= '&totalnum=' . $num;
$query = "select " . ReturnSqlListF($mid) . " from {$dbtbpre}ecms_" . $tbname . " where " . $yhadd . $add;
$query .= " order by " . ReturnSetTopSql('list') . $addorder . " limit {$offset},{$line}";
$sql = $empire->query($query);
//伪静态
$pagefunr = eReturnRewriteClassUrl($classid, 0);
$pagefunr['repagenum'] = $cr['repagenum'];
$pagefunr['dolink'] = empty($class_r[$classid]['classurl']) ? $public_r['newsurl'] . $class_r[$classid]['classpath'] . '/' : $class_r[$classid]['classurl'] . '/';
$pagefunr['dofile'] = 'index';
$pagefunr['dotype'] = $class_r[$classid]['classtype'];
//分页
if ($pagefunr['rewrite'] == 1 || $pagefunr['repagenum']) {
    $listpage = InfoUsePage($num, $line, $page_line, $start, $page, $search, $pagefunr);
} else {
    $listpage = page1($num, $line, $page_line, $start, $page, $search);
}
//页面支持标签
Beispiel #2
0
}
$modid = $class_r[$classid][modid];
//优化
$yhid = $class_r[$classid][yhid];
$yhvar = 'qlist';
$yhadd = '';
if ($yhid) {
    $yhadd = ReturnYhSql($yhid, $yhvar, 1);
}
$search .= "&classid={$classid}&style={$wapstyle}&bclassid={$bclassid}";
$page = intval($_GET['page']);
$page = RepPIntvar($page);
$line = $pr['waplistnum'];
//每页显示记录数
$offset = $page * $line;
$query = "select " . ReturnSqlListF($modid) . " from {$dbtbpre}ecms_" . $class_r[$classid]['tbname'] . " where " . $yhadd . $add;
$totalnum = intval($_GET['totalnum']);
if ($totalnum < 1) {
    $totalquery = "select count(*) as total from {$dbtbpre}ecms_" . $class_r[$classid]['tbname'] . " where " . $yhadd . $add;
    $num = $empire->gettotal($totalquery);
    //取得总条数
} else {
    $num = $totalnum;
}
$search .= "&totalnum={$num}";
//排序
if (empty($class_r[$classid][reorder])) {
    $addorder = "newstime desc";
} else {
    $addorder = $class_r[$classid][reorder];
}
Beispiel #3
0
    }
    $yhid = $class_r[$classid][yhid];
    $search .= "&classid={$classid}";
}
//优化
$yhadd = '';
if ($yhid) {
    $yhadd = ReturnYhSql($yhid, $yhvar);
}
$start = 0;
$page = intval($_GET['page']);
$line = $public_r['space_num'];
//每行显示
$page_line = 16;
$offset = $page * $line;
$query = "select " . ReturnSqlListF($mid) . " from {$dbtbpre}ecms_" . $mr['tbname'] . " where " . $yhadd . $add . " and ismember=1 and checked=1";
$totalquery = "select count(*) as total from {$dbtbpre}ecms_" . $mr['tbname'] . " where " . $yhadd . $add . " and ismember=1 and checked=1";
$totalnum = intval($_GET['totalnum']);
if ($totalnum < 1) {
    $num = $empire->gettotal($totalquery);
    //取得总条数
} else {
    $num = $totalnum;
}
$search .= "&totalnum={$num}";
$query .= " order by newstime desc limit {$offset},{$line}";
$sql = $empire->query($query);
$returnpage = page1($num, $line, $page_line, $start, $page, $search);
require 'template/' . $spacestyle . '/list.temp.php';
db_close();
$empire = null;
function sys_ReturnBqQuery($classid, $line, $enews = 0, $do = 0, $ewhere = '', $eorder = '')
{
    global $empire, $public_r, $class_r, $class_zr, $navclassid, $do_openbqquery, $dbtbpre, $fun_r, $class_tr, $emod_r, $etable_r, $eyh_r;
    if ($enews == 24 && $do_openbqquery == 1) {
        $query_first = substr($classid, 0, 7);
        if (!($query_first == 'select ' || $query_first == 'SELECT ')) {
            return "";
        }
        $classid = RepSqlTbpre($classid);
        $sql = $empire->query1($classid);
        if (!$sql) {
            echo "SQL Error: " . ReRepSqlTbpre($classid);
        }
        return $sql;
    }
    if ($enews == 0 || $enews == 1 || $enews == 2 || $enews == 9 || $enews == 12 || $enews == 15) {
        if (strstr($classid, ',')) {
            $son_r = sys_ReturnMoreClass($classid, 1);
            $classid = $son_r[0];
            $where = $son_r[1];
        } else {
            if ($classid == 'selfinfo') {
                $classid = $navclassid;
            }
            if ($class_r[$classid][islast]) {
                $where = "classid='{$classid}'";
            } else {
                $where = ReturnClass($class_r[$classid][sonclass]);
            }
        }
        $tbname = $class_r[$classid][tbname];
        $mid = $class_r[$classid][modid];
        $yhid = $class_r[$classid][yhid];
    } elseif ($enews == 6 || $enews == 7 || $enews == 8 || $enews == 11 || $enews == 14 || $enews == 17) {
        if (strstr($classid, ',')) {
            $son_r = sys_ReturnMoreZt($classid);
            $classid = $son_r[0];
            $where = $son_r[1];
        } else {
            if ($classid == 'selfinfo') {
                $classid = $navclassid;
            }
            $where = "ztid like '%|" . $classid . "|%'";
        }
        $tbname = $class_zr[$classid][tbname];
        $mid = $etable_r[$tbname][mid];
        $yhid = $class_zr[$classid][yhid];
    } elseif ($enews == 25 || $enews == 26 || $enews == 27 || $enews == 28 || $enews == 29 || $enews == 30) {
        if (strstr($classid, ',')) {
            $son_r = sys_ReturnMoreTT($classid);
            $classid = $son_r[0];
            $where = $son_r[1];
        } else {
            $where = "ttid='{$classid}'";
        }
        $mid = $class_tr[$classid][mid];
        $tbname = $emod_r[$mid][tbname];
        $yhid = $class_tr[$classid][yhid];
    }
    if ($enews == 0) {
        $query = '(' . $where . ') and checked=1';
        $order = 'newstime';
        $yhvar = 'bqnew';
    } elseif ($enews == 1) {
        $query = '(' . $where . ') and checked=1';
        $order = 'onclick';
        $yhvar = 'bqhot';
    } elseif ($enews == 2) {
        $query = '(' . $where . ') and isgood>0 and checked=1';
        $order = 'newstime';
        $yhvar = 'bqgood';
    } elseif ($enews == 9) {
        $query = '(' . $where . ') and checked=1';
        $order = 'plnum';
        $yhvar = 'bqpl';
    } elseif ($enews == 12) {
        $query = '(' . $where . ') and firsttitle>0 and checked=1';
        $order = 'newstime';
        $yhvar = 'bqfirst';
    } elseif ($enews == 15) {
        $query = '(' . $where . ') and checked=1';
        $order = 'totaldown';
        $yhvar = 'bqdown';
    } elseif ($enews == 3) {
        $query = 'checked=1';
        $order = 'newstime';
        $tbname = $public_r[tbname];
        $mid = $etable_r[$tbname][mid];
        $yhvar = 'bqnew';
        $yhid = $etable_r[$tbname][yhid];
    } elseif ($enews == 4) {
        $query = 'checked=1';
        $order = 'onclick';
        $tbname = $public_r[tbname];
        $mid = $etable_r[$tbname][mid];
        $yhvar = 'bqhot';
        $yhid = $etable_r[$tbname][yhid];
    } elseif ($enews == 5) {
        $query = 'isgood>0 and checked=1';
        $order = 'newstime';
        $tbname = $public_r[tbname];
        $mid = $etable_r[$tbname][mid];
        $yhvar = 'bqgood';
        $yhid = $etable_r[$tbname][yhid];
    } elseif ($enews == 10) {
        $query = 'checked=1';
        $order = 'plnum';
        $tbname = $public_r[tbname];
        $mid = $etable_r[$tbname][mid];
        $yhvar = 'bqpl';
        $yhid = $etable_r[$tbname][yhid];
    } elseif ($enews == 13) {
        $query = 'firsttitle>0 and checked=1';
        $order = 'newstime';
        $tbname = $public_r[tbname];
        $mid = $etable_r[$tbname][mid];
        $yhvar = 'bqfirst';
        $yhid = $etable_r[$tbname][yhid];
    } elseif ($enews == 16) {
        $query = 'checked=1';
        $order = 'totaldown';
        $tbname = $public_r[tbname];
        $mid = $etable_r[$tbname][mid];
        $yhvar = 'bqdown';
        $yhid = $etable_r[$tbname][yhid];
    } elseif ($enews == 6) {
        $query = '(' . $where . ') and checked=1';
        $order = 'newstime';
        $yhvar = 'bqnew';
    } elseif ($enews == 7) {
        $query = '(' . $where . ') and checked=1';
        $order = 'onclick';
        $yhvar = 'bqhot';
    } elseif ($enews == 8) {
        $query = '(' . $where . ') and isgood>0 and checked=1';
        $order = 'newstime';
        $yhvar = 'bqgood';
    } elseif ($enews == 11) {
        $query = '(' . $where . ') and checked=1';
        $order = 'plnum';
        $yhvar = 'bqpl';
    } elseif ($enews == 14) {
        $query = '(' . $where . ') and firsttitle>0 and checked=1';
        $order = 'newstime';
        $yhvar = 'bqfirst';
    } elseif ($enews == 17) {
        $query = '(' . $where . ') and checked=1';
        $order = 'totaldown';
        $yhvar = 'bqdown';
    } elseif ($enews == 18) {
        $query = 'checked=1';
        $order = 'newstime';
        $tbname = $classid;
        $mid = $etable_r[$tbname][mid];
        $yhvar = 'bqnew';
        $yhid = $etable_r[$tbname][yhid];
    } elseif ($enews == 19) {
        $query = 'checked=1';
        $order = 'onclick';
        $tbname = $classid;
        $mid = $etable_r[$tbname][mid];
        $yhvar = 'bqhot';
        $yhid = $etable_r[$tbname][yhid];
    } elseif ($enews == 20) {
        $query = 'isgood>0 and checked=1';
        $order = 'newstime';
        $tbname = $classid;
        $mid = $etable_r[$tbname][mid];
        $yhvar = 'bqgood';
        $yhid = $etable_r[$tbname][yhid];
    } elseif ($enews == 21) {
        $query = 'checked=1';
        $order = 'plnum';
        $tbname = $classid;
        $mid = $etable_r[$tbname][mid];
        $yhvar = 'bqpl';
        $yhid = $etable_r[$tbname][yhid];
    } elseif ($enews == 22) {
        $query = 'firsttitle>0 and checked=1';
        $order = "newstime";
        $tbname = $classid;
        $mid = $etable_r[$tbname][mid];
        $yhvar = 'bqfirst';
        $yhid = $etable_r[$tbname][yhid];
    } elseif ($enews == 23) {
        $query = 'checked=1';
        $order = 'totaldown';
        $tbname = $classid;
        $mid = $etable_r[$tbname][mid];
        $yhvar = 'bqdown';
        $yhid = $etable_r[$tbname][yhid];
    } elseif ($enews == 25) {
        $query = '(' . $where . ') and checked=1';
        $order = 'newstime';
        $yhvar = 'bqnew';
    } elseif ($enews == 26) {
        $query = '(' . $where . ') and checked=1';
        $order = 'onclick';
        $yhvar = 'bqhot';
    } elseif ($enews == 27) {
        $query = '(' . $where . ') and isgood>0 and checked=1';
        $order = 'newstime';
        $yhvar = 'bqgood';
    } elseif ($enews == 28) {
        $query = '(' . $where . ') and checked=1';
        $order = 'plnum';
        $yhvar = 'bqpl';
    } elseif ($enews == 29) {
        $query = '(' . $where . ') and firsttitle>0 and checked=1';
        $order = 'newstime';
        $yhvar = 'bqfirst';
    } elseif ($enews == 30) {
        $query = '(' . $where . ') and checked=1';
        $order = 'totaldown';
        $yhvar = 'bqdown';
    }
    //不调用
    if (!strstr($public_r['nottobq'], ',' . $classid . ',')) {
        $query .= ReturnNottoBqWhere();
    }
    //附加条件
    if (!empty($ewhere)) {
        $query .= ' and (' . $ewhere . ')';
    }
    //图片信息
    if (!empty($do)) {
        $query .= ' and ispic=1';
    }
    //中止
    if (empty($tbname)) {
        echo $fun_r['BqErrorCid'] . "=<b>" . $classid . "</b>" . $fun_r['BqErrorNtb'] . "(" . $fun_r['BqErrorDo'] . "=" . $enews . ")";
        return false;
    }
    //排序
    $addorder = empty($eorder) ? $order . ' desc' : $eorder;
    //优化
    $yhadd = '';
    if (!empty($eyh_r[$yhid]['dobq'])) {
        $yhadd = ReturnYhSql($yhid, $yhvar);
    }
    $query = 'select ' . ReturnSqlListF($mid) . ' from ' . $dbtbpre . 'ecms_' . $tbname . ' where ' . $yhadd . $query . ' order by ' . ReturnSetTopSql('bq') . $addorder . ' limit ' . $line;
    $sql = $empire->query1($query);
    if (!$sql) {
        echo "SQL Error: " . ReRepSqlTbpre($query);
    }
    return $sql;
}
Beispiel #5
0
function espace_ReturnBqQuery($classid, $line, $enews = 0, $do = 0, $ewhere = '', $eorder = '')
{
    global $empire, $dbtbpre, $public_r, $class_r, $class_zr, $fun_r, $class_tr, $emod_r, $etable_r, $userid, $eyh_r;
    $userid = (int) $userid;
    if ($enews == 24) {
        $query_first = substr($classid, 0, 7);
        if (!($query_first == 'select ' || $query_first == 'SELECT ')) {
            return "";
        }
        $classid = RepSqlTbpre($classid);
        $sql = $empire->query1($classid);
        if (!$sql) {
            echo "SQL Error: " . ReRepSqlTbpre($classid);
        }
        return $sql;
    }
    if ($enews == 0 || $enews == 1 || $enews == 2 || $enews == 9 || $enews == 12 || $enews == 15) {
        if (strstr($classid, ',')) {
            $son_r = sys_ReturnMoreClass($classid, 1);
            $classid = $son_r[0];
            $where = $son_r[1];
        } else {
            if ($class_r[$classid][islast]) {
                $where = "classid='{$classid}'";
            } else {
                $where = ReturnClass($class_r[$classid][sonclass]);
            }
        }
        $tbname = $class_r[$classid][tbname];
        $mid = $class_r[$classid][modid];
        $yhid = $class_r[$classid][yhid];
    } elseif ($enews == 6 || $enews == 7 || $enews == 8 || $enews == 11 || $enews == 14 || $enews == 17) {
        echo "Error:Change to use e:indexloop";
        return false;
    } elseif ($enews == 25 || $enews == 26 || $enews == 27 || $enews == 28 || $enews == 29 || $enews == 30) {
        if (strstr($classid, ',')) {
            $son_r = sys_ReturnMoreTT($classid);
            $classid = $son_r[0];
            $where = $son_r[1];
        } else {
            $where = "ttid='{$classid}'";
        }
        $mid = $class_tr[$classid][mid];
        $tbname = $emod_r[$mid][tbname];
        $yhid = $class_tr[$classid][yhid];
    }
    $query = " where userid='{$userid}' and ismember=1";
    if ($enews == 0) {
        $query .= ' and (' . $where . ')';
        $order = 'newstime';
        $yhvar = 'bqnew';
    } elseif ($enews == 1) {
        $query .= ' and (' . $where . ')';
        $order = 'onclick';
        $yhvar = 'bqhot';
    } elseif ($enews == 2) {
        $query .= ' and (' . $where . ') and isgood>0';
        $order = 'newstime';
        $yhvar = 'bqgood';
    } elseif ($enews == 9) {
        $query .= ' and (' . $where . ')';
        $order = 'plnum';
        $yhvar = 'bqpl';
    } elseif ($enews == 12) {
        $query .= ' and (' . $where . ') and firsttitle>0';
        $order = 'newstime';
        $yhvar = 'bqfirst';
    } elseif ($enews == 15) {
        $query .= ' and (' . $where . ')';
        $order = 'totaldown';
        $yhvar = 'bqdown';
    } elseif ($enews == 3) {
        $order = 'newstime';
        $tbname = $public_r[tbname];
        $mid = $etable_r[$tbname][mid];
        $yhvar = 'bqnew';
        $yhid = $etable_r[$tbname][yhid];
    } elseif ($enews == 4) {
        $order = 'onclick';
        $tbname = $public_r[tbname];
        $mid = $etable_r[$tbname][mid];
        $yhvar = 'bqhot';
        $yhid = $etable_r[$tbname][yhid];
    } elseif ($enews == 5) {
        $query .= ' and isgood>0';
        $order = 'newstime';
        $tbname = $public_r[tbname];
        $mid = $etable_r[$tbname][mid];
        $yhvar = 'bqgood';
        $yhid = $etable_r[$tbname][yhid];
    } elseif ($enews == 10) {
        $order = 'plnum';
        $tbname = $public_r[tbname];
        $mid = $etable_r[$tbname][mid];
        $yhvar = 'bqpl';
        $yhid = $etable_r[$tbname][yhid];
    } elseif ($enews == 13) {
        $query .= ' and firsttitle>0';
        $order = 'newstime';
        $tbname = $public_r[tbname];
        $mid = $etable_r[$tbname][mid];
        $yhvar = 'bqfirst';
        $yhid = $etable_r[$tbname][yhid];
    } elseif ($enews == 16) {
        $order = 'totaldown';
        $tbname = $public_r[tbname];
        $mid = $etable_r[$tbname][mid];
        $yhvar = 'bqdown';
        $yhid = $etable_r[$tbname][yhid];
    } elseif ($enews == 18) {
        $order = 'newstime';
        $tbname = $classid;
        $mid = $etable_r[$tbname][mid];
        $yhvar = 'bqnew';
        $yhid = $etable_r[$tbname][yhid];
    } elseif ($enews == 19) {
        $order = 'onclick';
        $tbname = $classid;
        $mid = $etable_r[$tbname][mid];
        $yhvar = 'bqhot';
        $yhid = $etable_r[$tbname][yhid];
    } elseif ($enews == 20) {
        $query .= ' and isgood>0';
        $order = 'newstime';
        $tbname = $classid;
        $mid = $etable_r[$tbname][mid];
        $yhvar = 'bqgood';
        $yhid = $etable_r[$tbname][yhid];
    } elseif ($enews == 21) {
        $order = 'plnum';
        $tbname = $classid;
        $mid = $etable_r[$tbname][mid];
        $yhvar = 'bqpl';
        $yhid = $etable_r[$tbname][yhid];
    } elseif ($enews == 22) {
        $query .= ' and firsttitle>0';
        $order = "newstime";
        $tbname = $classid;
        $mid = $etable_r[$tbname][mid];
        $yhvar = 'bqfirst';
        $yhid = $etable_r[$tbname][yhid];
    } elseif ($enews == 23) {
        $order = 'totaldown';
        $tbname = $classid;
        $mid = $etable_r[$tbname][mid];
        $yhvar = 'bqdown';
        $yhid = $etable_r[$tbname][yhid];
    } elseif ($enews == 25) {
        $query .= ' and (' . $where . ')';
        $order = 'newstime';
        $yhvar = 'bqnew';
    } elseif ($enews == 26) {
        $query .= ' and (' . $where . ')';
        $order = 'onclick';
        $yhvar = 'bqhot';
    } elseif ($enews == 27) {
        $query .= ' and (' . $where . ') and isgood>0';
        $order = 'newstime';
        $yhvar = 'bqgood';
    } elseif ($enews == 28) {
        $query .= ' and (' . $where . ')';
        $order = 'plnum';
        $yhvar = 'bqpl';
    } elseif ($enews == 29) {
        $query .= ' and (' . $where . ') and firsttitle>0';
        $order = 'newstime';
        $yhvar = 'bqfirst';
    } elseif ($enews == 30) {
        $query .= ' and (' . $where . ')';
        $order = 'totaldown';
        $yhvar = 'bqdown';
    }
    //优化
    $yhadd = '';
    if (!empty($eyh_r[$yhid]['dosbq'])) {
        $yhadd = ReturnYhSql($yhid, $yhvar);
        if (!empty($yhadd)) {
            $query .= ' and ' . $yhadd;
        }
    }
    //不调用
    if (!strstr($public_r['nottobq'], ',' . $classid . ',')) {
        $notbqwhere = ReturnNottoBqWhere();
        if (!empty($notbqwhere)) {
            $query .= ' and ' . $notbqwhere;
        }
    }
    //图片信息
    if (!empty($do)) {
        $query .= " and ispic=1";
    }
    //附加条件
    if (!empty($ewhere)) {
        $query .= ' and (' . $ewhere . ')';
    }
    //中止
    if (empty($tbname)) {
        echo "ClassID=<b>" . $classid . "</b> Table not exists.(DoType=" . $enews . ")";
        return false;
    }
    //排序
    $addorder = empty($eorder) ? $order . ' desc' : $eorder;
    $query = 'select ' . ReturnSqlListF($mid) . ' from ' . $dbtbpre . 'ecms_' . $tbname . $query . ' order by ' . $addorder . ' limit ' . $line;
    $sql = $empire->query1($query);
    if (!$sql) {
        echo "SQL Error: " . ReRepSqlTbpre($query);
    }
    return $sql;
}
function GetNewsJs($classid, $line, $sub, $showdate, $enews = 0, $tempr)
{
    global $empire, $public_r, $class_r, $class_zr, $emod_r, $etable_r, $dbtbpre, $eyh_r;
    if (empty($line)) {
        $line = 10;
    }
    if (empty($sub)) {
        $sub = 26;
    }
    //栏目
    if ($enews == 0 || $enews == 1 || $enews == 2 || $enews == 9 || $enews == 12 || $enews == 15) {
        $where = $class_r[$classid][islast] ? "classid='{$classid}'" : ReturnClass($class_r[$classid][sonclass]);
    }
    $allpath = ECMS_PATH . 'd/js/js/';
    $ztpath = ECMS_PATH . 'd/js/class/zt' . $classid . '_';
    $classpath = ECMS_PATH . 'd/js/class/class' . $classid . '_';
    if ($enews == 0) {
        $tbname = $class_r[$classid][tbname];
        $query = $where . ' and checked=1';
        $order = 'newstime';
        $newsjs = $classpath . 'newnews.js';
        $mid = $class_r[$classid][modid];
        $yhid = $class_r[$classid][yhid];
        $yhvar = 'bqnew';
    } elseif ($enews == 1) {
        $tbname = $class_r[$classid][tbname];
        $query = $where . ' and checked=1';
        $order = "onclick";
        $newsjs = $classpath . 'hotnews.js';
        $mid = $class_r[$classid][modid];
        $yhid = $class_r[$classid][yhid];
        $yhvar = 'bqhot';
    } elseif ($enews == 2) {
        $tbname = $class_r[$classid][tbname];
        $query = $where . ' and isgood>0 and checked=1';
        $order = 'newstime';
        $newsjs = $classpath . 'goodnews.js';
        $mid = $class_r[$classid][modid];
        $yhid = $class_r[$classid][yhid];
        $yhvar = 'bqgood';
    } elseif ($enews == 9) {
        $tbname = $class_r[$classid][tbname];
        $query = $where . ' and checked=1';
        $order = 'plnum';
        $newsjs = $classpath . 'hotplnews.js';
        $mid = $class_r[$classid][modid];
        $yhid = $class_r[$classid][yhid];
        $yhvar = 'bqpl';
    } elseif ($enews == 12) {
        $tbname = $class_r[$classid][tbname];
        $query = $where . ' and firsttitle>0 and checked=1';
        $order = 'newstime';
        $newsjs = $classpath . 'firstnews.js';
        $mid = $class_r[$classid][modid];
        $yhid = $class_r[$classid][yhid];
        $yhvar = 'bqfirst';
    } elseif ($enews == 3) {
        $tbname = $public_r['tbname'];
        $query = 'checked=1';
        $order = 'newstime';
        $newsjs = $allpath . 'newnews.js';
        $mid = $etable_r[$tbname][mid];
        $yhvar = 'bqnew';
        $yhid = $etable_r[$tbname][yhid];
    } elseif ($enews == 4) {
        $tbname = $public_r['tbname'];
        $query = 'checked=1';
        $order = 'onclick';
        $newsjs = $allpath . 'hotnews.js';
        $mid = $etable_r[$tbname][mid];
        $yhvar = 'bqhot';
        $yhid = $etable_r[$tbname][yhid];
    } elseif ($enews == 5) {
        $tbname = $public_r['tbname'];
        $query = 'isgood>0 and checked=1';
        $order = 'newstime';
        $newsjs = $allpath . 'goodnews.js';
        $mid = $etable_r[$tbname][mid];
        $yhvar = 'bqgood';
        $yhid = $etable_r[$tbname][yhid];
    } elseif ($enews == 10) {
        $tbname = $public_r['tbname'];
        $query = 'checked=1';
        $order = 'plnum';
        $newsjs = $allpath . 'hotplnews.js';
        $mid = $etable_r[$tbname][mid];
        $yhvar = 'bqpl';
        $yhid = $etable_r[$tbname][yhid];
    } elseif ($enews == 13) {
        $tbname = $public_r['tbname'];
        $query = 'firsttitle>0 and checked=1';
        $order = 'newstime';
        $newsjs = $allpath . 'firstnews.js';
        $mid = $etable_r[$tbname][mid];
        $yhvar = 'bqfirst';
        $yhid = $etable_r[$tbname][yhid];
    } elseif ($enews == 6) {
        $tbname = $class_zr[$classid][tbname];
        $query = "ztid like '%|" . $classid . "|%' and checked=1";
        $order = 'newstime';
        $newsjs = $ztpath . 'newnews.js';
        $mid = $etable_r[$tbname][mid];
        $yhid = $class_zr[$classid][yhid];
        $yhvar = 'bqnew';
    } elseif ($enews == 7) {
        $tbname = $class_zr[$classid][tbname];
        $query = "ztid like '%|" . $classid . "|%' and checked=1";
        $order = 'onclick';
        $newsjs = $ztpath . 'hotnews.js';
        $mid = $etable_r[$tbname][mid];
        $yhid = $class_zr[$classid][yhid];
        $yhvar = 'bqhot';
    } elseif ($enews == 8) {
        $tbname = $class_zr[$classid][tbname];
        $query = "ztid like '%|" . $classid . "|%' and isgood>0 and checked=1";
        $order = 'newstime';
        $newsjs = $ztpath . 'goodnews.js';
        $mid = $etable_r[$tbname][mid];
        $yhid = $class_zr[$classid][yhid];
        $yhvar = 'bqgood';
    } elseif ($enews == 11) {
        $tbname = $class_zr[$classid][tbname];
        $query = "ztid like '%|" . $classid . "|%' and checked=1";
        $order = 'plnum';
        $newsjs = $ztpath . 'hotplnews.js';
        $mid = $etable_r[$tbname][mid];
        $yhid = $class_zr[$classid][yhid];
        $yhvar = 'bqpl';
    } elseif ($enews == 14) {
        $tbname = $class_zr[$classid][tbname];
        $query = "ztid like '%|" . $classid . "|%' and firsttitle>0 and checked=1";
        $order = 'newstime';
        $newsjs = $ztpath . 'firstnews.js';
        $mid = $etable_r[$tbname][mid];
        $yhid = $class_zr[$classid][yhid];
        $yhvar = 'bqfirst';
    }
    $ret_r = ReturnReplaceListF($tempr[modid]);
    //字段
    //优化
    $yhadd = '';
    if (!empty($eyh_r[$yhid]['dojs'])) {
        $yhadd = ReturnYhSql($yhid, $yhvar);
    }
    $query = 'select ' . ReturnSqlListF($mid) . ' from ' . $dbtbpre . 'ecms_' . $tbname . ' where ' . $yhadd . $query . ' order by ' . ReturnSetTopSql('js') . $order . ' desc limit ' . $line;
    $sql = $empire->query($query);
    //取得js模板
    $tempr[temptext] = str_replace('[!--news.url--]', $public_r[newsurl], $tempr[temptext]);
    $temp_r = explode("[!--empirenews.listtemp--]", $tempr[temptext]);
    $no = 1;
    while ($r = $empire->fetch($sql)) {
        $r[oldtitle] = $r[title];
        //替换列表变量
        $repvar = ReplaceListVars($no, $temp_r[1], $tempr[subnews], $tempr[subtitle], $tempr[showdate], $url, 0, $r, $ret_r);
        $allnew .= $repvar;
        $no++;
    }
    $allnew = "document.write(\"" . addslashes(stripSlashes(str_replace("\r\n", "", $temp_r[0] . $allnew . $temp_r[2]))) . "\");";
    WriteFiletext_n($newsjs, $allnew);
}
Beispiel #7
0
} else {
    $myorder = "newstime";
}
//显示顺序
$orderby = (int) $_GET['orderby'];
if ($orderby) {
    $myorderby = "ASC";
} else {
    $myorderby = "DESC";
}
//优化
$yhadd = '';
if ($yhid) {
    $yhadd = ReturnYhSql($yhid, $yhvar);
}
$query = "select " . ReturnSqlListF($mid) . " from {$dbtbpre}ecms_" . $tbname . ReturnYhAndSql($yhadd, $add, 1) . " order by " . $myorder . " " . $myorderby . " limit " . $public_r['rssnum'];
$sublen = $public_r['rsssub'];
$sql = $empire->query($query);
//显示文件
$type = $_GET['type'];
if ($type == "xml") {
    $webfilename = "xml.php";
} elseif ($type == "atom") {
    $webfilename = "atom.php";
} elseif ($type == "rss1") {
    $webfilename = "rss10.php";
} else {
    $webfilename = "rss20.php";
}
require $webfilename;
db_close();
Beispiel #8
0
    $yhadd = ReturnYhSql($yhid, $yhvar);
}
//总数
$totalnum = (int) $_GET['totalnum'];
if ($totalnum < 1) {
    $totalquery = "select count(*) as total from {$dbtbpre}ecms_" . $tbname . ReturnYhAndSql($yhadd, $add, 1);
    $num = $empire->gettotal($totalquery);
} else {
    $num = $totalnum;
}
$search .= '&totalnum=' . $num;
//置顶
if ($public_r['fieldandtop']) {
    $addorder = 'istop desc,' . $addorder;
}
$query = "select " . ReturnSqlListF($mid) . " from {$dbtbpre}ecms_" . $tbname . ReturnYhAndSql($yhadd, $add, 1);
$query .= " order by " . $addorder . " limit {$offset},{$line}";
$sql = $empire->query($query);
//分页
$listpage = page1($num, $line, $page_line, $start, $page, $search);
//页面支持标签
if ($public_r['dtcanbq']) {
    $tempr[temptext] = DtNewsBq('list' . $tempid, $tempr[temptext], 0);
} else {
    if ($public_r['searchtempvar']) {
        $tempr[temptext] = ReplaceTempvar($tempr[temptext]);
    }
}
$listtemp = $tempr[temptext];
$rownum = $tempr[rownum];
if (empty($rownum)) {
Beispiel #9
0
} else {
    $myorder = "newstime";
}
//显示顺序
$orderby = (int) $_GET['orderby'];
if ($orderby) {
    $myorderby = "ASC";
} else {
    $myorderby = "DESC";
}
//优化
$yhadd = '';
if ($yhid) {
    $yhadd = ReturnYhSql($yhid, $yhvar);
}
$query = "select " . ReturnSqlListF($mid) . " from {$dbtbpre}ecms_" . $tbname . " where " . $yhadd . "checked=1" . $add . " order by " . $myorder . " " . $myorderby . " limit " . $public_r['rssnum'];
$sublen = $public_r['rsssub'];
$sql = $empire->query($query);
//显示文件
$type = $_GET['type'];
if ($type == "xml") {
    $webfilename = "xml.php";
} elseif ($type == "atom") {
    $webfilename = "atom.php";
} elseif ($type == "rss1") {
    $webfilename = "rss10.php";
} else {
    $webfilename = "rss20.php";
}
require $webfilename;
db_close();