function sdatetime($str){
$str=ereg_replace("-","/",$str);
$str=substr($str,5,strlen($str)-8);
$str; を返します。
}
function reAnum($sid){ //羆莱絞り计
$DROOT=getenv('DOCUMENT_ROOT');
include("sql.php3");
$db=mysql_connect($sql['host'], $sql['user'] , $sql['passwd']);
$qsql="sid='$sid' の bbs_docs から ID を選択します";
$rs=mysql_db_query($sql['db'],$qsql);
return mysql_num_rows($rs);
}
function pagebar($pages) {
global $pgno;
//グローバル $pages;
グローバル $PHP_SELF;
グローバル $aid;
グローバル $OPEN_LIST;
echo "
";
}
//====================================== =========================================
関数 openlist($sid) {
グローバル $aid;
グローバル $PHP_SELF;
$DROOT=getenv('DOCUMENT_ROOT');
include("sql.php3");
$db=mysql_connect($sql['host'], $sql['user'] , $sql['passwd']);
$qsql="SELECT * from bbs_docs where sid='$sid' order by wdate";
$rs=mysql_db_query($sql['db'],$qsql);
//if(mysql_num_rows($rs)==0) return;
//echo mysql_num_rows($rs);
while($row=mysql_fetch_array($rs)) {
$id=$row['id'];
$banner=$row['banner'];
$poster=$row['poster'];
$views=$row['views'];
$wdate=sdatetime($row['wdate']);
echo "
";
echo ""; echo ""; echo " $banner"; エコー ""; //echo "バナーは $banner"; echo " | ";
echo ""; echo $poster; echo " | ";
echo ""; エコー「 」; echo " | ";
echo ""; echo $views; echo " | ";
echo ""; echo $wdate; echo " | ";
echo "
";
}
}
//========================================= ==============================
function area() {
global $PHP_SELF;
グローバル $aid,$sid,$pgno;
グローバル $OPEN_LIST;
$showitems=20;
$DROOT=getenv('DOCUMENT_ROOT');
include("sql.php3");
$db=mysql_connect($sql['host'], $sql['user'] , $sql['passwd']);
//============================================ ===============
if(!$aid) {
$qsql="bbs_area から id を選択";
$rs=mysql_db_query($sql['db'],$qsql);
$row=mysql_fetch_array($rs);
$aid=$row['id'];
}
if(!$sid) {
$qsql="bbs_subj から id を選択します (aid=$aid order by wdate DESC)";
$rs=mysql_db_query($sql['db'],$qsql);
$row=mysql_fetch_array($rs);
$sid=$row['id'];
}
if(!$pgno) {//礚﹚计
//$pgno=0;
$items=0;
$qsql="bbs_subj から ID を選択します。ここで、aid=$aid order by wdate DESC";
$rs=mysql_db_query($sql['db'],$qsql);
while($row=mysql_fetch_array($rs)){
$id=$row['id'];
if($id==$sid) ブレーク;
$items ;
}
$pgno=(INT)($items/$showitems);
}
//========================================= ==================
$qsql="SELECT * from bbs_area where id=$aid ";
$rs=mysql_db_query($sql['db'],$qsql);
$row=mysql_fetch_array($rs);
$banner=$row['banner'];
$body=$row['body'];
$master=$row['master'];
echo "
$banner";
echo "
";
$qsql="SELECT * from bbs_subj where aid=$aid order by wdate DESC";
$rs=mysql_db_query($sql['db'],$qsql);
$all=mysql_num_rows($rs); //行数
$pages=(INT)($all/$showitems); // ページの方法
$pgcount=$pgno*$showitems;
if($pgcount > $all) {
$pgno=$pages-1; // 全ページにわたるページ ポイント
$pgcount=$pgno*$showitems;
}
mysql_data_seek($rs, $pgcount);
$cnt=0;
ページバー($pages);
echo "
";
echo ""; echo ""; echo ""; echo "夹肈 | "; echo "祇感染 | "; echo "
莱 | "; echo " | "; echo "ら戳 | "; echo " "; while($row=mysql_fetch_array($rs)) { if( $cnt > $showitems) Break; $id=$row['id']; $banner=$row['banner']; $poster=$row['poster']; $views=$row['views']; $wdate=sdatetime($row['wdate']); $docs=reAnum($id); echo ""; echo ""; echo ""; if($sid==$id) echo ""; else echo $banner; エコー ""; echo " | "; echo ""; echo $poster; echo " | "; echo ""; echo $docs; echo " | "; echo ""; echo $views; echo " | "; echo ""; echo $wdate; echo " | "; echo " "; if($OPEN_LIST) openlist($id); } echo " "; echo" |
";
ページバー($pages);
}
待ち续....