📄 index.php
字号:
<?
define ('SCR', 'thread');
require_once 'global.php';
require_once R_P . 'require/forum.php';
require_once R_P . 'require/updateforum.php';
include_once D_P . 'data/bbscache/forum_cache.php';
$domains = array ('localhost', 'vxbbs.com','www.vxbbs.com');
$valid = FALSE;
foreach ($domains as $one)
{
if (strtolower ($one) == strtolower ($_SERVER['SERVER_NAME']))
{
$valid = TRUE;
continue;
}
}
if (!($valid))
{
showmsg ('Licensed_mmcatv');
exit ();
}
$forumdbs = array ();
foreach ($forum as $key => $value)
{
if (!($value['cms']))
{
if ($value['type'] == 'category')
{
if (!($catid))
{
if (!(($keys AND !($key < $keys))))
{
$catid = $value['fid'];
$keys = $key;
}
}
$cates[] = $value;
continue;
}
else
{
if ($value['type'] == 'forum')
{
if (!(($value['f_type'] == 'hidden' AND $groupid != 3)))
{
$forumdbs[$value['fup']][] = $value;
continue;
}
continue;
}
continue;
}
continue;
}
}
if (!$fid)
{
$fid = $forumdbs[$catid][0]['fid'];
}
foreach ($cates as $key => $value)
{
if (!($forumdbs[$value['fid']]))
{
unset ($cates[$key]);
continue;
}
}
$foruminfo = $db->get_one ('SELECT f.*,fe.creditset,fe.forumset,fe.myerrp,fd.topic,fd.article,fd.top1,fd.top2,a.aid,a.author,a.startdate,a.subject,a.content FROM pw_forums f LEFT JOIN pw_forumsextra fe ON fe.fid=f.fid LEFT JOIN pw_forumdata fd ON fd.fid=f.fid LEFT JOIN pw_announce a ON a.ffid=f.fid WHERE f.fid=\'' . $fid . '\'');
$forumset = unserialize ($foruminfo['forumset']);
if ($forumset['newtime'])
{
$db_newtime = $forumset['newtime'];
}
if ($forumset['link'])
{
obheader ($forumset['link']);
}
if ($foruminfo['type'] == 'category')
{
obheader ('index.php?cateid=' . $fid);
}
$searchadd = $thread_children = $thread_online = $fastpost = '';
if (!($foruminfo))
{
require_once R_P . 'require/url_error.php';
}
wind_forumcheck ($foruminfo);
$forumname = $forum[$foruminfo['fid']]['name'];
require_once R_P . 'require/header.php';
$ajaxcheck = ($groupid == 3 ? 1 : 0);
if ($windid == $manager)
{
$admincheck = 1;
$ajaxcheck = 1;
}
else
{
if ($foruminfo['forumadmin'])
{
if (strpos ($foruminfo['forumadmin'], ',' . $windid . ',') !== false)
{
$admincheck = 1;
$ajaxcheck = 1;
}
}
else
{
if ($groupid != 5)
{
if (!(((((((!$SYSTEM['tpctype'] AND !$SYSTEM['check']) AND !$SYSTEM['typeadmin']) AND !$SYSTEM['delatc']) AND !$SYSTEM['moveatc']) AND !$SYSTEM['copyatc']) AND !$SYSTEM['topped'])))
{
$admincheck = 1;
}
}
else
{
$admincheck = 0;
}
}
}
if (!$windid)
{
$admincheck = 0;
}
if ($groupid != 3)
{
if (!($foruminfo['allowvisit']))
{
if (!(($foruminfo['forumadmin'] AND !(strpos ($foruminfo['forumadmin'], ',' . $windid . ',') === false))))
{
list ($db_moneyname, , $db_rvrcname, , $db_creditname) = explode (' ', $db_credits);
forum_creditcheck ();
}
}
}
$adminarray = '';
$adminarray = explode (' ', $foruminfo['forumadmin']);
if ($adminarray[0])
{
$forumadmin = explode (',', $adminarray[0]);
foreach ($forumadmin as $key => $value)
{
if ($value)
{
if (!($db_adminshow))
{
if ($key == 10)
{
$admin_T['admin'] .= '...';
break;
}
$admin_T['admin'] .= '<a href=profile.php?action=show&username=' . rawurlencode ($value) . ('>' . $value . '</a> ');
continue;
}
else
{
$admin_T['admin'] .= '<option value=' . $value . '>' . $value . '</option>';
continue;
}
continue;
}
}
$admin_T['admin'] = ' ' . $admin_T['admin'];
}
update_ol ();
if ($db_threadonline == 1)
{
$trd_hide = $trd_nothide = $trd_guest = 0;
$guestarray = readover (D_P . 'data/bbscache/guest.php');
$detail = explode (('<FiD>' . $fid . ' '), $guestarray);
$trd_guest = count ($detail) - 1;
$onlinearray = openfile (D_P . 'data/bbscache/online.php');
$count_ol = count ($onlinearray);
for ($i = 1; $i < $count_ol; ++$i)
{
$detail = explode (' ', $onlinearray[$i]);
if ($detail[3] == $fid)
{
if (strpos ($db_showgroup, ',' . $detail[5] . ',') !== false)
{
$img = $detail[5];
}
else
{
$img = '6';
}
if ($trd_nothide % 8 == 0)
{
$trd_onlineinfo .= '</tr><tr>';
}
if ($detail[9] == '<>')
{
++$trd_hide;
continue;
}
else
{
++$trd_nothide;
$trd_onlineinfo .= '<td width=12%> <img src=\'' . $imgpath . '/' . $stylepath . '/group/' . $img . '.gif\' align=\'bottom\'><a href=profile.php?action=show&uid=' . $detail['8'] . '>' . $detail['0'] . '</a></td>';
continue;
}
continue;
}
}
unset ($guestarray);
unset ($detail);
$trd_sumonline2 = $trd_nothide + $trd_guest + $trd_hide;
$trd_sumonline1 = $trd_nothide + $trd_hide;
$thread_online = 'thread_online';
}
$guidename = forumindex ($foruminfo['fup']);
$msg_guide = headguide ($guidename);
include_once D_P . 'data/bbscache/thread_announce.php';
$ifsort = 0;
$NT_A = $NT_C = array ();
if ($notice_A)
{
$ifsort = 1;
$NT_A = array_shift ($notice_A);
$NT_A['rawauthor'] = rawurlencode ($NT_A['author']);
$NT_A['startdate'] = get_date ($NT_A['startdate']);
}
if ($notice_C[$cateid])
{
$ifsort = 1;
$NT_C = $notice_C[$cateid];
$NT_C['rawauthor'] = rawurlencode ($NT_C['author']);
$NT_C['startdate'] = get_date ($NT_C['startdate']);
}
if ($foruminfo['aid'])
{
$foruminfo['rawauthor'] = rawurlencode ($foruminfo['author']);
$foruminfo['startdate'] = get_date ($foruminfo['startdate']);
$foruminfo['content'] = str_replace ('', '<br>', $foruminfo['content']);
}
if (strpos ($_COOKIE['deploy'], ' ' . thread . ' ') === false)
{
$thread_img = 'fold';
}
else
{
$thread_img = 'open';
$cate_thread = 'display:none;';
}
$forumdb = array ();
if ($foruminfo['childid'])
{
$adminarray = '';
$query = $db->query ('SELECT f.fid,f.logo,f.name, f.descrip,f.forumadmin,f.password,f.allowvisit,f.f_type,fd.tpost,fd.topic,fd.article,fd.subtopic,fd.lastpost FROM pw_forums f LEFT JOIN pw_forumdata fd USING(fid) WHERE f.fup=\'' . $fid . '\' ORDER BY f.vieworder');
while ($child = $db->fetch_array ($query))
{
if (!((!empty ($child['allowvisit']) AND !(strpos ($child['allowvisit'], ',' . $groupid . ',') !== false))))
{
list ($f_a, $child['au'], $f_c, $child['ft']) = explode (' ', $child['lastpost']);
if ($winddb['lastvisit'] < $f_c)
{
(true ? $timestamp < $f_c + 172800 : 'new');
}
$child['pic'] = 'old';
$child['newtitle'] = get_date ($f_c);
$child['t'] = substrs ($f_a, 21);
break;
}
if (!($child['f_type'] === 'hidden'))
{
$child['pic'] = 'lock';
}
}
$db->free_result ($query);
if ($forumdb)
{
$thread_children = 'thread_children';
}
if ($foruminfo['viewsub'] == 1)
{
require_once printeot ('thread_childmain');
footer ();
}
}
if ($admincheck){
!$_GET['managemode'] && $managemode=GetCookie('managemode');
if($concle==1){
$concle=2; $managemode=1;
Cookie("managemode","1",0);
}elseif($concle==2){
$concle=1; $managemode='';
Cookie("managemode","",0);
}elseif(!$managemode){
$concle=1;
}elseif($managemode){
$concle=2;
}
$trd_adminhide="<form action=mawhole.php method=post><input type=hidden name=fid value=$fid>";
}
$t_typedb=array();
$t_db=$foruminfo['t_type'];
$t_db && $t_typedb=explode("\t",$t_db);
unset($t_typedb[0]);/* 0 */
if($t_db && is_numeric($type) && isset($t_typedb[$type])){
$searchadd=" AND type='$type' AND ifcheck='1'";
$typeadd="type=$type&";
$rs=$db->get_one("SELECT COUNT(*) AS count FROM pw_threads WHERE fid='$fid' $searchadd");
$count=$rs['count'];
} elseif($search=='digest'){
$searchadd=" AND digest>'0' AND ifcheck='1'";
$rs=$db->get_one("SELECT COUNT(*) AS count FROM pw_threads WHERE fid='$fid' $searchadd");
$count=$rs['count'];
} elseif($search=='check'){
if($admincheck){
$searchadd=" AND ifcheck='0'";
}else{
$searchadd=" AND authorid='$winduid' AND ifcheck='0'";
}
$rs=$db->get_one("SELECT COUNT(*) AS count FROM pw_threads WHERE fid='$fid' $searchadd");
$count=$rs['count'];
} elseif(is_numeric($search)){
$searchadd=" AND lastpost>='".($timestamp - $search*84600)."' AND ifcheck='1'";
$rs=$db->get_one("SELECT COUNT(*) AS count FROM pw_threads WHERE fid='$fid' $searchadd");
$count=$rs['count'];
}else{
$searchadd=" AND ifcheck='1'";
$count=$foruminfo['topic'];
}
if ($winddb['t_num']){
$db_perpage = $winddb['t_num'];
} elseif ($forumset['threadnum']){
$db_perpage = $forumset['threadnum'];
}
if ($winddb['p_num']){
$db_readperpage = $winddb['p_num'];
} elseif ($forumset['readnum']){
$db_readperpage = $forumset['readnum'];
}
$tpcdb=array();
$db_maxpage && $page > $db_maxpage && $page=$db_maxpage;
(!is_numeric($page) || $page < 1) && $page=1;
if($db_recycle && $fid==$db_recycle){
$sql="fid='$fid'";
} elseif($db_topped && $foruminfo['top1']){
$sql="fid='$fid' AND topped=0";
$topadd=''; ///
$count+=$foruminfo['top1'];
} else{
$sql="fid='$fid'";
$topadd='topped DESC,';
}
$orderway ? $w_add="orderway=$orderway&asc=$asc&" : $w_add='';
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -