welll was getting bored :) so tried to create this on my own . . . . . . .
its 100% working . . . . and if u guys wanna change it then u can. . . certainly after seeing this thread . . .
OKKK lets start . . . . =). . . .
step1 :
create three templates. . . . ( modified ) they r attached pls down load them
open includes/page_header. php :
find:
//-----------------------------------------------------
//--- User Box ----------------------------------------
//-----------------------------------------------------
if ($user_info['user_level'] >= USER) {
$site_template->register_vars("lang_loggedin_msg", preg_replace("/". $site_template->start. "loggedin_user_name". $site_template->end. "/siU", format_text($user_info['user_name'], 2), $lang['lang_loggedin_msg']));
$user_box = $site_template->parse_template("user_logininfo");
$site_template->register_vars(array(
"user_box" => $user_box,
"user_loggedin" => 1,
"user_loggedout" => 0,
"is_admin" => ($user_info['user_level'] == ADMIN) ? 1 : 0
));
$site_template->un_register_vars("user_logininfo");
unset($user_box);
}
else {
$user_box = $site_template->parse_template("user_loginform");
$site_template->register_vars(array(
"user_box" => $user_box,
"user_loggedin" => 0,
"user_loggedout" => 1,
"is_admin" => 0
));
$site_template->un_register_vars("user_loginform");
unset($user_box);
}
replace with :
//-----------------------------------------------------
//--- User Box ----------------------------------------
//-----------------------------------------------------
if ($user_info['user_level'] >= USER) {
$site_template->register_vars("lang_loggedin_msg", preg_replace("/". $site_template->start. "loggedin_user_name". $site_template->end. "/siU", format_text($user_info['user_name'], 2), $lang['lang_loggedin_msg']));
$user_box2 = $site_template->parse_template("user_logininfo");
$site_template->register_vars(array(
"user_box2" => $user_box2,
"user_loggedin" => 1,
"user_loggedout" => 0,
"is_admin" => ($user_info['user_level'] == ADMIN) ? 1 : 0
));
$site_template->un_register_vars("user_logininfo");
unset($user_box2);
}
else {
$user_box = $site_template->parse_template("user_loginform");
$site_template->register_vars(array(
"user_box" => $user_box,
"user_loggedin" => 0,
"user_loggedout" => 1,
"is_admin" => 0
));
$site_template->un_register_vars("user_loginform");
unset($user_box);
$user_box3 = $site_template->parse_template("user_login");
$site_template->register_vars(array(
"user_box3" => $user_box3
));
$site_template->un_register_vars("user_login");
unset($user_box3);
}
step 2: create a new template . . . Signin. html and Signin. php
code for signin. php:
<?php
$main_template = 'Signin';
define('GET_CACHES', 1);
define('ROOT_PATH', '. /');
include(ROOT_PATH. 'global. php');
require(ROOT_PATH. 'includes/sessions. php');
$user_access = get_permission();
include(ROOT_PATH. 'includes/page_header. php');
$error = 0;
if ($user_info['user_level'] != GUEST || empty($HTTP_POST_VARS['user_name']) || empty($HTTP_POST_VARS['user_password'])) {
if (!ereg("index. php", $url) && !ereg("login. php", $url) && !ereg("register. php", $url) && !ereg("member. php", $url) && !ereg("details. php",$url)) {
redirect($url);
}
}
else {
$error = $lang['invalid_login'];
}
if ($error) {
$main_template = "error";
include(ROOT_PATH. 'includes/page_header. php');
show_error_page($error);
}
$site_template->print_template($site_template->parse_template($main_template));
include(ROOT_PATH. 'includes/page_footer. php');
?>
Note . . . . u will have to include --> && !ereg("somepage. php", $url) for every new page you createee. . . . .
for signin. html just create an empty html . . . . . and put this code to a suitable place . . . . welll just at the middle of ur empty page . . . .
code to put :
<table align="center">
<tr><td>{user_box}{user_box2}</td></tr>
</table>
step3:
on every page . . . . put the following code to suitable place according to ur design criteria :) . . . note : u can always chnage the design of the attached html files to ur liking . . . .
code to put :
{user_box3}{user_box2}
step 4
open urtemplate/header. html
put this code inside the head section so that the user is always redirected to the page he came from ::
<script language="JavaScript">
var time = null
function move() {
window. location = '<?php $pp = $_GET["pp"]; echo($pp);?>'
}
</script>
thats it :) enjoi ur new signin page for 4images :)