
多数の御参加ありがとうございました。皆様のメッセージを引き続きお待ちします。
祈りのメッセージ、ライブの感想、アノインテッドの皆様への言葉etc、を書き込んで下さい。
//************************************************************************** // Ver1.00 // システム名: 21 inori // プログラム名: 祈り掲示板 // プログラムID: index.html // 作成者: 坂下 健太郎 // 作成日: 2010/08/06 //************************************************************************** require_once("./common/common.php"); // 共通設定 require_once("./common_lib/common.php"); // 共通関数 require_once("./common_lib/form.class.php"); // フォームクラス require_once("./db_lib/insInori.php"); // 都道府県名取得 require_once("./db_lib/getInoriListCount.php"); // 祈りメッセージ総数取得 require_once("./db_lib/getInoriList.php"); // 祈りメッセージ一覧取得 require_once("./db_lib/delInori.php"); // 祈りメッセージ削除 // パラメータ変数初期化 if(count( $_POST ) > 0) { $param = $_POST; } elseif(count($_GET) > 0) { $param = $_GET; } else { $param = array(); } checkInput($param); /* ** コメント削除処理 */ if($param["delete"]) { // 削除フォームチェック $param["err"] = checkDeleteForm($param); // 登録ボタン押下、エラーなし if(count($param["err"]) == 0) { // コメント情報更新 $delete_result = delInori($param["target_sid"]); // 存在チェック $existence_result = checkDeleteInori("t_inori", "sid", $param["target_sid"]); // 削除成功 if($delete_result && !$existence_result) { header("Location: ./index.html"); exit(); } else { $param["err"]["delete_result"] = '
' . "削除処理に失敗しました。" . '
'; } } } /* ** 祈りメッセージ投稿処理 */ // 確認及び登録ボタン if($param["post"]) { // フォームチェック $param["err"] = checkPostForm($param); // 登録ボタン押下、エラーなし if(count($param["err"]) == 0) { // 祈りメッセージ投稿 $inori_result = insInori($param); if($inori_result) { //-------------------------------------------------------------------------------- // Twitterへ書き込み //-------------------------------------------------------------------------------- $url = "http://twitter.com/statuses/update.xml?"; $username = "_Anointed2010_"; $password = "osaka21mf"; $max_char_num = 140; // 最大書き込み文字数(twitter仕様) // $bit_url = 25; // url短縮文字数(bit.ly変換予測、とりあえず25文字で余裕を持たせる) // 住所 $living_place = ""; if(strlen($param["living_place"])) { $living_place = "(" . $param["living_place"] . ")"; } // 書き込み内容 $temp_str = "【" . $param["name"] . $living_place . "の祈り】" . $param["message"]; // 文字列調整 $insertion_str = trimStringLength($temp_str, $max_char_num - 3, '...'); //-------------------------------------------------------------------------------- // Twitter書き込み //-------------------------------------------------------------------------------- // require_once("./twitteroauth/twitteroauth.php"); // // // Consumer keyの値 // $consumer_key = "afW2dE9OefigEAm4q4i9Ww"; // // Consumer secretの値 // $consumer_secret = "rdHmWF5FT6UiGshdiOcayEkpDNUhlKVmDdEclGaeAg"; // // Access Tokenの値 // $access_token = "175312187-pAcaYlnbnm4wkuEpeZqKRzay72gGyAZLsViJWs8"; // // Access Token Secretの値 // $access_token_secret = "NsWt5bJdAS8AiA16mtNSfHOSLVn1tMnaLAS2AWPo"; // // // OAuthオブジェクト生成 // $to = new TwitterOAuth($consumer_key,$consumer_secret,$access_token,$access_token_secret); // // // TwitterへPOSTする。パラメーターは配列に格納する // // in_reply_to_status_idを指定するのならば array("status"=>"@hogehoge reply","in_reply_to_status_id"=>"0000000000"); とする。 // $req = $to->OAuthRequest("https://twitter.com/statuses/update.xml","POST",array("status"=>"" . $insertion_str . "")); // // TwitterへPOSTするときのパラメーターなど詳しい情報はTwitterのAPI仕様書を参照してください // // header("Content-Type: application/xml"); // echo $req; $params = "status=". rawurlencode($insertion_str); $fp = fopen($url.$params, 'r', false, stream_context_create(array( "http" => array( "method" => "POST", "header" => "Authorization: Basic ". base64_encode($username. ":". $password) ) ))); $result = ""; while(!feof($fp)){ $result .= fgets($fp); } fclose($fp); // リダイレクト header("Location: ./index.html"); exit(); } else { } // ページャー生成 // $redirect_pager = "?s=" . $param["s"] . "&p=" . $param["p"] . "&q=" . $param["q"] . "#cm"; header("Location: ./index.html"); exit(); // エラーメッセージ登録 if($inori_result == FALSE) { $err_message = "投稿エラーが発生しました。もう一度やり直してください。"; } } } /* ** 画面表示 */ showDisplay($param); exit(); //****************************************************************************** // 関数名: showDisplay // 引数: $param // 戻り値: なし // 内 容: イベント詳細を表示 //****************************************************************************** function showDisplay($param) { /* ** 祈りメッセージ */ // 1ページあたりの表示件数 $page_list = 50; // ページ変数初期化 if($param["page"] <= 1) { $param["page"] = 1; } // 総数カウント取得 $db = new DB; $inori_count = getInoriListCount(); // ページ調整 if($inori_count != 0) { if($inori_count <= $page_list * ($param["page"] - 1)) { $param["page"]--; } } // 一覧取得 $param["inori_list"] = getInoriList(($param["page"] - 1) * $page_list, $page_list, $option, " create_time DESC "); // ページタグ生成 $param["page_navigator"] = getPageNavigator("", $inori_count, $param["page"], $page_list, ""); $param["page_navigator_h"] = getPageNavigator("", $inori_count, $param["page"], $page_list, "", "H"); print <<' . "削除できませんでした。" . '
'; } } // 一般用 } else { // 形式チェック $str_to_check = array( "target_sid" => "1, 999999999, H, input, NUM", "exec_delete_key" => "4, 4, H, input, ALP" ); // 形式チェック実行 Form::inputCheck($param, $str_to_check, $err); // エラーがなければ削除可能かどうかチェックする if(count($err) == 0) { $option = array(); $option[] = " delete_key = '" . $param["exec_delete_key"] . "' "; if(!checkDeleteInori("t_inori", "sid", $param["target_sid"], $option)) { $err["delete_result"] = '' . "削除キーが間違っています。" . '
'; } } } return $err; } ?>