function prev_subj($id){
$DROOT=getenv('DOCUMENT_ROOT');
include("sql.php3");
$db=mysql_connect($sql['host'], $sql['user'] , $sql['passwd']);
$qstr="select id,aid from bbs_subj where id='$id'";
$rs=mysql_db_query($sql['db'],$qstr);
$row=mysql_fetch_array($rs);
$aid=$row['aid'];
$qstr="select id from bbs_subj where aid='$aid' order by wdate DESC";
$rs=mysql_db_query($sql['db'],$qstr);
$pid=$id;
while($row=mysql_fetch_array($rs)){
$tid=$row['id'];
if($id==$tid) break;
$pid=$tid;
}
return $pid;
}
// 絞
function next_subj($id){
$DROOT=getenv('DOCUMENT_ROOT');
include("sql.php3");
$db=mysql_connect($sql['host'], $sql['user'] , $sql['passwd']);
$qstr="select id,aid from bbs_subj where id='$id'";
$rs=mysql_db_query($sql['db'],$qstr);
$row=mysql_fetch_array($rs);
$aid=$row['aid'];
$qstr="select id from bbs_subj where aid='$aid' order by wdate DESC";
$rs=mysql_db_query($sql['db'],$qstr);
$pid=$id;
while($row=mysql_fetch_array($rs)){
$pid=$row['id'];
if($id==$pid) break;
}
if($row=mysql_fetch_array($rs)) {
$pid=$row['id'];
}
return $pid;
}
//======================================================================
function viewbar() {
global $pgno;
global $PHP_SELF;
global $aid,$sid;
//global $OPEN_LIST;
echo "
"; $nextid=next_subj($sid); $previd=prev_subj($sid); echo "[夹肈跋]"; echo "[莱セ絞]"; echo "[祇穝ゅ彻]"; echo "[絞]"; echo "[絞]"; //echo "[程絞]"; echo " | ";
"; viewbar(); echo " | ||||||
"; //====ゅ彻============== echo "
echo " | ||||||
"; //=======籔狟ねだㄉ=============== echo " echo " | ||||||
"; //=======mail List=============== echo " echo " | ||||||
"; viewbar(); echo " |