read())){ if(ereg("txt",$entry)){ $rc = readposted("./data/$entry"); if($mail == $rc['mail']){ $err = "すでに登録されてます"; } } } $dir->close(); return($err); } //オプションの表示 function show_option(){ $lines = file("option.txt");//新製品情報,cb1\nメンテナンス情報,cb2\nアンケート,cb3\n . echo "

Q. 配信メールの種類を選択して下さい(複数選択可)。

"; echo ""; } //登録解除のメール送信 function send_cancelmail($mail){ $fflg = false; $dir = dir("./data/"); while(false !== ($entry = $dir->read())){ if(ereg("txt",$entry)){ $rc = readposted("./data/$entry"); if($mail == $rc['mail']){ $target = $entry; $fflg = true; break; } } } $target = substr($target,0,strlen($target)-4); if($fflg){ $dir->close(); $title = "メールリストから削除します"; $content .= "リストから削除します!\n"; $content .= "http://aprilsnow.ciao.jp/test/diary/mailmagazine/regist.php?mode=del&target=$target\n";//適宜要変更 $content .= "にアクセスしてください.\n"; $header = "From: april snow "; //$header = "From:".mb_encode_mimeheader("草森冬弥").""; $title = mb_convert_encoding($title,'EUC-JP','auto'); $content = mb_convert_encoding($content,'EUC-JP','auto'); mb_send_mail($mail,$title,$content,$header); }else{ $err = "そのメールアドレスは登録されていません\n"; } return($err); } $mode = "normal"; //メールアドレスの登録 if($_POST['cmd'] != ""){ if($_POST['mail'] == ""){ $err .= "メールアドレスが入力されてません\n"; } $err .= check_duplication($_POST['mail']);//二重登録のチェック $cp = "^[_a-z0-9\-]+(\.[_a-z0-9\-]+)*@[a-z0-9\-]+(\.[a-z0-9\-]+)*$"; if(!ereg($cp,$_POST['mail'])){ $err .= "メールアドレスが入力ミスです\n"; } if($err == ""){ $uid = uniqid(rand()); $fn = sprintf("./data/%s.txt",$uid); $fp = fopen($fn,"wb"); foreach($_POST as $key => $var){ fputs($fp,"$key#S#$var\n"); } fclose($fp); $message = "メールアドレスを登録しました"; }else{ $message = "エラーがあります"; } $mode = "message"; } //登録解除希望の処理 if($_POST['cmd'] != "" && $_POST['delmail'] != ""){ $err = send_cancelmail($_POST['delmail']);//関数内のパスを要確認のこと if($err == ""){ $mode = delmail; }else{ $mode = "message"; $message = "エラーがあります"; } } //メールアドレスの登録解除 if($_GET['mode'] == "cancel"){ $mode = "cancel"; } //メールアドレスの削除 if($_GET['mode'] == "del"){ $mode = "message"; $message = "リストから削除しました"; $fn = sprintf("./data/%s.txt",$_GET['target']); if(file_exists($fn)){ unlink($fn); }else{ $message = "エラーがあります"; $err = "すでに削除されています"; } } //calendar function calendar($year,$month,$date){ global $self,$link1,$link2; $wtxt = array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'); $cy = date("Y",mktime(0,0,0,$month+1,0,$year)); $cm = date("m",mktime(0,0,0,$month+1,0,$year)); $title = date("M, Y",mktime(0,0,0,$month,1,$year)); $maxd = date("t",mktime(0,0,0,$month,1,$year)); $wday = date("w",mktime(0,0,0,$month,1,$year)); $this_month = date("m"); $this_day = date("d"); //echo "« $title »"; echo ""; //echo ""; echo ""; echo "\n"; for($x=0; $x<7; $x++){ echo ""; } echo "\n"; for($y=0; $y<6; $y++){ echo ""; for($x=0; $x<7; $x++){ $d = $y*7+$x+1-$wday;//日付け /* if($cm == $this_month && $d==$this_day){ $quote1 = "["; $quote2 = "]"; }else{ $quote1 = ""; $quote2 = ""; } */ $aim = $year.$month; $path = "../data"; $dir_name = dir($path); while($file_name = $dir_name->read()){ $files[] = $file_name; } rsort($files); foreach($files as $file){ if(strstr($file,$aim) != ""){ $list[] .= $file;//ファイル名 $days[] .= substr($file,6,2);//投稿日(二桁表記)。ファイル名より抽出... } } $d2 = sprintf("%02d",$d);//「投稿日」との比較のため、二桁表記の「日付け」も準備する。 $path = sprintf("../entry.php?path=./data/%04d%02d%02d.txt",$year,$month,$d);//permalink url if(($cm == $this_month && $d==$this_day) && (is_array($days) && in_array($d2,$days))){//「本日」かつ「投稿日」の場合 $tag1 = ""; $tag2 = ""; }elseif($cm == $this_month && $d==$this_day){//「本日」の場合 $tag1 = ""; $tag2 = ""; }elseif(is_array($days) && in_array($d2,$days)){//「投稿日」の場合 $tag1 = ""; $tag2 = ""; }else{//「本日」以外、かつ「投稿日」以外、の場合 $tag1 = ""; $tag2 = ""; } echo "\n"; } echo "\n"; } echo "
« $title »
« $title »
$wtxt[$x]
"; $param = sprintf("date=%04d%02d%02d",$cy,$cm,$d); $addr = sprintf("%s?%s",$self,$param); if($d>0 && $d<($maxd+1)){ //echo "{$quote1}{$d}{$quote2}"; echo "{$tag1}{$d}{$tag2}"; }else{echo " ";}; echo "
\n"; } function archives(){ $path = "../data"; $dir_name = dir($path); while($file_name = $dir_name->read()){ if(strstr($file_name,".txt") != ""){ $files[] = $file_name; } } rsort($files); foreach($files as $file){ $archive = substr($file,0,6); $list[] .= $archive; } $list = array_unique($list);//重複する要素を排除し、 $list = array_values($list);//連番のインデックスに再設定... echo "

archives

"; echo ""; } function recent_entries(){ $path = "../data"; $dir_name = dir($path); while($file_name = $dir_name->read()){ if(strstr($file_name,".txt") != ""){ $files[] = $file_name; } } rsort($files); foreach($files as $file){ $list[] .= $file; } echo "

recent entries

"; echo ""; } //$self = $HTTP_SERVER_VARS['PHP_SELF']; $self = "../diary.php"; if($_GET['date'] == ""){ $year = date("Y"); $month = date("m"); $date = date("d"); }else{ $year = substr($_GET['date'],0,4); $month = substr($_GET['date'],4,2); $date = substr($_GET['date'],6,2); } $fn = "../summary.txt"; $all = file_get_contents($fn); $parts = explode("###",$all); $mytitle = $parts[0]; $myurl = $parts[1]; $mydescription = $parts[2]; $link1 = sprintf("%s?date=%04d%02d%02d",$self,$year,$month-1,$date); $link2 = sprintf("%s?date=%04d%02d%02d",$self,$year,$month+1,$date); ?> <br /> <b>Notice</b>: Undefined variable: mytitle in <b>/home/users/2/ciao.jp-aprilsnow/web/test/diary/mailmagazine/regist.php</b> on line <b>305</b><br /> skip to content
skip to navigation