$hide_admin_id = "no";
include("conf/config.inc.php");
if ($out_see == "yes" && $userauth != "xoops")
include("auth_by_ezf123.php");
else
session_start();
if (!($userauth == "xoops" || $hide_admin_id != "no"))
session_destroy();
include("conf/defconf.inc.php");
if (isset($nuke_dir) && $usenuke == 1)
{
include("$nuke_dir/mainfile.php");
include("$nuke_dir/header.php");
}
include("inc/init.inc.php");
include("inc/backgroup.inc.php");
if (!($mypartid = $_GET['mypartid']))
$mypartid = $_POST['mypartid'];
$myrootuid = $_GET['myrootuid'];
$usenuke = $_GET['usenuke'];
$show = $_GET['show'];
if (!($mysearch = $_POST['mysearch']))
$mysearch = $_GET['mysearch'];
$stxt = $_POST['stxt'];
if (!($myday = $_POST['myday']))
$myday = $_GET['myday'];
$myyear = $_POST['myyear'];
$mymonth = $_POST['mymonth'];
$rt = $reloadtime * 60;
$t = time();
echo "";
echo "";
if (empty($tsize))
$tsize = 8;
include("inc/sslhost.inc.php");
echo "
$myname";
if ($bg_rand != "yes")
{
$mybg = bg($indexbg);
}
else
{
include ("inc/bgrand.inc.php");
$mybg = bg($outbg);
}
echo "";
include ("inc/myhost.inc.php");
$selecton = 1;
$tmppartid = $mypartid;
$mypartid = 0;
echo "";
if (empty($show))
$show = 0;
$mytime = date("Y-m-d H:i:s", (time() - $day * 86400));
$nowtime = date("Y-m-d H:i:s");
$nowdate = explode(" ",$nowtime);
$nowdate1 = explode("-",$nowdate[0]);
$nowdate2 = explode(":",$nowdate[1]);
$nownew = mktime($nowdate2[0], $nowdate2[1], $nowdate2[2], $nowdate1[1], $nowdate1[2], $nowdate1[0]) - 86400 * $new_day;
// 為 select 為初始值
if ($database == "mysql")
$S1 = "1";
elseif ($database == "pgsql")
$S1 = "true";
// 是否要搜尋
$S0 = "";
if (!empty($mysearch))
{
$search = str_replace("&#", "", htmlspecialchars(trim($mysearch)));
$S0 = "usertb, anntb, ";
$S1 = "usertb.userid=anntb.userid and titletb.tid=anntb.tid";
$S1 .= " and (titletb.subject like '%$search%'";
if ($stxt)
$S1 .= " or anntb.comment like '%$search%'";
$S1 .= ")";
}
else
$nosearch = 1;
if ($mypartid == 0)
{
$nopart = 1;
if ($nosearch == 1 && $noday == 1 && $noyear == 1)
{
if ($indexhavepage != "yes")
$nopage = 1; // 主公佈欄不做分頁
else
$isindex = 1;
$S1 = "(titletb.overtime > '$nowtime')";
}
}
else
$S1 .= " and (titletb.partid='$mypartid')";
if ($nopage != 1 && $day != $maxday) // 如果天數為最大值,做不限時的 select
{
if ($noyear == 1)
$S1 .= " and (titletb.posttime > '$mytime')";
else
{
if ($nomonth == 1)
{
$mymonth1 = "01";
$mymonth2 = "12";
}
else
$mymonth1 = $mymonth2 = $mymonth;
$ym1 = $myyear."-".$mymonth1."-01"." 00:00:00";
$ym2 = $myyear."-".$mymonth2."-31"." 00:00:00";
$S1 .= " and (titletb.posttime >= '$ym1' and titletb.posttime <= '$ym2')";
}
}
// 分頁的 select 的 limit 設定
$typetmp = "";
if ($nopage != 1)
{
if ($database == "mysql")
$S2 = " limit $show, $limit";
elseif ($database == "pgsql")
$S2 = " limit $limit, $show";
}
// 取資料
if ($indexhavepage == "yes")
{
if ($typefirst == "yes" && $isindex == 1)
$typetmp = "titletb.type desc,";
}
else
{
if ($typefirst == "yes" && $nopage == 1)
$typetmp = "titletb.type desc,";
}
// 算總數
$link = "select count(*) as total from ".$S0." titletb where (".$S1.")";
$sql_act = "array";
include ("inc/sql.inc.php");
$total = $row[total];
$link = "select titletb.* from ".$S0." titletb where (".$S1.") order by ".$typetmp." titletb.posttime desc".$S2;
$sql_act = "array";
include ("inc/sql.inc.php");
include ("inc/exitdoc.inc.php");
if ($number != 0)
{
include ("inc/title.inc.php");
include ("inc/pages.inc.php");
}
else
echo "目前沒有任何有效的公告。";
include ("conf/mysite.inc.php");
// 作者資訊,請保留,謝謝:)
include ("inc/ann.inc.php");
if ($usenuke == 1)
include("$nuke_dir/footer.php");
?>