% '*-----------------------------------------------------------------------------* ' 設定変更可能 '*-----------------------------------------------------------------------------* Wk_autobr = 1 ' 。!?で自動改行(0=しない 1=する) Wk_title = "マブイの旅BBS" ' Title名 Wk_script = "aspbbs2.asp" ' スクリプト名(ファイル名) Wk_logfile = "aspbbs2.log" ' ログファイル名 Wk_pass = "film2696" ' 管理者用パスワード Wk_max = 300 ' 最大Log数(これを超える記事は古い順に削除されます) Wk_home = "index.html" ' 戻り先 Wk_Bgcolor = "#E6E6E6" ' メッセージ表示枠内の色 Wk_Textcolor = "#003300" ' テキストの色 Wk_TitleColor = "#990000" ' タイトルの色 Wk_AdminBgcolor = "#CCCCCC" ' 管理者メッセージの見出しの色 Wk_body = "
" Wk_tagkey = 0 ' タグ許可 (0=no 1=yes) Wk_autolink = 1 ' URLの自動リンク (0=no 1=yes)※タグ許可の場合は (0=no) とすること。 Wk_sort_flg = 1 ' 最新記事をTopに表示する(0=no 1=yes) Wk_p_log = 10 ' 1ページあたりの親記事表示数 Wk_res = 0 ' 返信機能 (0=有り 1=無し) Wk_find = 0 ' 検索機能 (0=有り 1=無し) Wk_acnt = 0 ' アクセスカウント機能 (0=有り 1=無し) Wk_entrymode = 0 ' 登録画面を(0=Topに表示 1=登録専用画面に表示する) 'Basp21が使える場合のみ利用できます Wk_mailing = 0 ' メール通知機能(0=しない 1=投稿全て 2=管理者以外の投稿) Wk_mailto = "***@***.com" ' メール通知先アドレス(メール通知する場合) Wk_smtpsrv = "***.***.com" ' SMTPサーバーの指定 Dim Wk_nohost(10) Wk_nohost(0) = "***.***.***.***" ' ホストアドレスによるアクセス制限(ホストアドレスを記述) Wk_nohost(1) = "***.***.***.***" ' ホストアドレスによるアクセス制限(ホストアドレスを記述) Wk_nohost(2) = "***.***.***.***" ' ホストアドレスによるアクセス制限(ホストアドレスを記述) Wk_nohost(3) = "***.***.***.***" ' ホストアドレスによるアクセス制限(ホストアドレスを記述) Wk_nohost(4) = "***.***.***.***" ' ホストアドレスによるアクセス制限(ホストアドレスを記述) Wk_nohost(5) = "***.***.***.***" ' ホストアドレスによるアクセス制限(ホストアドレスを記述) Wk_nohost(6) = "***.***.***.***" ' ホストアドレスによるアクセス制限(ホストアドレスを記述) Wk_nohost(7) = "***.***.***.***" ' ホストアドレスによるアクセス制限(ホストアドレスを記述) Wk_nohost(8) = "***.***.***.***" ' ホストアドレスによるアクセス制限(ホストアドレスを記述) Wk_nohost(9) = "***.***.***.***" ' ホストアドレスによるアクセス制限(ホストアドレスを記述) Wk_nohost(10) = "***.***.***.***" ' ホストアドレスによるアクセス制限(ホストアドレスを記述) Dim Wk_noAgent(5) Wk_noAgent(0) = "D-Engine" ' 自動書き込みソフトのアクセス制限 Wk_noAgent(1) = "D-Engine" ' 自動書き込みソフトのアクセス制限 Wk_noAgent(2) = "D-Engine" ' 自動書き込みソフトのアクセス制限 Wk_noAgent(3) = "D-Engine" ' 自動書き込みソフトのアクセス制限 Wk_noAgent(4) = "D-Engine" ' 自動書き込みソフトのアクセス制限 Wk_noAgent(5) = "D-Engine" ' 自動書き込みソフトのアクセス制限 Wk_ImgTitle = "http://www.film-izmax.com/mabui/img_tit.gif" ' Titleに画像を使用する場合 (http://から画像を指定) Wk_ImgWidth = "339" ' Titleに画像を使用する場合に「横」のピクセル数 Wk_ImgHight = "67" ' Titleに画像を使用する場合に「縦」のピクセル数 ' '*-----------------------------------------------------------------------------* ' 設定変更可能ここまで '*-----------------------------------------------------------------------------* Dim Wk_AllLog_array() ReDim Preserve Wk_AllLog_array(Wk_Max - 1) Dim Wk_mode Dim Wk_tno Dim Wk_admes Dim Wk_no Dim Wk_reno Dim Wk_date Dim Wk_name Dim Wk_mail Dim Wk_sub Dim Wk_mes Dim Wk_url Dim Wk_host Dim Wk_TopCnt Dim Wk_pwd Dim Wk_flg Dim Wki_word Dim Wki_cond Dim Wki_no Dim Wki_reno Dim Wki_pwd Dim Wki_pwd2 ' クッキー用 Dim Wki_name Dim Wki_email Dim Wki_sub Dim Wki_mes Dim Wki_url Dim Wki_pass Dim Wki_res Dim Cnt_All Dim Cnt_Today Dim Cnt_Yesterday Dim Wk_User_Agent Wk_ver = "copyright(c)2002Y'creative" Wk_Lockfile = "lock.dat" Wk_LockAfile = "Alock.dat" ' '*-----------------------------------------------------------------------------* ' コントロール処理 '*-----------------------------------------------------------------------------* Call decode Call access_check If Wk_acnt = 0 Then Call AccessCount() End If Select Case Wk_mode Case "entry" Call entry Case "regist" Call regist Case "userdel" Call userdel Case "del" Call del_msg Case "find" Call find Case "admin" Call admin End Select Call LogView ' '*-----------------------------------------------------------------------------* ' アクセス制限 '*-----------------------------------------------------------------------------* Sub access_check() If Wk_nohost(0) <> "" Then Call get_host ' ホストアドレスを取得 Wk_flag = 0 For Each Wkl_nohost In Wk_nohost If Wkl_nohost = "" Then Exit For End If If Wkl_nohost = Wk_host Then Wk_flag = 1 Exit For End If Next If Wk_flag = 1 Then Call error(Wk_host & "| "
Response.Write " |
| "
Response.Write "■管理者からのメッセージ " Response.Write " |
"
Response.Write "" Response.Write " |
"
Response.Write "
| "
Response.Write "
| "
Response.Write " " & vbCRLF Response.Write " |
| "
Response.Write " " & vbCRLF Else Response.Write "★新規 書き込み★ " & vbCRLF End If Response.Write " |
"
Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write " |
| "
Response.Write " " & vbCRLF Response.Write " |
| "
Response.Write " " & vbCRLF Response.Write " |
"
Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write " |
| "
Response.Write " " & vbCRLF Response.Write " |
| "
Response.Write " " & vbCRLF Response.Write " |
"
Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write " |
| "
Response.Write Wk_Ix & " 件のデータが有ります" & " " Response.Write " |
"
Response.Write "
| "
Response.Write "
| "
Response.Write "キーワードを入力して下さい。" & vbCRLF
Response.Write " " & vbCRLF Response.Write " |
| "
Response.Write " " & vbCRLF Response.Write " |
| "
Response.Write " |
"
Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write " |
| "
Response.Write " |
| " Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write " |
| " & vbCRLF
Call Top_Banner()
If Wk_ImgTitle <> "" Then
Response.Write " " & vbCRLF Response.Write " |
"
Response.Write ""
Response.Write "" Wkl_mes = Replace(Wk_mes & "" & vbCRLF Wk_flg = 1 Else Response.Write " " Response.Write "" & vbCRLF Wk_flg = 1 End If End Sub ' '*-----------------------------------------------------------------------------* ' 明細の表示 '*-----------------------------------------------------------------------------* Sub DetailsView2() Wkl_mes_all = "" Wk_Ix = 0 ' If Wk_autolink = 1 Then ' 自動リンク If Instr(Wk_mes," ") > 0 Then Wk_mes_array = Split(Wk_mes," ") For Each Wkl_mes In Wk_mes_array If Wk_Ix > 0 Then Wkl_mes_all = Wkl_mes_all & " " & auto_link(Wkl_mes) Else Wkl_mes_all = auto_link(Wkl_mes) End If Wk_Ix = Wk_Ix + 1 Next Wk_mes = Wkl_mes_all Else Wk_mes = auto_link(Wk_mes) End If End If If Wk_autobr = 1 Then ' 自動改行 Wk_mes = Replace(Wk_mes,"。 ","。") Wk_mes = Replace(Wk_mes,"! ","!") Wk_mes = Replace(Wk_mes,"? ","?") Wk_mes = Replace(Wk_mes,"。","。 ") Wk_mes = Replace(Wk_mes,"!","! ") Wk_mes = Replace(Wk_mes,"?","? ") Wk_mes = Replace(Wk_mes," 。","。") Wk_mes = Replace(Wk_mes," !","!") Wk_mes = Replace(Wk_mes," ?","?") End If ' If Wk_mail <> "" Then Wk_name = "" & Wk_name & "" End If If Wk_url <> "" Then Wk_url = "の <" & "ホームページ" & "> " End If Response.Write "
" & vbCRLF End Sub ' '*-----------------------------------------------------------------------------* ' エラー処理 '*-----------------------------------------------------------------------------* Sub error(Wk_In) Call header Response.Write "
" & vbCRLF Response.Write " " & Wk_In & " ",vblf) Wk_m_mes = Replace(Wk_m_mes,"<","<") Wk_m_mes = Replace(Wk_m_mes,">",">") Wk_m_mes = Replace(Wk_m_mes,"&","&") ' Set ml = Server.CreateObject("basp21") ' Basp21を利用したメール送信 smtpsrv = Wk_smtpsrv ' SMTPサーバーの指定 mailto = Wk_mailto & Chr(9) & ">Content-Type: text/plain; charset=x-sjis" ' 受信者のメールアドレス ' If Wki_email = "" Then ' メールの送信者名&アドレス mailfrom = Wk_name & "<" & "aspibbs@nomail.xxx" & ">" Else mailfrom = Wk_name & "<" & Wki_email & ">" End If ' sbj = Wk_title & " > " & Wki_sub ' メールの題名(Subject) ' メールの内容(Body) body = "======================================================================" & vbCrLf body = body & "書き込み日時:" & Wk_date & vbCrLf body = body & "投稿ホスト :" & Wk_host & vbCrLf body = body & "投稿者名 :" & Wki_name & vbCrLf body = body & "投稿者メール:" & Wki_email & vbCrLf body = body & "投稿者HP :" & Wki_url & vbCrLf body = body & "題名 :" & Wki_sub & vbCrLf body = body & "▼内容" & vbCrLf body = body & Wk_m_mes & vbCrLf body = body & "======================================================================" & vbCrLf ' file="" ' 添付ファイルの指定 ' rc = ml.SendMail(smtpsrv,mailto,mailfrom,sbj,body,file) ' メールの送信 Set ml = Nothing If rc <> "" Then ' メールの送信失敗後のメッセージ出力 Call error("メール送信に失敗しました") End If End Sub ' '*-----------------------------------------------------------------------------* ' 自動リンク (タグがない時のみ) ' この自動リンクロジックはWING☆さん に 著作権が有ります ' URL : http://www04.u-page.so-net.ne.jp/yd5/wing/aspyui/ ' E-mail : wing@yd5.so-net.ne.jp '*-----------------------------------------------------------------------------* Function auto_link(Wk_In) If (Instr(1,Wk_In,"http://") > 0 or Instr(1,Wk_In,"ftp://") > 0 or Instr(1,Wk_In,"mailto:") > 0) and InStr(1,Wk_In,"<") = 0 Then Wk_In = Replace(Wk_In,"__URL__","") flg = 0 Wk_Incp = "" urlcp = "" for i = 1 to len(Wk_In) j = Mid(Wk_In,i,1) Select Case UCase(j) Case "A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","1","2","3","4","5","6","7","8","9","0","$","@","/","%",".","_","-","~","#","&","=","l",":","?" If Mid(Wk_In,i,7) = "http://" or Mid(Wk_In,i,6) = "ftp://" or Mid(Wk_In,i,7) = "mailto:" Then If flg = 1 Then Wk_Incp = Replace(Wk_Incp,"__URL__",urlcp) Wk_Incp = Wk_Incp & "" urlcp = "" End If If Mid(Wk_In,i,7) = "mailto:" Then 'メールの場合のフォーマット設定 Wk_Incp = Wk_Incp & "" Else 'URL又はftpの場合のフォーマット設定 Wk_Incp = Wk_Incp & "" End If flg = 1 End If If flg = 1 Then urlcp = urlcp & Mid(Wk_In,i,1) End If Case Else If flg = 1 Then Wk_Incp = Replace(Wk_Incp,"__URL__",urlcp) Wk_Incp = Wk_Incp & "" flg = 0 urlcp = "" End If End Select Wk_Incp = Wk_Incp & j Next If flg = 1 Then Wk_Incp = Replace(Wk_Incp,"__URL__",urlcp) Wk_Incp = Wk_Incp & "" End If auto_link = Wk_Incp Else auto_link = Wk_In End If End Function ' '*-----------------------------------------------------------------------------* '* データの読み込み '*-----------------------------------------------------------------------------* sub read_data() On Error Resume Next Set objFile = Server.CreateObject("Scripting.FileSystemObject") Set DataFile = objFile.OpenTextFile(Server.MapPath(Wk_logfile), 1, FALSE) If Err.Number > 0 Then Call error("Read Error : " & Wk_logfile) Else Do Until DataFile.AtEndOfStream Wk_LineCnt = DataFile.Line - 1 If Wk_LineCnt > 0 Then Wk_AllLog_array(Wk_LineCnt - 1) = DataFile.ReadLine Else Wkl_Log = DataFile.ReadLine Wkl_Log_array = Split(Wkl_Log,"<>") If UBound(Wkl_Log_array) >= 1 Then Wk_tno = Wkl_Log_array(0) Wk_admes = Wkl_Log_array(1) End If End If Loop End If ' DataFile.Close Set DataFile = Nothing Set objFile = Nothing ' On Error GoTo 0 End Sub ' '*-----------------------------------------------------------------------------* '* データの書き込み '*-----------------------------------------------------------------------------* Sub write_data(Wk_In) On Error Resume Next Call File_Lock() Set objFile = Server.CreateObject("Scripting.FileSystemObject") Set WDateFile = objFile.OpenTextFile(Server.MapPath(Wk_logfile), 2, TRUE) ' If Err.Number > 0 Then Call error("Write Error : " & Wk_logfile) Else Wkl_In_array = split(Wk_In,"<>") If UBound(Wkl_In_array) >= 1 Then Wkl_no = Wkl_In_array(0) Wkl_reno = Wkl_In_array(1) End If ' WDateFile.WriteLine(Wk_tno & "<>" & Wk_admes & "<><><><><><><><><><><><>") If Wkl_reno = "" Then ' 親記事の時 WDateFile.WriteLine(Wk_In) For Wk_Ix = 0 To (Wk_Max - 2) WDateFile.WriteLine(Wk_AllLog_array(Wk_Ix)) Next Else ' 子記事の時 If Wk_sort_flg = 0 Then ' ソートしない Wkl_sw = 0 Ix1 = 0 ReDim Preserve Wkl_AllLog_array2(Wk_Max - 1) For Each Wkl_Log In Wk_AllLog_array Wkl_Log_array = split(Wkl_Log,"<>") If UBound(Wkl_Log_array) >= 1 Then Wkl_Log_no = Wkl_Log_array(0) Wkl_Log_reno = Wkl_Log_array(1) Else Exit For End If If (Wkl_sw = 0) and (Wkl_reno = Wkl_Log_no) Then Wkl_sw = 1 Else If (Wkl_sw = 1) and (Wkl_reno <> Wkl_Log_reno) Then Wkl_sw = 2 Wkl_AllLog_array2(Ix1) = Wk_In Ix1 = Ix1 + 1 End If End If Wkl_AllLog_array2(Ix1) = Wkl_Log Ix1 = Ix1 + 1 Next If Wkl_sw = 1 Then Wkl_AllLog_array2(Ix1) = Wk_In End If For Each Wkl_Log2 In Wkl_AllLog_array2 WDateFile.WriteLine(Wkl_Log2) Next Else ' 最上へのソートをする Wkl_sw = 0 Ix1 = 0 Iy1 = 0 ReDim Preserve Wkl_AllLog_array2(Wk_Max - 1) ReDim Preserve Wkl_AllLog_array3(Wk_Max - 1) For Each Wkl_Log In Wk_AllLog_array Wkl_Log_array = split(Wkl_Log,"<>") If UBound(Wkl_Log_array) >= 1 Then Wkl_Log_no = Wkl_Log_array(0) Wkl_Log_reno = Wkl_Log_array(1) Else Exit For End If If Wkl_reno = Wkl_Log_no Then Wkl_AllLog_array2(Ix1) = Wkl_Log Ix1 = Ix1 + 1 Wkl_sw = 1 Else If Wkl_reno = Wkl_Log_reno Then Wkl_AllLog_array2(Ix1) = Wkl_Log Ix1 = Ix1 + 1 Else If (Wkl_sw = 1) And (Wkl_reno <> Wkl_Log_reno) Then Wkl_AllLog_array2(Ix1) = Wk_In Wkl_AllLog_array3(Iy1) = Wkl_Log Ix1 = Ix1 + 1 Iy1 = Iy1 + 1 Wkl_sw = 2 Else Wkl_AllLog_array3(Iy1) = Wkl_Log Iy1 = Iy1 + 1 End If End If End If Next If Wkl_sw = 1 Then Wkl_AllLog_array2(Ix1) = Wk_In Ix1 = Ix1 + 1 End If For Each Wkl_Log3 In Wkl_AllLog_array3 Wkl_AllLog_array2(Ix1) = Wkl_Log3 Ix1 = Ix1 + 1 Next For Each Wkl_Log2 In Wkl_AllLog_array2 WDateFile.WriteLine(Wkl_Log2) Next End If End If End If ' WDateFile.Close Set WDataFile = Nothing Set objFile = Nothing ' Call File_UnLock() ' On Error GoTo 0 End Sub ' '*-----------------------------------------------------------------------------* '* データの書き込み '*-----------------------------------------------------------------------------* Sub write_data2(In_Data) On Error Resume Next Call File_Lock() Set objFile = Server.CreateObject("Scripting.FileSystemObject") Set WDateFile = objFile.OpenTextFile(Server.MapPath(Wk_logfile), 2, TRUE) ' If Err.Number > 0 Then Call error("Write Error : " & Wk_logfile) Else In_Data = Replace(In_Data,"&","&") In_Data = Replace(In_Data,"<","<") In_Data = Replace(In_Data,">",">") In_Data = Replace(In_Data,vbcrlf," ") In_Data = Replace(In_Data,vbcr," ") In_Data = Replace(In_Data,vblf," ") WDateFile.WriteLine(Wk_tno & "<>" & In_Data & "<><><><><><><><><><><><>") For Each Wkl_Log In Wk_AllLog_array WDateFile.WriteLine(Wkl_Log) Next End If ' WDateFile.Close Set WDataFile = Nothing Set objFile = Nothing ' Call File_UnLock() ' On Error GoTo 0 End Sub ' '*-----------------------------------------------------------------------------* '* データの削除 '*-----------------------------------------------------------------------------* Sub delete_data(Wk_In) On Error Resume Next Call File_Lock() Set objFile = Server.CreateObject("Scripting.FileSystemObject") Set WDateFile = objFile.OpenTextFile(Server.MapPath(Wk_logfile), 2, TRUE) ' If Err.Number > 0 Then Call error("Write Error : " & Wk_logfile) Else WDateFile.WriteLine(Wk_tno & "<>" & Wk_admes & "<><><><><><><><><><><><>") For Each Wkl_Log In Wk_AllLog_array Wkl_Log_array = split(Wkl_Log,"<>") If UBound(Wkl_Log_array) >= 10 Then Wkl_no = Wkl_Log_array(0) Wkl_reno = Wkl_Log_array(1) Wkl_date = Wkl_Log_array(2) Wkl_name = Wkl_Log_array(3) Wkl_mail = Wkl_Log_array(4) Wkl_sub = Wkl_Log_array(5) Wkl_mes = Wkl_Log_array(6) Wkl_url = Wkl_Log_array(7) Wkl_host = Wkl_Log_array(8) Wkl_pwd = Wkl_Log_array(9) Wkl_User_Agent = Wkl_Log_array(10) Else Wkl_no = "" Wkl_reno = "" Wkl_date = "" Wkl_name = "" Wkl_mail = "" Wkl_sub = "" Wkl_mes = "" Wkl_url = "" Wkl_host = "" Wkl_pwd = "" End If If Wkl_no = Wk_In Then Wkl_Log = Wkl_no & "<>" Wkl_Log = Wkl_Log & Wkl_reno & "<>" Wkl_Log = Wkl_Log & Wk_date & "<>" Wkl_Log = Wkl_Log & Wkl_name & "<>" Wkl_Log = Wkl_Log & Wkl_email & "<>" Wkl_Log = Wkl_Log & Wkl_sub & "<>" Wkl_Log = Wkl_Log & "削除されました" & "<>" Wkl_Log = Wkl_Log & Wkl_url & "<>" Wkl_Log = Wkl_Log & Wk_host & "<>" Wkl_Log = Wkl_Log & Wkl_pwd & "<>" Wkl_Log = Wkl_Log & Wk_User_Agent & "<>" Wkl_Log = Wkl_Log & "<><>" End If WDateFile.WriteLine(Wkl_Log) Next End If ' WDateFile.Close Set WDataFile = Nothing Set objFile = Nothing ' Call File_UnLock() ' On Error GoTo 0 End Sub ' '*-----------------------------------------------------------------------------* '* ファイルのロック '*-----------------------------------------------------------------------------* Sub File_Lock() On Error Resume Next Set objFile1 = Server.CreateObject("Scripting.FileSystemObject") If objFile1.FileExists(Server.MapPath(Wk_Lockfile)) = true Then Call error("他の方が書込み中 お手数ですが 再度実行して下さい。") Exit Sub End If ' Application.Lock ' Set objFile2 = Server.CreateObject("Scripting.FileSystemObject") set LockFile = objFile2.CreateTextFile(Server.MapPath(Wk_Lockfile),true,False) ' Set LockFile = Nothing Set objFile1 = Nothing Set objFile2 = Nothing ' On Error GoTo 0 End Sub ' '*-----------------------------------------------------------------------------* '* ファイルのロック解除 '*-----------------------------------------------------------------------------* Sub File_UnLock() On Error Resume Next ' Set objFile = Server.CreateObject("Scripting.FileSystemObject") set UnLockFile = objFile.DeleteFile(Server.MapPath(Wk_Lockfile),true) ' Set UnLockFile = Nothing Set objFile = Nothing ' Application.Unlock ' On Error GoTo 0 End Sub ' '*-----------------------------------------------------------------------------* ' フッター '*-----------------------------------------------------------------------------* Sub footer() Response.Write "
" & vbCRLF Response.Write "" & vbCRLF Response.Write "
|