BBS001.php
2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?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');
?>