<?php
require_once(COMM_PATH."facebook.php");
$facebook = new Facebook(array(
'appId' => APPID,
'secret' => SECRET,
'cookie' => true,
));
$session = $facebook->getSession();
$me = null;
if ($session) {
try {
$uid = $facebook->getUser();
$me = $facebook->api('/me');
} catch (FacebookApiException $e) {
error_log($e);
}
}
$loginUrl = $facebook->getLoginUrl(array(
'req_perms' => 'email,user_birthday'));
?>
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '<?php echo $facebook->getAppId(); ?>',
session : <?php echo json_encode($session); ?>, // don't refetch the session when PHP already has it
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
// whenever the user logs in, we refresh the page
FB.Event.subscribe('auth.login', function() {
window.location.reload();
});
};
(function() {
var e = document.createElement('script');
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
</script>
<div style="display: none;" id="winhidelayer"></div>
<div class="popconatiner-2" id="signinpopup" style="display:none;"> <strong></strong>
<div class="blue_bar"></div>
<div class="popupMain-Cont">
<div class="popupMain-Cont-header">
<h2>Have an Account? <span style="color:#666;">Login Here.</span></h2>
<!-- Btn Start Here -->
<div class="Profile-pages-btn">
<div class="greyBtnMain">
<div class="greyBtnMain-left"></div>
<div class="greyBtnMain-midd"><a href="#" title="Close" onclick="hideSigninPopup()">Close</a></div>
<div class="greyBtnMain-Right"></div>
</div>
</div>
<!-- Btn Ends Here -->
<div class="clr"></div>
</div>
<div class="form_div">
<form name="login" action="" method="post">
<div class="fields_div" id="Name">
<label >E-mail</label>
<input type="text" class="fields_tf" name="u_email" id="u_email" />
<div class="clr"></div>
</div>
<div class="fields_div">
<label >Password</label>
<input type="password" class="fields_tf" name="pword" id="pword" />
<div class="clr"></div>
</div>
<p><a href="#" onclick="return showforgetPopup()">Forgot your Password?</a></p>
<div class="clr"></div>
<div id='error1' style="display:none;" class="login_vld"></div>
<div id="login" class="login_vld"> </div>
<div class="clr"></div>
</div>
<div class="gray_line"><img src="<?php echo IMG_PATH ?>gry_line.jpg" /></div>
<div class="sign_fb">
<div class="sg_fg_login"><a href="<?php echo $loginUrl; ?>"><img src="<?php echo IMG_PATH ?>facebookLogin-Btn.gif"></a></div>
<div class="sign_text">or</div>
<div class="sg_lgn_btn"><a href="javascript:;" onclick="return validateSignIn('u_email','pword','login');" id="submit">Login</a></div>
</div>
<input type="hidden" name="action" value="login_me" />
</form>
<div class="clr"></div>
</div>
<div class="bottom_bg-1">
<h6>Don't Have an Account Yet? <span style="color:#666;">Sign Up Here.</span></h6>
<div class="gray_line"><img src="<?php echo IMG_PATH ?>gry_line.jpg" /></div>
<div class="gray_2_login" ><a href="#" onclick="return showSignupPopup()">Sign Up Now</a></div>
<div class="clr"></div>
</div>
</div>
<script type="text/javascript">
function submitLogin(event){
if (event.keyCode == '13') {
event.preventDefault();
validateSignIn('u_email','pword','login');
}
}
$("#u_email").keypress(function(event){submitLogin(event);});
$("#pword").keypress(function(event){submitLogin(event);});
$("#submit").keypress(function(event){submitLogin(event);});
</script>
No comments:
Post a Comment