include ($annpath."conf/defconf.inc.php");
echo $lang_title;
include ($annpath."inc/init.inc.php");
include ($annpath."inc/backgroup.inc.php");
include ($annpath."inc/realip.inc.php");
$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;
$mytime = date("Y-m-d H:i:s", (time() - $ezshowday * 86400));
$mypartid = $_GET['mypartid'];
if ($ez_typefirst == "yes")
  $typetmp = "titletb.type desc,";
if (!empty($mypartid))
{
  $partidtmp = substr($mypartid, 0, 8);
  $partidtmp = "and partid='$partidtmp'";
}
$link = "select * from titletb where (overtime > '$nowtime' and posttime > '$mytime' ". $partidtmp .") order by titletb.up desc, ".$typetmp." posttime desc";
$sql_act = "number";
include ($annpath."inc/sql.inc.php");
$mybg = bg($titletable);
$mybg1 = bg($titlerow);
$tmpss = "[按我進入 完整功能/管理模式]";
if ($rss_days)
  $rss_file = "
";
else
  $rss_file = NULL;
echo "
| ".$rss_file." 標  題 ".$tmpss." | 單位 | 日期 | 
";
$ii = 0;
for ($i = 0; $i < $number; $i++)
{
  $sql_act = "row";
  include ($annpath."inc/sql.inc.php");
  $tid = $row[tid];
  $partname = $row[partname];
  $subject = stripslashes($row[subject]);
  $posttime = $row[posttime];
  $firsttime = $row[firsttime];
  $type = $row[type];
  $up = $row[up];
  $mylocal = $row[local];
  $mydate = explode(" ",$posttime);
  $mydate1 = explode("-",$mydate[0]);
  $mydate2 = explode(":",$mydate[1]);
  $mydatef = explode(" ",$firsttime);
  $mydatef = explode("-",$mydatef[0]);
  if ($mydatef[0] != "0000" && $use_update_type == "yes")
  {
    if (($type * 10) % 10 == 1)
      $type = 9.1;
    else
      $type = 9;
  }
  include ("inc/type.inc.php");
  $localstr = "[".$ctype."]";
  if ($up)
    $localstr = "[置頂]";
  $issee = "ok";
  $my_local_type = NULL;
  if ($mylocal == "yes")
  {
    $localstr = $localstr;
    $issee = "no";
    $my_local_type = $local_type;
    $islocal = strtok($local, " ");
    if ($out_see == "yes")
        $issee = "ok";
    while ($islocal && $issee == "no")
    {
      $tmp_end = substr($islocal, -1);
      $tmp_ip = explode(".", $islocal);
      if (strstr($tmp_ip[3], "-"))
      {
        $tmp_ipc = explode("-", $tmp_ip[3]);
        $tmp_ipk = $tmp_ip[0].".".$tmp_ip[1].".".$tmp_ip[2].".";
  
        if (eregi("^" . $tmp_ipk, $myip))
        {
          $tmp_ipf = explode(".", $myip);
          if ($tmp_ipc[0] <= $tmp_ipf[3] && $tmp_ipc[1] >= $tmp_ipf[3])
            $issee = "ok";
        }
      }
      else if (strstr($tmp_end, "."))
      {
        if (eregi("^" . $islocal, $myip))
          $issee = "ok";
      }
      else
      {
        if (strstr($islocal, $myip))
          $issee = "ok";
      }
      $islocal = strtok(" ");
    }
  }
  if ($ii % 2)
  {
    $titleline = $titleline2;
    $mybg = bg($titlerow2);
  }
  else
  {
    $titleline = $titleline1;
    $mybg = bg($titlerow1);
  }
  if (($type * 10) % 10 == 1 && $issee == "ok")
    $ii++;
  $new = "";
  $mynew = mktime($mydate2[0], $mydate2[1], $mydate2[2], $mydate1[1], $mydate1[2], $mydate1[0]);
  $mydate1[0] = $mydate1[0] - 1911;
  if ($mynew >= $nownew)
    $new = " 
";
  $tmpa = "$myhost/show.php?mytid=$tid&mypartid=$mypartid&noday=$noday&nopart=$nopart&show=$show&myday=$myday&noyear=$noyear&nomonth=$nomonth&myyear=$myyear&mymonth=$mymonth";
  $tmpb = "";
  $tmpc = " ";
  if ($groupisc == "yes")
    $gs = "center";
  else
    $gs = "left";
  if ($hitsisc == "yes")
    $gt = "center";
  else
    $gt = "right";
  if (($type * 10) % 10 == 1 && $issee == "ok")
  {
    $ezhave = 1;
    echo "".$tmpb."|  ".$tmpb.$localstr.$subject.$tmpc.$my_local_type.$new." | ".$partname." | ".$mydate1[1]."/".$mydate1[2]." | ".$tmpc."
";
  }
}
if ($ezhave != 1)
  echo "| 目前沒有重點公告 [按我看詳細公告] | 
";
echo "
";
include ($annpath."inc/ann.inc.php");
?>