getRequestToken(); $_SESSION['req_oauth_token'] = $req_tok['oauth_token']; $_SESSION['req_oauth_token_secret'] = $req_tok['oauth_token_secret']; //Access Tokenを取得するオブジェクトを作成 $acc_to = new TwitterOAuth(Consumer_key, Consumer_secret, $req_tok['oauth_token'], $req_tok['oauth_token_secret']); //Access Tokenをリクエストする $acc_tok = $acc_to->getAccessToken(); //Access Tokenの値 $_SESSION['access_token'] = $acc_tok['oauth_token']; //Access Token Secretの値 $_SESSION['access_token_secret'] = $acc_tok['oauth_token_secret']; //OAuthオブジェクト生成 $to = new TwitterOAuth(Consumer_key,Consumer_secret,$_SESSION['access_token'],$_SESSION['access_token_secret']); //Cookieに一時情報保存 $timeout = time() + 14 * 24 * 60 * 60; //保存したい内容(カンマ区切り) $value = Consumer_key.",".Consumer_secret.",".$_SESSION['access_token'].",".$_SESSION['access_token_secret']; //アプリ転送 $req = $to->getAuthorizeURL($req_tok['oauth_token']); header("Location: ".$req); exit; } $oauth_token = $_REQUEST['oauth_token']; $section = $_REQUEST['section']; //リクエストしていたらログイン情報取得 if($_REQUEST['oauth_token'] != NULL){ //OAuthオブジェクト生成 $to = new TwitterOAuth(Consumer_key,Consumer_secret,$_SESSION['req_oauth_token'],$_SESSION['req_oauth_token_secret']); $tok = $to->getAccessToken($_GET['oauth_verifier']); $_SESSION['oauth_access_token'] = $tok['oauth_token']; $_SESSION['oauth_access_token_secret'] = $tok['oauth_token_secret']; $to = new TwitterOAuth(Consumer_key,Consumer_secret,$_SESSION['oauth_access_token'],$_SESSION['oauth_access_token_secret']); $request = $to->get('users/show', array('user_id' => $tok['user_id'])); //print_r($request); $id = mysql_real_escape_string($request->id); $name = mysql_real_escape_string($request->name); $screen_name = mysql_real_escape_string($request->screen_name); $description = mysql_real_escape_string($request->description); $url = mysql_real_escape_string($request->url); $user_pic = mysql_real_escape_string($request->profile_image_url); $location = mysql_real_escape_string($request->location); //取得できたらセッション情報保持 $_SESSION['screen_name'] = $screen_name; //screen name を取得 $_SESSION['pic_path'] = $user_pic; //プロフィール画像を取得 $_SESSION['name'] = $name; //名前を取得 $_SESSION['description'] = $description; //プロフィールを取得 $_SESSION['url'] = $url; //URLを取得 $_SESSION['location'] = $location; //住所を取得 $_SESSION['name_login'] = $_SESSION['name']; $_SESSION['twitter_user_id'] = $tok['user_id']; // Twitter UserID 2014/09/22 if($tok['oauth_token'] != "" && $tok['oauth_token_secret'] != ""){ //プロフィールを取得 $sql = "select * from creater_tbl where oauth_access_token = '".$tok['oauth_token']."' and oauth_access_token_secret = '".$tok['oauth_token_secret']."'"; //echo $sql; $result = db_sql($sql, $conn_id); //SQL実行 $num = mysql_num_rows($result); /*if($num != 0){ $row = mysql_fetch_array($result); $sql = "update creater_tbl set twitter_id = '".$_SESSION['screen_name']."', name = '".$_SESSION['name']."', pic_path = '".$_SESSION['pic_path']."', oauth_access_token = '".$_SESSION['oauth_access_token']."', oauth_access_token_secret = '".$_SESSION['oauth_access_token_secret']."', pr_txt = '".$_SESSION['description']."', url = '".$_SESSION['url']."' where creater_id = '".$row['creater_id']."'"; $result = db_sql($sql, $conn_id); //SQL実行 }else{*/ if($num <= 0){ //登録処理 //DBへスケジュールDBへデータ格納 $sql = "insert into creater_tbl( name, twitter_id, twitter_user_id, oauth_access_token, oauth_access_token_secret, pr_txt, url, pic_path, ip_address, regist_date, kari_flg, login_date) values('".str_replace("'","''",$_SESSION['name'])."', '".str_replace("'","''",$_SESSION['screen_name'])."', '".$tok['user_id']."', '".$tok['oauth_token']."', '".$tok['oauth_token_secret']."', '".str_replace("'","''",$_SESSION['description'])."', '".str_replace("'","''",$_SESSION['url'])."', '".str_replace("'","''",$_SESSION['pic_path'])."', '".gethostbyname(gethostbyaddr($_SERVER['REMOTE_ADDR']))."', '".date("Y-m-d H:i:s")."', 0, '0000-00-00 00:00:00')"; $result = db_sql($sql, $conn_id); //SQL実行 //echo $sql; } } $_SESSION['name_login'] = $_SESSION['name']; //プロフィールを取得 $sql = "select * from creater_tbl where oauth_access_token = '".$tok['oauth_token']."' and oauth_access_token_secret = '".$tok['oauth_token_secret']."'"; $result = db_sql($sql, $conn_id); //SQL実行 $row = mysql_fetch_array($result); $_SESSION['creater_id'] = $row['creater_id']; } //********* FACEBOOK ログイン処理 ************* $app_id = "114821555278006"; $app_secret = "c0cbdc1e47105a228474dba9062c8b32"; $my_url = "http://creaters.eightbit.jp/"; session_start(); $code = $_REQUEST["code"]; if($_POST['facebook'] == "FACEBOOKでログインする" || $_POST['facebook_x']){ if(empty($code)) { $_SESSION['state'] = md5(uniqid(rand(), TRUE)); //CSRF protection $dialog_url = "http://www.facebook.com/dialog/oauth?client_id=".$app_id."&redirect_uri=".urlencode($my_url)."&state=".$_SESSION['state']."&scope=email"; header("Location: ".$dialog_url); exit; } } if($_GET['code'] != ""){ if($_REQUEST['state'] == $_SESSION['state']) { $token_url = "https://graph.facebook.com/oauth/access_token?" . "client_id=" . $app_id . "&redirect_uri=" . urlencode($my_url) . "&client_secret=" . $app_secret . "&code=" . $_GET['code']; $response = file_get_contents($token_url); $params = null; parse_str($response, $params); $graph_url = "https://graph.facebook.com/me?access_token=".$params['access_token']."&fields=picture,name,id"; $_SESSION['access_token'] = $params['access_token']; $json = file_get_contents($graph_url); $user = json_decode($json, true); $_SESSION['name'] = $user['name']; $_SESSION['facebook_id'] = $user['id']; $_SESSION['url'] = $user['website']; $_SESSION['pic_path'] = "https://graph.facebook.com/".$user['id']."/picture?type=large"; //プロフィールを取得 $sql = "select * from creater_tbl where facebook_id = '".$_SESSION['facebook_id']."'"; $result = db_sql($sql, $conn_id); //SQL実行 $num = mysql_num_rows($result); /*if($num > 0){ $row = mysql_fetch_array($result); $sql = "update creater_tbl set facebook_id = '".$_SESSION['facebook_id']."', name = '".$_SESSION['name']."', pic_path = '".$_SESSION['pic_path']."', oauth_access_token = '".$_SESSION['access_token']."', url = '".$_SESSION['url']."' where creater_id = '".$row['creater_id']."'"; $result = db_sql($sql, $conn_id); //SQL実行 }else{*/ if($num == 0){ //登録処理 //DBへスケジュールDBへデータ格納 $sql = "insert into creater_tbl( name, facebook_id, oauth_access_token, url, pic_path, ip_address, regist_date, kari_flg, login_date) values('".str_replace("'","''",$_SESSION['name'])."', '".str_replace("'","''",$_SESSION['facebook_id'])."', '".$_SESSION['oauth_access_token']."', '".str_replace("'","''",$_SESSION['url'])."', '".str_replace("'","''",$_SESSION['pic_path'])."', '".gethostbyname(gethostbyaddr($_SERVER['REMOTE_ADDR']))."', '".date("Y-m-d H:i:s")."', 0, '0000-00-00 00:00:00')"; $result = db_sql($sql, $conn_id); //SQL実行 } } $_SESSION['name_login'] = $_SESSION['name']; //プロフィールを取得 $sql = "select * from creater_tbl where facebook_id = '".$_SESSION['facebook_id']."'"; $result = db_sql($sql, $conn_id); //SQL実行 $row = mysql_fetch_array($result); $_SESSION['creater_id'] = $row['creater_id']; } //サービスを取得 $sql = "select * from service_tbl".$_SESSION['where']." order by regist_date desc"; $result = db_sql($sql, $conn_id); //SQL実行 $all_num = mysql_num_rows($result); //該当件数の取得 //ページ数の計算 if($all_num > 10){ $page_num = $all_num / 10; //あまりの件数はありますか? if($all_num % 10 != 0){ $page_num ++; $page_num = floor($page_num); } }else{ $page_num = 1; } //該当ページの指定がない場合 if($_GET['page'] == "" || $_GET['page'] == 0){ $page_no = 1; //該当ページの指定がある場合 }else{ $page_no = $_GET['page']; } //10件づつ表示 $start = ($page_no - 1) * 10; $sql = "select * from service_tbl".$_SESSION['where']." order by regist_date desc limit ".$start.", 10"; $result = db_sql($sql, $conn_id); //SQL実行 ?> ツクログ - 作ったWebサービスをPRしよう!

