#!/usr/local/bin/perl $script = "geki.html"; require './lib/jcode.pl'; require './lib/teikei.pl'; require './lib/dbsetup.pl'; #◇ New!マーク 最近の発言につけるマーク $newf ='NEW!'; #◇ New!マーク表示時間 $new = 24 ; &decode; #----------------# # 書込Cookie準備 # #----------------# $setcook1 = &setCookie("ID", $COOKIE{ID}); #------------------# # ログインチェック # #------------------# &DBConnect; $sth = $db->prepare("select ID from ppass where ID = \"$COOKIE{ID}\""); if(!$sth->execute){ &error ("接続失敗2"); } $data = $sth->fetchrow; if ($data){ $LOGIN_FLAG = $data; } else{ $LOGIN_FLAG = ""; } &DBDisconnect; $center .= '
本日激ぱっち
ホールから直接提供の最新情報から表示する「本日激ぱっち」会員限定配信中です。
'; #----------------# # ホール情報分岐 # #----------------# if ($in{'area'} eq "tokyo"){ $gekifile = "hall_tokyo"; $imagedir = "./images/hall/tokyo"; $mini_imagedir = "./images/hall/tokyo/mini"; if ($in{'mode'} eq "all"){&all;} if ($in{'mode'} eq "shop"){&shop;} }elsif ($in{'area'} eq "keihin"){ $gekifile = "hall_keihin"; $imagedir = "./images/hall/keihin"; $mini_imagedir = "./images/hall/keihin/mini"; if ($in{'mode'} eq "all"){&all;} if ($in{'mode'} eq "shop"){&shop;} }elsif ($in{'area'} eq "osaka"){ $gekifile = "hall_osaka"; $imagedir = "./images/hall/osaka"; $mini_imagedir = "./images/hall/osaka/mini"; if ($in{'mode'} eq "all"){&all;} if ($in{'mode'} eq "shop"){&shop;} }elsif ($in{'area'} eq "sapporo"){ $gekifile = "hall_sapporo"; $imagedir = "./images/hall/sapporo"; $mini_imagedir = "./images/hall/sapporo/mini"; if ($in{'mode'} eq "all"){&all;} if ($in{'mode'} eq "shop"){&shop;} }else{ $gekifile1 = "hall_tokyo"; $gekifile2 = "hall_keihin"; $gekifile3 = "hall_osaka"; $gekifile4 = "hall_sapporo"; $center .= <
東京エリアはこちらから
本日激ぱっち東京エリア!
京浜エリアはこちらから
本日激ぱっち京浜エリア!
大阪・阪神エリアはこちらから
本日激ぱっち大阪・阪神エリア!

携帯でアクセス!
EOF } &html; #----------# # 全件表示 # #----------# sub all { &count; if ($in{'area'} eq "tokyo"){ $center .= '
東京エリア
'; }elsif ($in{'area'} eq "keihin"){ $center .= '
京浜エリア
'; }elsif ($in{'area'} eq "osaka"){ $center .= '
大阪・阪神エリア
'; }elsif ($in{'area'} eq "sapporo"){ $center .= '
札幌・道央エリア
'; } $center .= "
\n"; $center .= ''; &DBConnect; $loopcount = 0; $arinashi = 0; $sth = $db->prepare("select ID, hall_name, view_flag, photo1, write_time, photo3 from $gekifile where view_flag = 1 and msg != \"\""); if(!$sth->execute){ &error ("接続失敗2"); } while(@res = $sth->fetchrow) { foreach(@res){ jcode::convert(\$_, 'sjis'); } $write_time = $res[4]; ($geki_sec,$geki_min,$geki_hour,$geki_mday,$geki_mon,$geki_year,$geki_wday,$geki_dmy) = localtime($write_time); ($sec,$min,$hour,$mday,$mon,$year,$wday,$dmy) = localtime(time); $mon++; $geki_mon++; if (($geki_mday == $mday) && ($res[4] ne "") && ($geki_mon == $mon)){ # if ($geki_mday == $mday) { $arinashi++; # 1列3個表示。 if ($loopcount == 0){ $tr = ''; $tdwidth = 154; $loopcount++; }elsif($loopcount == 2){ $tr = ''; $tdwidth = 150; $loopcount = 0; }else{ $tdwidth = 154; $tr = ''; $loopcount++; } # ログインしているか判定 if ( !$LOGIN_FLAG ){ $gekilink = "hall.html?mode=shop&SN=$res[0]&ref=all&area=$in{'area'}&r=$in{'r'}"; }else{ $gekilink = "hall.html?mode=shop&SN=$res[0]&ref=all&area=$in{'area'}&r=$in{'r'}"; } # 画像 $thm_img = ""; if ($res[5]){ $thm_img = ""; }else{ $thm_img = ""; } $center .= <
$thm_img
EOF } } &DBDisconnect; if ($loopcount == 2){ $center .= "\n"; } $center .= "\n"; $center .= "
\n"; if ($arinashi == 0){ $center .= "

\n
現在、本激中のホールはございません。
\n"; } $center .= '

'; $center .= "
エリア選択へ戻る

\n"; } #----------# # カウンタ # #----------# sub count { # カウントファイル $log = "count/geki.dat"; # ロックファイル名 $lockfile = 'count/lock/geki.lock'; &lock; #カウントファイル読込み open(IN,"$log"); $in_line = ; close(IN); #カウント1増やす $in_line++; #カウントファイル書込み open(OUT,">$log"); print OUT $in_line; close(OUT); &unlock; } sub lock { # ロックファイル名 $lockfile = 'count/lock/geki.lock'; local($retry) = 5; while (!mkdir($lockfile, 0755)) { sleep(1); } } sub unlock { # ロックファイル名 $lockfile = 'count/lock/geki.lock'; rmdir($lockfile); }