Home Support Desk 1Faze Shop Hosting SEO Blogs Groups Forums Articles Conference




Part Two of Remember Me
12 June, 200912 June, 2009 0 comments Code Tweaks and samples Code Tweaks and samples

Open /templates/tmpl_xxx/login_form.html

Find :

<input type="text" name="ID" class="login_form_input" />

Replace with:

<input type="text" name="ID" class="login_form_input" value="__name_saver__" />

Open /join.php

Find:

function LoginForm( $text, $action, $table, $login_page, $forgot_page, $template = '' )
{
global $site;
global $tmpl;

$aFormReplace = array();



$aFormReplace['header_text'] = $site['title'] . ' ' . $mem . ' Login';
if( $action == "login" )
{
$aFormReplace['warning_text'] = $text;
$aFormReplace['submit_label'] = _t("_Log In");
$aFormReplace['form_onsubmit'] = 'return true;';
}
elseif( $action == 'boonex' )
{
$aFormReplace['warning_text'] = $text .
'<div class="id">' .
'<a href="javascript:void(0);"
onclick="window.open(\'http://www.boonex.com/unity/express/XML.php?module=form&amp;action=joinForm&amp;community=3\', \'Boonex_Sign_Up\', \'width=400,height=593,toolbar=0,directories=0,menubar=0,status=0,location=0,scrollbars=0,resizable=0\');">' .
_t( '_Get BoonEx ID' ) .
'</a>'.
'</div>';

$aFormReplace['submit_label'] = _t("_Import");

$aFormReplace['form_onsubmit'] = 'getBoonexId( this, document.forms.join_form ); return false;';
}
$aFormReplace['action_url'] = $login_page;
$aFormReplace['relocate_url'] = $_SERVER['PHP_SELF'];
$aFormReplace['name_label'] = $name_label;

$aFormReplace['password_label'] = _t("_Password");

if( $forgot_page )
{
$aFormReplace['forgot_page_url'] = $forgot_page;
$aFormReplace['forgot_label'] = _t("_forgot_your_password") . '?';
}
else
{
$aFormReplace['forgot_page_url'] = '';
$aFormReplace['forgot_label'] = '';
}

if( !strlen( $template ) )
$template = BX_DIRECTORY_PATH_ROOT . "templates/tmpl_{$tmpl}/join_login_form.html";

$ret = file_get_contents( $template );

foreach( $aFormReplace as $key => $val )
$ret = str_replace( "__{$key}__", $val, $ret );

return $ret;
}

Replace with:

function LoginForm( $text, $action, $table, $login_page, $forgot_page, $template = '' )
{
global $site;
global $tmpl;

$aFormReplace = array();

$name_label = _t("_Nickname");

if (isset($_COOKIE['whoIsMe'])) { $name_saver = $_COOKIE['whoIsMe']; }


$aFormReplace['header_text'] = $site['title'] . ' ' . $mem . ' Login';
if( $action == "login" )
{
$aFormReplace['warning_text'] = $text;
$aFormReplace['submit_label'] = _t("_Log In");
$aFormReplace['form_onsubmit'] = 'return true;';
}
elseif( $action == 'boonex' )
{
$aFormReplace['warning_text'] = $text .
'<div class="id">' .
'<a href="javascript:void(0);"
onclick="window.open(\'http://www.boonex.com/unity/express/XML.php?module=form&amp;action=joinForm&amp;community=3\', \'Boonex_Sign_Up\', \'width=400,height=593,toolbar=0,directories=0,menubar=0,status=0,location=0,scrollbars=0,resizable=0\');">' .
_t( '_Get BoonEx ID' ) .
'</a>'.
'</div>';

$aFormReplace['submit_label'] = _t("_Import");

$aFormReplace['form_onsubmit'] = 'getBoonexId( this, document.forms.join_form ); return false;';
}
$aFormReplace['action_url'] = $login_page;
$aFormReplace['relocate_url'] = $_SERVER['PHP_SELF'];
$aFormReplace['name_label'] = $name_label;
$aFormReplace['name_saver'] = $name_saver;

$aFormReplace['password_label'] = _t("_Password");

if( $forgot_page )
{
$aFormReplace['forgot_page_url'] = $forgot_page;
$aFormReplace['forgot_label'] = _t("_forgot_your_password") . '?';
}
else
{
$aFormReplace['forgot_page_url'] = '';
$aFormReplace['forgot_label'] = '';
}

if( !strlen( $template ) )
$template = BX_DIRECTORY_PATH_ROOT . "templates/tmpl_{$tmpl}/join_login_form.html";

$ret = file_get_contents( $template );

foreach( $aFormReplace as $key => $val )
$ret = str_replace( "__{$key}__", $val, $ret );

return $ret;
}

Part 3 to follow...

TagsTags: remember login usability 
Comments
  • There are no comments yet
Description
danielsolution
Posts: 3
Comments: 0
Developing for Boonex Dolphin Community software
Categories
Tags
3 usability (3)
3 login (3)
3 remember (3)