Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html xmlns:fb="http://www.facebook.com/2008/fbml">
- <head>
- <meta charset="utf-8">
- <title>Coruña Outlets España</title>
- <link rel="stylesheet" type="text/css" href="assets/css/reset.css" media="screen">
- <link rel="stylesheet" type="text/css" href="assets/css/joint.css" media="screen">
- <script type="text/javascript" src="assets/scripts/jquery-1.8.1.js"></script>
- <script type="text/javascript" src="assets/scripts/jquery.joint-1.0.js"></script>
- <body>
- <!-- Facebook need it to compatibility -->
- <div id="fb-root"></div>
- {%ini-sdk-javascript%}
- <script>
- // Iniciamos el SDK de JavaScript
- window.fbAsyncInit = function() {
- FB.init({
- appId : '{%app-id%}',
- channelUrl : '{%app-facebook%}/channel.html',
- status : true,
- cookie : true
- //oauth : true
- }); // Fin FB.init
- // Comprobamos los permisos
- FB.getLoginStatus(function(response) {
- if (response.status === 'not_authorized') { // Not installed
- console.log('NOT auth');
- authorizeApp(); }
- else if (response.status === 'connected') { // Installed, without perms?
- console.log('YES auth, check perms');
- authorizeApp(); }
- }, true); // Fin FB.getLoginStatus
- }; // Fin de window.fbAsyncInit
- // Requerimos auths para poder usar la app
- function authorizeApp() {
- FB.login(function(response) {
- if (response.authResponse) {
- FB.api('/me/permissions', 'get', function(response) {
- if ( (response.data[0]['email'] != 1) || (response.data[0]['user_likes'] != 1) || (response.data[0]['status_update'] != 1) || (response.data[0]['publish_stream'] != 1) ) {
- console.log('Crap... perms not given, return to index');
- window.location.href = 'index.php'; }
- else {
- console.log('Hurra... perms given, reload site');
- window.location.href = 'participa.php'; }
- });
- }
- else {
- window.location.href = 'index.php'; }
- }, {scope: 'email,publish_stream,user_likes'});
- } // Fin authorizeApp
- // Cargamos el SDK Asynchronously
- (function(d){
- var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
- if (d.getElementById(id)) { return; }
- js = d.createElement('script'); js.id = id; js.async = true;
- js.src = "//connect.facebook.net/es_ES/all.js";
- ref.parentNode.insertBefore(js, ref);
- }(document));
- </script>
- {%end-sdk-javascript%}
- <!-- Our code -->
- <div id="approot">
- {%user-display%}
- <div class="wrapper first">
- <form action="{%app-hostname%}/participa.php" method="post">
- <h1>Participa en el concurso</h1>
- <img src="{%user-picture%}" alt="{%user-name%}">
- <fieldset>
- <input type="text" name="name" value="{%user-name%}" id="name">
- <label for="name">Su nombre <sup class="{%class-name%}">* requerido</sup></label>
- <input type="text" name="last" value="{%user-last%}" id="last">
- <label for="last">Sus apellidos <sup class="{%class-last%}">* requerido</sup></label>
- <input type="text" name="mail" value="{%user-mail%}" id="mail">
- <label for="mail">Su dirección de email <sup class="{%class-mail%}">* requerido</sup></label>
- <input type="text" name="tell" value="{%user-tell%}" id="tell">
- <label for="tell">¿Qué te gustaría comprar en la noche de moda? <sup class="{%class-tell%}">* requerido</sup></label>
- <hr>
- <input type="checkbox" name="tos" value="yes" id="tos">
- <label for="tos" class="ltos">Acepto los términos y condiciones de esta promoción. <sup class="{%class-tos%}">* requerido</sup></label>
- </fieldset>
- <br>
- <div id="buttons">
- <a href="{%app-facebook%}" rel="index.php" alt="Regresar">Regresar</a>
- <input type="submit" name="app_submit_data" value="Participar">
- </div>
- <div id="warning">
- {%warning%}
- </div>
- </form>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement