/* 2010.04.20 松橋さんと相談し、リリース版の開発に着手 付加する文とパスワードを入力できるようにする。 */ /* $status=$_POST["status"]; if ($_GET["status"]) { $status=$_GET["status"]; } */ $header ='
'; $shop=$_POST["shop"]; if ($_GET["shop"]) { $shop=$_GET["shop"]; } $cmd=$_POST["cmd"]; if (!$cmd) { $cmd=$_GET["cmd"]; } if ($shop) { if ($data=file("./twitter/$shop.dat")) { $ary[] = "EUC-JP"; $ary[] ="UTF-8"; $ary[] ="SJIS"; $ary[] = "JIS"; $status = $data[0]; $passwd = $data[1]; $status = str_replace("\n","",$status); $status = str_replace("\r","",$status); $status = str_replace("/","",$status); $status = str_replace(";","",$status); $status = str_replace("\t","",$status); $status = str_replace(" ","",$status); $passwd = str_replace("\n","",$passwd); $passwd = str_replace("\r","",$passwd); if (!$cmd) { $enc= mb_detect_encoding($status,$ary); $ref = $_SERVER['HTTP_REFERER']; #echo $ref; $sref= make_bitly_url($ref,"dynadixt","R_cb5e3114b9e38d32794a8b9010e89fde",'json','2.0.1'); if($shop == "kyoya") { $name = $_GET["name"]; if (!$name) { $name = "京屋の焼酎"; } $enc2= mb_detect_encoding($name,$ary); $name = str_replace('\'',"",$name); $name = str_replace('\\',"",$name); $name = urlencode(mb_convert_encoding($name,"utf-8",$enc2)); # $name = urlencode(mb_convert_encoding($name,"utf-8","euc")); $text= $name . urlencode(mb_convert_encoding("$status","utf-8",$enc)) ." $sref"; } else { $text=urlencode(mb_convert_encoding($status." $sref","utf-8",$enc)); } $url="http://twitter.com?status=$text"; #echo $url; header("Location: $url"); } else { /*管理画面*/ www_auth($shop,$passwd,$_SERVER['PHP_AUTH_USER'],$_SERVER['PHP_AUTH_PW']); if ($cmd == "set") { $data = $_POST["status"]."\n$passwd\n"; if ($_POST["passwd"]) { $data = $_POST["status"]."\n".$_POST["passwd"]."\n"; } `echo '$data' > ./twitter/$shop.dat`; #echo $header; edit_status($shop,$passwd,$_POST["status"]); echo "$shop のツイター文(status)に"; echo "\n"; exit; } } } function edit_status($shop,$passwd,$status) { ?>
Twitter でお店の応援してもらおう!!