Code: Select all
<?php
//##################################################################
//
// 2012 - phalancs
//
// INSTALL:
// 1. put this code in a file like "escape_login.php"
// 2. put this file into template/inc_script/frontend_render/
//
// USAGE:
// On your site, simply press "escape" to jump to the login
// when already logged in, you'll land in the backend
//
//##################################################################
$escape_login = '
<script type="text/javascript">
<!--
var triggerKeyCode = 27;
jQuery(document).keyup(function(e) {
if (e.keyCode == triggerKeyCode) {
escape_login();
}
});
function escape_login() {
document.location.href="'.PHPWCMS_URL.$phpwcms["login.php"].'";
}
-->
</script>
';
//document.location.href="'.PHPWCMS_URL.$phpwcms["login.php"].'";
// document.location.href="'.PHPWCMS_URL.'phpwcms.php";
//insert script at the beginning after <body>
$content["all"] .= $escape_login;
?>