Advertisement
Worked

join.html

Nov 9th, 2012
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 4.21 KB | None | 0 0
  1. <!doctype html>
  2. <html xmlns:fb="http://www.facebook.com/2008/fbml">
  3. <head>
  4.   <meta charset="utf-8">
  5.   <title>Coru&#241;a Outlets Espa&#241;a</title>
  6.   <link rel="stylesheet" type="text/css" href="assets/css/reset.css" media="screen">
  7.   <link rel="stylesheet" type="text/css" href="assets/css/joint.css" media="screen">
  8.   <script type="text/javascript" src="assets/scripts/jquery-1.8.1.js"></script>
  9.   <script type="text/javascript" src="assets/scripts/jquery.joint-1.0.js"></script>
  10. <body>
  11.   <!-- Facebook need it to compatibility -->
  12.   <div id="fb-root"></div>
  13.  
  14.   {%ini-sdk-javascript%}
  15.   <script>
  16.  
  17.     // Iniciamos el SDK de JavaScript
  18.     window.fbAsyncInit = function() {
  19.       FB.init({
  20.         appId      : '{%app-id%}',
  21.         channelUrl : '{%app-facebook%}/channel.html',
  22.         status     : true,
  23.         cookie     : true
  24.         //oauth      : true
  25.       }); // Fin FB.init
  26.  
  27.       // Comprobamos los permisos
  28.       FB.getLoginStatus(function(response) {
  29.         if (response.status === 'not_authorized') {     // Not installed
  30.           console.log('NOT auth');
  31.           authorizeApp(); }
  32.         else if (response.status === 'connected') {     // Installed, without perms?
  33.           console.log('YES auth, check perms');
  34.           authorizeApp(); }
  35.       }, true); // Fin FB.getLoginStatus
  36.    
  37.     }; // Fin de window.fbAsyncInit
  38.  
  39.     // Requerimos auths para poder usar la app
  40.     function authorizeApp() {
  41.       FB.login(function(response) {
  42.         if (response.authResponse) {
  43.           FB.api('/me/permissions', 'get', function(response) {
  44.             if ( (response.data[0]['email'] != 1) || (response.data[0]['user_likes'] != 1) || (response.data[0]['status_update'] != 1) || (response.data[0]['publish_stream'] != 1) ) {
  45.               console.log('Crap... perms not given, return to index');
  46.               window.location.href = 'index.php'; }
  47.             else {
  48.               console.log('Hurra... perms given, reload site');
  49.               window.location.href = 'participa.php'; }                    
  50.           });
  51.         }
  52.         else {
  53.           window.location.href = 'index.php'; }
  54.       }, {scope: 'email,publish_stream,user_likes'});
  55.     } // Fin authorizeApp
  56.  
  57.     // Cargamos el SDK Asynchronously
  58.     (function(d){
  59.       var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
  60.       if (d.getElementById(id)) { return; }
  61.       js = d.createElement('script'); js.id = id; js.async = true;
  62.        js.src = "//connect.facebook.net/es_ES/all.js";
  63.        ref.parentNode.insertBefore(js, ref);
  64.     }(document));
  65.   </script>
  66.   {%end-sdk-javascript%}
  67.  
  68.   <!-- Our code -->
  69.   <div id="approot">
  70.     {%user-display%}
  71.     <div class="wrapper first">
  72.       <form action="{%app-hostname%}/participa.php" method="post">
  73.         <h1>Participa en el concurso</h1>
  74.         <img src="{%user-picture%}" alt="{%user-name%}">
  75.         <fieldset>
  76.           <input type="text" name="name" value="{%user-name%}" id="name">
  77.             <label for="name">Su nombre <sup class="{%class-name%}">* requerido</sup></label>
  78.           <input type="text" name="last" value="{%user-last%}" id="last">        
  79.             <label for="last">Sus apellidos <sup class="{%class-last%}">* requerido</sup></label>
  80.           <input type="text" name="mail" value="{%user-mail%}" id="mail">
  81.             <label for="mail">Su direcci&#243;n de email <sup class="{%class-mail%}">* requerido</sup></label>
  82.           <input type="text" name="tell" value="{%user-tell%}" id="tell">
  83.             <label for="tell">&#191;Qu&#233; te gustar&#237;a comprar en la noche de moda? <sup class="{%class-tell%}">* requerido</sup></label>
  84.           <hr>
  85.           <input type="checkbox" name="tos" value="yes" id="tos">
  86.           <label for="tos" class="ltos">Acepto los t&#233;rminos y condiciones de esta promoci&#243;n. <sup class="{%class-tos%}">* requerido</sup></label>
  87.         </fieldset>
  88.         <br>
  89.         <div id="buttons">
  90.           <a href="{%app-facebook%}" rel="index.php" alt="Regresar">Regresar</a>
  91.           <input type="submit" name="app_submit_data" value="Participar">
  92.         </div>
  93.         <div id="warning">
  94.           {%warning%}
  95.         </div>
  96.       </form>
  97.     </div>
  98.   </div>
  99. </body>
  100. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement