⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 read.php

📁 make project on java
💻 PHP
字号:
<?php
include'include/begin.php';
include'include/read.php';
$tp3 = array(15, 16);
$tpl_html = 'read';


$hid = (int)$_GET['hid'];
$tid = (int)$_GET['tid'];
$_GET['page'] = (int)$_GET['page'];
if ($_GET['page']<1) $_GET['page']=1;
$_GET['type'] = (int)$_GET['type'];
$_GET['tpage'] = (int)$_GET['tpage'];
if ($_GET['tpage']<1) $_GET['tpage']=1;

userp1();
$result = mysql_query("select * from {$db_prefix}title where cid='$tid'", $myconn);
if ($trow = mysql_fetch_array($result)) {
    $fid = $trow['fid'];
    if ($trow['updown'] == 2 || $trow['updown'] == 3 || $trow['updown'] == 5 || $trow['updown'] == 6) {
        $bbsmessagefix = 1;
    } 
    if ($hid < 1) {
        $hid = $fid;
    } 
    $msecho = false;
    forumpurview();
    include language();
    $pagename_m = $_pagename[43];
    $pagename_n = $forumnames[$fid];
    if (!$userp3[3]) {
        echoerror(78);
    } 
    if ($trow['state'] <1) {
        if (!$userp3[18]) {
            echoerror(22);
        } 
    } 
    $numpage = $trow['replies']?$trow['replies']: 1;
    $pagelist = thpage();
    $list_l = ($_GET['page']-1) * $headnum;
    $_GET['page'] == 1?$headnum++: $list_l++;
    $titlea['title'] = $trow['html']?$trow['title']: htmlspecialchars($trow['title']);
    $pagename_s = $trow['html']?strip_tags($titlea['title']): $titlea['title'];
    $pagename_n = $forumnames[$fid];
    if ($_GET['page'] == 1) {
        $mark_echo = 'display: none;';
        $markusers = '';
        if ($trow['flo'] > 0 || $trow['egg'] > 0) {
            $mark_echo = '';
            $msecho = true;
            $result = mysql_query("select * from {$db_prefix}mark where tid='$tid'", $myconn);
            if ($mark = mysql_fetch_array($result)) {
                $markusers = $mark['user'];
            } 
        } 
        $tw_echo = 'display: none;';
        if (isset($wname[$trow['wid']])) {
            $tw_name = $wname[$trow['wid']];
            $tw_echo = '';
            $msecho = true;
        } 
    } 
} else {
    $result = mysql_query("select * from {$db_prefix}posts where id='$tid'", $myconn);
    if ($prow = mysql_fetch_array($result)) {
        $result = mysql_query("select * from {$db_prefix}title where cid='$prow[tid]'", $myconn);
        if ($prow2 = mysql_fetch_array($result)) {
            $result = mysql_query("select * from {$db_prefix}posts where tid='$prow2[cid]' ORDER BY id", $myconn);
            for($a = 0;$prow3 = mysql_fetch_array($result);$a++) {
                if ($prow3["id"] == $tid) {
                    $page = Ceil($a / $headnum);
                    header('Location: read.php?tid=' . $prow2['cid'] . '&page=' . $page . '&#' . $a);
                    exit;
                } 
            } 
        } 
    } 
    echoerror(21);
} 


include'include/main.php';

unset($postemlist);
$result = mysql_query("select * from {$db_prefix}posts where tid='$tid' ORDER BY id LIMIT $list_l,$headnum", $myconn);
$n = 0;
$authorids = array();
while ($row = mysql_fetch_array($result)) {
    $authorids[] = 'id = \'' . $row['authorid'] . '\'';
} 

unset($authorlist);
if (count($authorids)) {
    $authorlist = array_unique($authorids);
    $authorlist = implode(" || ", $authorlist);
    $result2 = mysql_query("select * from {$db_prefix}members where $authorlist", $myconn);
    while ($usera = mysql_fetch_array($result2)) {
	
	$rank=rank($usera['postnum'], $usera['a'], $usera['b'], $usera['c']);
        $userp[$usera['id']] = array('rank' => $rank,'rankname'=>rankname($rank), 'a' => $usera['a'], 'b' => $usera['b'], 'c' => $usera['c'], 'postnum' => $usera['postnum'], 'blank' => $usera['blank'], 'hudata' => 'display: block;',);
        $userface = explode('|', $usera['face']);
        if ($userface[0] == 1 && $userface[1] && $userface[1] <= $facenum) {
            $userp[$usera['id']]["face"] = $imagedir . '/face/face' . $userface[1] . '.gif';
        } else if ($userface[0] == 2) {
            $userp[$usera['id']]['face'] = $imagedir . '/uploadface/' . $userface[2];
        } else {
            $userp[$usera['id']]['hface'] = 'display: none;';
        } 
        $userp[$usera['id']]['zwu'] = '';
        if ($usera['admin'] > 0) {
            $userp[$usera['id']]['zwu'] .= tpl_fun_jjx8(array('gname' => $sysgroupname[$usera['admin']]));
        } 
        if ($usera['forums'] != '') {
            $userp[$usera['id']]['zwu'] .= tpl_fun_jjx8(array('gname' => $sysgroupname[11]));
        } 
        if ($usera['signa']) {
            $signatext = htmlspecialchars($usera['signa']);
            if ($signa) {
                $signatext = signa($signatext);
            } 
            $userp[$usera['id']]['signa'] = $signatext;
        } 
        if ($usera['groups']) {
            $ugroups = explode('|', $usera['groups']);
            while (list(, $val) = each($ugroups)) {
                $ugroup = explode(',', $val);
                if (isset($groupname[$ugroup[0]])) {
                    $userp[$usera["id"]]["group"] .= tpl_fun_jjx3(array('imagedir' => $imagedir, 'gkey' => $ugroup[0], 'name' => htmlspecialchars($ugroup[1]), 'groupname' => $groupname[$ugroup[0]]));
                } 
            } 
        } 

        if ($usera['honor']) {
            $honor = explode('|', $usera['honor']);
            while (list(, $val) = each($honor)) {
                if (isset($honors[$val])) {
 
                    $userp[$usera['id']]['honor'] .= tpl_fun_jjx4(array('imagedir' => $imagedir, 'val' => $val, 'honors' => $honors[$val]));
                } 
            } 
        } 
    } 
} 

@mysql_data_seek($result, 0);

while ($row = mysql_fetch_array($result)) {
    $id = $row['id'];
    $annex = $row['annex']?1 : null;
    $html = explode('|', $row['html']);
    $annexs = array();
    $annexpoll = false;
    if ($annex > 0) {
        $annexresult = mysql_query("select * from {$db_prefix}annex where tid='$id'&& fix='1'", $myconn);
        while ($annexrow = mysql_fetch_array($annexresult)) {
            $annexs[$annexrow['id']] = array('code' => $annexrow['code'], 'type' => $annexrow["type"], 'uptime' => $annexrow["uptime"], 'downuser' => $annexrow["downuser"], 'downnum' => $annexrow["downnum"], 'content' => $annexrow["content"], 'title' => $annexrow["title"], 'filetype' => $annexrow["filetype"], 'author' => $row["author"], 'size' => $annexrow["size"],);
            $annexrow['code'] == 'poll'?$annexpoll = true: null;
        } 
    } 
    $p_del = $p_re = false;
    $p_money = false;
    $postlo = '';
    if ($id == $tid) {
        $user['a'] > 0?$p_money = true: null;
        if ($userp3[18]) {
            $trow['state'] == 0?$p_re = true: $p_del = true;
        } 
        if ($trow['locks']) {
            $postlo .= tpl_fun_jjx9(array('postlo' => $_p_read[6]));
            $msecho = true;
        } 
        if ($trow['state'] == 0) {
            $postlo .= tpl_fun_jjx9(array('postlo' => $_p_read[5]));
            $msecho = true;
        } 
        if ($trow['elite'] == 1 && !$userp3[37]) {
            $postlo .= tpl_fun_jjx9(array('postlo' => $_p_read[7]));
            $row['content'] = '';
            $msecho = true;
        } 
    } else {
        if ($trow['money'] > 0 && $username == $trow['author'] && $userid != $row['authorid']) {
            $p_money = true;
        } 
        if ($row["state"] == 0) {
            $postlo .= tpl_fun_jjx9(array('postlo' => $_p_read[5]));
            $userp3[18]?null : $row['content'] = '';
            $msecho = true;
        } 
        if ($userp3[18]) {
            $row['state'] == 0?$p_re = true: $p_del = true;
        } 
    } 
    if ($userp[$row['authorid']]['blank']) {
        $postlo .= tpl_fun_jjx9(array('postlo' => $_p_read[8]));
        if (!$userp3[18]) {
            $row['content'] = '';
        } 
        $msecho = true;
    } 
    $reviewlist = '';
    $p_note = false;
    if ($row["review"]) {
        $reviewa = explode("|", $row['review']);
        while (list(, $val) = each($reviewa)) {
            $review = explode("\t", $val);
            if (count($review) == 3) {
                $reviewlist .= "<div>" . echotime($review[0]) . " " . $_p_affair[$review[2]] . " " . $review[1] . "</div>";
            } 
        } 
        $echoreview = '';
        $p_note = true;
    } else {
        $echoreview = 'display: none;';
    } 
    $posts = array('id' => $id, 'author' => $row['author'], 'url_author' => urlencode($row['author']), 'authorid' => $row['authorid'], 'posttime' => echotime($row['posttime']), 'content' => content($row['content']), 'postip' => $row['postip'], 'html' => $html[0], 'review' => $reviewlist, 'kma' => $list_l + $n, 'postlo' => $postlo, 'echoreview' => $echoreview, 'review' => $reviewlist,);
    $n++;
	

    if ($id == $tid) {
	
        $jjx1 = tpl_fun_jjx1(array('tpage' => $_GET['tpage'], 'hhonor' => $userp[$row['authorid']]['honor']!=''?'' : 'display: none;', 'p_poll' => $annexpoll && $userp2[0]?'' : 'display: none!important;', 'p_money' => $p_money?'' : 'display: none!important;', 'p_pm' => $userp1[2]?'' : 'display: none!important;', 'p_zl' => $userp1[9]?'' : 'display: none!important;', 'p_pj' => $userp1[4]?'' : 'display: none!important;', 'p_note' => $p_note && $userp3[2]?'': 'display: none!important;', 'p_bg' => $userid > 0?'' : 'display: none!important;', 'p_edit' => $userid == $row['authorid'] || $userp3[18]?'' : 'display: none!important;', 'p_del' => $p_del?'' : 'display: none!important;', 'p_re' => $p_re?'' : 'display: none!important;', 'templatedir' => $templatedir, $userp[$row['authorid']], 'echosigna' => $userp[$row['authorid']]['signa'] == '' || $html[4]?'display: none;' : '', $posts, 'tid' => $tid, 'hid' => $hid, 'n' => $n, 'id' => $id, 'flo' => $trow['flo'], 'egg' => $trow['egg'], 'm_echo' => $mark_echo, 'ms_echo' => $msecho?'' : 'display: none;', 'markusers' => $markusers, 'title' => $titlea['title'], 'jjx3' => $userp[$row['authorid']]['group'], 'jjx9' => $postlo, 'signa' => $html[5]?'' : $userp[$row['authorid']]['signa'], 'jjx4' => $userp[$row['authorid']]['honor'], 'w_echo' => $tw_echo, 'w_name' => $tw_name, 'w_id' => $tw_wid, 'jjx8' => $userp[$row['authorid']]['zwu']), array('abc' => $abc));
    } else {
	
	        $jjx2 .= tpl_fun_jjx2(array('tpage' => $_GET['tpage'], 'hhonor' => $userp[$row['authorid']]['honor']!=''?'': 'display: none;', 'p_poll' => $annexpoll && $userp2[0]?'' : 'display: none!important;', 'p_money' => $p_money?'' : 'display: none!important;', 'p_pm' => $userp1[2]?'' : 'display: none!important;', 'p_zl' => $userp1[9]?'' : 'display: none!important;', 'p_note' => $p_note && $userp3[2]?'' : 'display: none!important;', 'p_bg' => $userid > 0?'' : 'display: none!important;', 'p_edit' => $userid == $row['authorid'] || $userp3[18]?'' : 'display: none!important;', 'p_del' => $p_del?'' : 'display: none!important;', 'p_re' => $p_re?'' : 'display: none!important;', 'templatedir' => $templatedir, $userp[$row['authorid']], 'echosigna' => $userp[$row['authorid']]['signa'] == '' || $html[4]?'display: none;' : '', $posts, 'tid' => $tid, 'hid' => $hid, 'n' => $n, 'id' => $id, 'ms_echo' => $msecho?'' : 'display: none;', 'jjx3' => $userp[$row['authorid']]['group'], 'jjx9' => $postlo, 'signa' => $html[5]?'' : $userp[$row['authorid']]['signa'], 'jjx4' => $userp[$row['authorid']]['honor'], 'jjx8' => $userp[$row['authorid']]['zwu']), array('abc' => $abc));
    } 
    $msecho = false;
} ;
if ($n == 0 && $_GET['page'] > 1) {
    $result = mysql_query("select * from {$db_prefix}posts where tid='$tid'", $myconn);
    $num = @mysql_num_rows($result)-1;
    if ($num > 0) {
        mysql_query("update {$db_prefix}title set replies='$num' where cid='$tid'", $myconn);
        $page = Ceil($num / $headnum);
        jumpurl('read.php?tid=' . $tid . '&hid=' . $hid . '&page=' . $page);
        exit;
    } 
} 
mysql_query("update {$db_prefix}title set hits=hits+'1' where cid='$tid'", $myconn);
if ($userp3[5]) {
    $sign = sign();
    $js_posttime = 0;
    $_posttime = $time - $user["posttime"];
    if ($_posttime > 0) {
        $_posttime = $userp1[6] - $_posttime;
        $js_posttime = $_posttime > 0?$_posttime: 0;
    } else {
        $js_posttime = -1 * $_posttime + $userp1[6];
    } 
    $htmlact = $userp3[33]?'': 'display: none;';
    $boxid = 0;
    if ($user['emote']) {
	
        $emotea = explode('|', $user['emote']);
        $i = 0;
        foreach($emotea as $val) {
		
		if ($boxid >=$emotenumpage) {
                continue;
            } 
		
            if ($val > $emotenum) {
                continue;
            } 
            $i++;
            $jjx7 .= tpl_fun_jjx7(array('id' => $val, 'imagedir' => $imagedir));
            if ($i >= $emotepage) {
                $jjx5 .= tpl_fun_jjx5(array('boxid' => $boxid, 'page' => $boxid + 1));
                $jjx6 .= tpl_fun_jjx6(array('display' => $boxid?'none' : 'block', 'jjx7' => $jjx7));
                $boxid++;
                $i = 0;
                $jjx7 = '';
            } 
        } 
        if ($jjx7 != '') {
            $jjx5 .= tpl_fun_jjx5(array('boxid' => $boxid, 'page' => $boxid + 1));
            $jjx6 .= tpl_fun_jjx6(array('display' => $boxid?'none' : 'block', 'jjx7' => $jjx7));
            $boxid++;
        } 
    } 
	
	
    $jjx7 = '';
    for($i = 1;$i <= $emotenum && $boxid <$emotenumpage;$i++) {
        $jjx7 .= tpl_fun_jjx7(array('id' => $i, 'imagedir' => $imagedir));
        if ($i % $emotepage == 0) {
            $jjx5 .= tpl_fun_jjx5(array('boxid' => $boxid, 'page' => $boxid + 1));
            $jjx6 .= tpl_fun_jjx6(array('display' => $boxid?'none' : 'block', 'jjx7' => $jjx7));
            $jjx7 = '';
            $boxid++;
        } 
    } 
    if ($jjx7 != '') {
        $jjx5 .= tpl_fun_jjx5(array('boxid' => $boxid, 'page' => $boxid + 1));
        $jjx6 .= tpl_fun_jjx6(array('display' => $boxid?'none' : 'block', 'jjx7' => $jjx7));
    } 
    $jjx0 = tpl_fun_jjx0(array('jjx5' => $jjx5, 'jjx6' => $jjx6, 'htmlact' => $htmlact, 'fid' => $fid, 'tid' => $tid, 'sign' => $sign, 'js_posttime' => $js_posttime,'hid'=>$hid));
} 
$pageh = $pagenum > 1?'' : 'display: none;';
include_once './cache/template/m_' . $style_id . '_' . $tpl_html . '.php';

?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -