<?php

$admver="2.00b";
$timestamp=time()+(3600*$time_hour);
$cookietime=$timestamp+(3600*24*365);
$stime=strftime("%Y-%m-%d.%H:%M:%S",$timestamp);
$dtime=strftime("%Y-%m-%d",$timestamp);
$istime=strftime("%Y%m%d%H%M%S",$timestamp);
$imtime=strftime("%Y%m%d%H%M",$timestamp);

$uip=($GLOBALS['HTTP_X_FORWARDED_FOR'])?$GLOBALS['HTTP_X_FORWARDED_FOR']:$GLOBALS['REMOTE_ADDR'];

define('mINFORMATION', 64);
define('mCRITICAL', 16);

function msgBox($prompt,$buttons=0,$title='',$url='',$urltext='')
{
 $msgtype=($buttons==mCRITICAL) ? 
  '<FONT size=7 face=Wingdings color=red>L</FONT>' :
  '<FONT size=7 face=Wingdings color=green>%</FONT>';
 if(!$title){$title='论坛信息';}
 if($url){$url="<a href='$url'>$urltext</a>";}

 page_header();
 print <<<EOT
<BR><BR><BR><BR><BR>
<TABLE border=0 cellpadding=4 cellspacing=1 width=80% class="forumline" align="center">
<tr><th class="thHead"><b>$title</b></th></tr>
<tr><td align=right class="row1">
 <table width="100%" border="0">
 <tr><td width="80" align=center>$msgtype</td><td>$prompt</td></tr>
 </table></td></tr>
<tr>
 <td align=center class="catBottom">
 <a href="#" onclick=javascript:history.back()>返回</a>
 &nbsp; &nbsp;$url</td></tr>
</TABLE>
EOT;
 page_footer();
}

function page_header($title='')
{
 global $ck_admuser, $stime;

 print <<<EOT
<HTML><HEAD>
<meta http-equiv=Content-Type content=text/html; charset=gb2312>
<link rel="stylesheet" href="admin/adm.css" type="text/css"></HEAD>
<TITLE>$title</TITLE>
<BODY>
<table width=100% cellspacing=0 board=0 cellpadding=0>
<tr>
 <td>当前位置：<a target=_top href=viewblist.php>论坛首页</a>-&gt;管理中心</td>
 <td>当前用户：$ck_admuser</td>
 <td align="right">当前论坛时间：$stime</td>
</tr>
</table><hr>
EOT;
}

function page_footer()
{
 global $admver;

 print <<<EOT
<BR><BR><CENTER class=copyright>Powered by zChain Bulletin Board (ZBB) Version $admver<br>
Copyright &copy; 2001-2002,
<a target=_blank href=http://www.zchain.net>zChain.net</a>.
All rights reserved</CENTER>
</BODY></HTML>
EOT;
}

function jumpTo($url)
{
 print <<<EOT
<html><head>
<meta http-equiv=Content-Type content=text/html;charset=gb2312>
<meta http-equiv=refresh content=0;url=$url>
</head>
EOT;
}

function cleanText($a_text)
{
 $a_text=stripslashes($a_text); $a_text=str_replace("\n",'',$a_text);
 return $a_text;
}

function cleanHtml($a_text)
{
 $a_text=stripslashes($a_text); $a_text=str_replace("\n",'<BR>',$a_text);
 return $a_text;
}

?>