目立たないけどすごいサービスはたくさんあります。

お知らせ 2012/04/25 ツクログのTwitter公式アカウントから新サービスリリース情報がツイートされるようにしました。

現在のあったらいいな!:

こんなWebサービスやアプリがあったらいいな!を投稿してください。

0){ while($iina_row = mysql_fetch_array($iina_res)){ //プロフィール画像の取得 $sql = "select * from creater_tbl where creater_id = '".$iina_row['creater_id']."'"; $prof_res = db_sql($sql, $conn_id); //SQL実行 $row_creaters = mysql_fetch_array($prof_res); if($row_creaters['pic_path'] != ""){ if((strstr($row_creaters['pic_path'], "twimg.com") != false || strstr($row_creaters['pic_path'], "fbcdn") != false) && $row_creaters['pic_path'] != ""){ $prof_pic = $row_creaters['pic_path']; }else{ $prof_pic = $row_creaters['pic_path']; $pic = explode(".",$row_creaters['pic_path']); $prof_pic = $pic[0]."_thumb.".$pic[1]; } }else{ $prof_pic = "/common/images/noimage05.gif "; } if(mb_strlen($iina_row['comment'], "UTF-8") <= 37){ $comment = $iina_row['comment']; }else{ $comment = mb_substr($iina_row['comment'], 0, 37, 'UTF-8')."..."; } //マッチしたサービスの取得 $sql = "select * from iina_serv_tbl where iina_id = '".$iina_row['iina_id']."'"; $serv_res = db_sql($sql, $conn_id); //SQL実行 $serv_num = mysql_num_rows($serv_res); ?>
あるよ!(サービス) 投稿日時:

⇒もっと見る

あったらいいな!の投稿はまだありません。
カテゴリー
ジャンル

$start + 10){ $disp_end = $start + 10; }else{ $disp_end = $all_num; } //10ページまで表示 if($page_num > 10 && $page_no <= $page_num - 9){ $start_page = $page_no; }else if($page_num > 10 && $page_no > $page_num - 9){ $start_page = $page_num - 9; }else{ $start_page = 1; } if($page_no == $page_num || $page_num <= 10){ $end_page = $page_num; }else{ $end_page = $start_page + 9; } //前のページへ表示 if($page_no != 1 && $page_num > 10){ $back = $page_no - 1; $page_html = $page_html."<<"; } //**** ページ移動処理 for($page_cnt = $start_page; $page_cnt <= $end_page; $page_cnt++){ if($page_no == $page_cnt){ $page_html = $page_html."".$page_cnt.""; }else{ $page_html = $page_html."".$page_cnt.""; } } //次のページへ表示 if($page_no <= $page_num - 9 && $page_num > 10){ $next = $page_no + 1; $page_html = $page_html.">>"; } echo $page_html; } ?>

現在のクリエイター数: 現在のサービス数: rss

= 60){ $pr_txt = mb_substr($row['pr_txt'], 0, 60, 'UTF-8')."..."; }else{ $pr_txt = $row['pr_txt']; } //写真のパス if($row['image_pic01'] != ""){ $pic = explode(".",$row['image_pic01']); $top_pic = $pic[0]."top.".$pic[1]; $size = @getImageSize(".".$top_pic); }else{ $top_pic = "/common/images/noimage02.gif"; $size = @getImageSize(".".$top_pic); } ?>

sample

クリエイター: リリース日:

投稿日時:

Good! Bad...

詳しく読む

まだ投稿はありません。

$start + 10){ $disp_end = $start + 10; }else{ $disp_end = $all_num; } //10ページまで表示 if($page_num > 10 && $page_no <= $page_num - 9){ $start_page = $page_no; }else if($page_num > 10 && $page_no > $page_num - 9){ $start_page = $page_num - 9; }else{ $start_page = 1; } if($page_no == $page_num || $page_num <= 10){ $end_page = $page_num; }else{ $end_page = $start_page + 9; } //前のページへ表示 if($page_no != 1 && $page_num > 10){ $back = $page_no - 1; $page_html = $page_html."<<"; } //**** ページ移動処理 for($page_cnt = $start_page; $page_cnt <= $end_page; $page_cnt++){ if($page_no == $page_cnt){ $page_html = $page_html."".$page_cnt.""; }else{ $page_html = $page_html."".$page_cnt.""; } } //次のページへ表示 if($page_no <= $page_num - 9 && $page_num > 10){ $next = $page_no + 1; $page_html = $page_html.">>"; } echo $page_html; } ?>

サービスを投稿する

いいな!を投稿する

ツクログ Android版スマートフォンアプリ ダウンロードはこちら

注目のWebサービス

  • sample
  • まだ投稿はありません。

ピックアップクリエイター