'; $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 "
".$_POST["status"]; echo "
を登録しました。
リンク先は http://".$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME']."?shop=$shop です。"; } else { edit_status($shop,$passwd,$status); } } } else { echo $header; echo "店舗情報の登録がありません。"; } } else { ?> Twitter でお店の応援してもらおう!!
Powered by Dynadixt Systema co., ltd.
2010.04.20 URL短縮機能を追加しました!!

"; ?> 店舗コード: $PHP_AUTH_USER,$PHP_AUTH_PW"; echo "このページにアクセスするには認証が必要です。\n"; exit; } else { if ( ($pass == $PHP_AUTH_PW) and ($PHP_AUTH_USER == $username )) { $chk="ok"; } else { Header("WWW-Authenticate: Basic realm=\"www.dynadixt.com\""); Header("HTTP/1.0 401 Unauthorized"); echo "ユーザー名あるいはパスワードが異なります。

\n"; exit; } } } function edit_status($shop,$passwd,$status) { ?> Twitter でお店の応援してもらおう!!
Powered by Dynadixt Systema co., ltd.



ツイットして貰いたい言葉 【全角100文字まで】


パスワードの変更
【パスワードを変更したい時のみ記入】
"; } function make_bitly_url($url,$login,$appkey,$format ,$version) { //create the URL $bitly = 'http://api.bit.ly/shorten?version='.$version.'&longUrl='.urlencode($url).'&login='.$login.'&apiKey='.$appkey.'&format='.$format; #echo $bitly; //get the url //could also use cURL here $response = file_get_contents($bitly); //parse depending on desired format $res=preg_match("|shortUrl.+(http://bit.ly/.+)\",|",$response,$matche); #print_r ($matche[1]); return $matche[1]; #$xml = simplexml_load_string($response); #return 'http://bit.ly/'.$xml->results->nodeKeyVal->hash; } ?>