Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- require_once("facebook.php");
- $config = array();
- $config['appId'] = '';
- $config['secret'] = '';
- $facebook = new Facebook($config);
- $user = $facebook->getUser();
- if (!$user) {
- $url = "https://graph.facebook.com/oauth/authorize?"
- ."client_id=".$config['appId']."&"
- ."redirect_uri=https://apps.facebook.com/kmitlfortyeight/&"
- ."scope=user_photos";
- echo "<script>location.href='$url';</script>";
- die();
- }
- if(isset($_GET[add])) {
- $add = str_replace(".","",$_GET[add]);
- $img = file_get_contents("https://graph.facebook.com/$user/picture");
- $fp = fopen("./uploads/$add.jpg","w+");
- fwrite($fp,$img);
- fclose($fp);
- $fp = fopen("db.txt","a+");
- fwrite($fp,$add."\t".$user."\n");
- fclose($fp);
- }
- ?>
- <html>
- <head>
- <title>KMITL48</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <style>
- .box,table {
- border-width:1px;
- border-style:solid;
- font-size:9px;
- font-family:"arial";
- }
- body {
- margin:0px;
- padding:0px;
- }
- a {
- text-decoration:none;
- }
- </style>
- </head>
- <body>
- <script>
- function add(id) {
- var ans = confirm("คุณมั่นใจหรือไม่ว่าคุณรหัส " +id);
- if(ans) {
- location.href="index.php?add="+id;
- }
- }
- </script>
- <?php
- echo "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n";
- for($i=1; $i<=1400; $i++) {
- $id=52010000+$i;
- if(($i-1)%15==0) echo "<tr>\n";
- if(file_exists("./uploads/$id.jpg")) {
- echo "<td>";
- echo "<img src=\"https://www.theinspirehost.com/kmitl48/uploads/$id.jpg\">";
- echo "</td>\n";
- } else {
- echo "<td width=\"48\" height=\"48\" align=\"center\" valign=\"middle\" class=\"box\">";
- echo "<a href=\"javascript:add($id)\">$id</a>";
- echo "</td>\n";
- }
- if(($i-1)%10==14) echo "</tr>\n";
- }
- echo "</table>\n";
- ?>
- </body>
Advertisement
Add Comment
Please, Sign In to add comment