View Single Post
  #15  
Old 07-02-2002, 09:28 PM
xamu's Avatar
xamu xamu is offline
 
Join Date: Feb 2002
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I believe there's an omission:

In username_loggedout:

Replace:
PHP Code:
<smallfont><a href="register.php?action=signup">Want to register?</a
with
PHP Code:
<smallfont><a href="register.php?action=check">Want to register?</a
There's also a couple changes I made that makes it much nicer, IMHO. Personally I think it's pretty bad to tell a new user:

Our records show that you have already registered at this board under the name of $username. If you have lost your password, click here. If you would like to modify your profile, click here.

Talk about confusing the newbie

To avoid this problem, change/revise the instructions to say:
PHP Code:
----------------------------------
Open register.php
----------------------------------

looks for

if ((!isset(
$action) or $action=="") and (!isset($a) or $a=="")) {
  
$action="signup";
}

change to

if ((!isset($action) or $action=="") and (!isset($a) or $a=="")) {
  
$action="check";
}

now look for

if (
$url==$HTTP_REFERER) {
  
$url=urlencode($url);
}

below that add

// ############################### start docheck ###############################
if ($action=="docheck") {
  
$getuser=$DB_site->query_first("SELECT username FROM user WHERE username='$username'");
  if (empty(
$getuser[username])) {
    
$action="signup";
  }
  else {
    
$action="check";
    eval (
"\$error = \"".gettemplate("error_usernameexists")."\";");
  }
}

// ############################### start check ###############################
if ($action=="check") {

  if (!
$allowregistration) {
    eval(
"standarderror(\"".gettemplate("error_noregister")."\");");
    exit;
  }

  if (
$bbuserinfo[userid]!=and !$allowmultiregs) {
    
$getuser=$DB_site->query_first("SELECT username FROM user WHERE userid='$bbuserinfo[userid]'");
    
$username=$getuser[username];

    eval(
"standarderror(\"".gettemplate("error_usernameexists")."\");");

    exit;
  }

  eval(
"dooutput(\"".gettemplate("signupcheck")."\");");


and replace these instructions:
PHP Code:
Add the following template

----------------------------------
signupcheck
----------------------------------
<!
DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<
html>
<
head><title>$bbtitle Register</title>
$headinclude
</head>
<
body>
$header

<br>

<
table cellpadding="0" cellspacing="0" border="0" bgcolor="#555576"  width="100%" align="center"><tr><td>
<
table cellpadding="4" cellspacing="1" border="0"  width="100%">
<
tr id="cat">
    <
td bgcolor="#606096" width="100%"><normalfont color="#FFF788"><b>Register $bbtitle</b></normalfont></td>
</
tr>
<
tr>
    <
td bgcolor="#8080A6" width="100%"><normalfont color="#EEEEFF"><b>Check your username</b></normalfont></td>
</
tr>
<
tr>
    <
td bgcolor="#DFDFDF" width="100%">
    <
p align="center"><normalfont>Please fill in your username to confirm that it is free for use.<br>
                
$error
    
<form action="register.php" method="post">
                <
input type="hidden" name="s" value="$session[sessionhash]">
                 <
b>Username:</b><input type="text" class="bginput" name="username" size="25" maxlength="$maxuserlength">
    <
input type="hidden" name="action" value="docheck">
    <
input type="submit" class="bginput" name="Submit" value="Submit">
    <
input type="reset" class="bginput" name="Reset" value="Reset">
                 </
form>
                </
normalfont></p>
    </
td>
</
tr>
</
table>
</
td></tr></table>

$footer

</body>
</
html
with:
PHP Code:
Add the following templates

----------------------------------
error_usernameexists
----------------------------------
<
BR><FONT color=red>Our records show that someone has already 
registered at this board under the name of 
</FONT>
<
BR><BR>
<
B><I>$username</I></B>
<
BR><BR>
<
FONT color=red>You will need to choose a different username.</FONT>
<
BR><BR>


----------------------------------
signupcheck
----------------------------------
<!
DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<
html>
<
head><title>$bbtitle Register</title>
$headinclude
</head>
<
body>
$header

<br>

<
table cellpadding="0" cellspacing="0" border="0" bgcolor="#555576"  width="100%" align="center"><tr><td>
<
table cellpadding="4" cellspacing="1" border="0"  width="100%">
<
tr id="cat">
    <
td bgcolor="#606096" width="100%"><normalfont color="#FFF788"><b>Register $bbtitle</b></normalfont></td>
</
tr>
<
tr>
    <
td bgcolor="#8080A6" width="100%"><normalfont color="#EEEEFF"><b>Check your username</b></normalfont></td>
</
tr>
<
tr>
    <
td bgcolor="#DFDFDF" width="100%">
    <
p align="center"><normalfont>$error
Please enter in your desired username to confirm that it is not being used by someone 
else.<br>
    <
form action="register.php" method="post">
                <
input type="hidden" name="s" value="$session[sessionhash]">
                 <
b>Username:</b> <input type="text" class="bginput" name="username" size="25" maxlength="$maxuserlength">
    <
input type="hidden" name="action" value="docheck">
    <
input type="submit" class="bginput" name="Submit" value="Submit">
    <
input type="reset" class="bginput" name="Reset" value="Reset">
                 </
form>
                </
normalfont></p>
    </
td>
</
tr>
</
table>
</
td></tr></table>

$footer

</body>
</
html
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01230 seconds
  • Memory Usage 1,887KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_php
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete