BBS001.php 2.18 KB
<?php 
//*****************************************************************************
//* 
//* プログラム名:掲示板
//* プログラムID:BBS001.php
//* 機能        :掲示板一覧画面
//* 作成者      :
//* 
//*****************************************************************************
header("Content-type: text/html; charset=EUC-JP");

//***************************
//* インクルードファイル
//***************************
include("include/session_start.inc");
include("include/SessionChk.inc");
include("include/STRING.inc");
include("inc/Advertisement.inc");
include('./include/smarty.conf');

include("inc/header.inc");
include("inc/input_chk.inc");

//**** メニュー ****//
include("menu_opacity.php");

include("./include/dbcon.inc");				//DB接続

include("inc/BBS001.inc");

$o_smarty = new Smarty;
$o_smarty->clear_all_assign();

$strTempPath="temp/".$PHP_FOLDER_NAME."/bbs/";

if (empty($intPage)){
	$intPage=0;
}

//掲示期限超過掲示板削除
$strSQL="select seq, filename from bbs_tbl where period is not null and period < '".date("YmdHi")."'";
$objRecSet = pg_exec($strSQL);
if($objRecSet==false){
	echo("SQL実行に失敗しました(SELECT)");
	exit;
}
if(pg_numrows($objRecSet) > 0){
	for($i=0;$i<pg_numrows($objRecSet);$i++){
		$objFtc = pg_fetch_object($objRecSet, $i);
		//添付ファイル削除
		if(trim($objFtc->filename) != ""){
			if(file_exists($strTempPath.($objFtc->filename)) == true){
				$ret = unlink($strTempPath.($objFtc->filename));
				if($ret==false){
					echo("ファイル削除に失敗しました");
					exit;
				}
			}
		}
		//掲示板削除
		$strSQL2="delete from bbs_tbl where seq = ".($objFtc->seq);
		$objRecSet2 = pg_exec($strSQL2);
		if($objRecSet2==false){
			echo("SQL実行に失敗しました(DELETE)");
			exit;
		}
		//掲示板個人データ削除
		$strSQL2="delete from pbbs_tbl where seq = ".($objFtc->seq);
		$objRecSet2 = pg_exec($strSQL2);
		if($objRecSet2==false){
			echo("SQL実行に失敗しました(DELETE)");
			exit;
		}
	}
}

$o_smarty->assign('PageBack',$PageBack);
$o_smarty->assign('PageNext',$PageNext);
$o_smarty->assign('intPage',$intPage);

$o_smarty->assign('PHP_TITLE_NAME',$PHP_TITLE_NAME[8]);

//無料版ダウンロードボタン制御
$o_smarty->assign('PHP_MODE_FLG',$PHP_MODE_FLG);

$o_smarty->display('BBS001.tpl');

?>