Results 1 to 7 of 7

Thread: Too many name fields

  1. #1
    Thread Starter
    Member ancient-geek's Avatar
    Join Date
    Jan 2010
    Location
    Darlington, UK
    Posts
    76
    Thanks
    1
    Thanked 2 Times in 2 Posts

    Too many name fields

    I hate to sound negative, I'm not, I really love this product. But I feel some tweaking is in order.....

    I'm still developing my site, it's nearly ready and I was doing some of my own user acceptance testing when I noticed how many different fields there are for putting a name in.

    Firstly, a user registers a name, say 'Titch'. But 'titch' is already taken so he uses titch45
    Then he goes to his profile and it asks his name, at this point he decides not to enter anything because, well who cares right?
    He's just posting a classified to sell his old armchair he doesn't care to give his name out. Maybe later. I mean the same add is running in the local paper and that just has his phone number.
    Then he posts and ad where it asks for a name (mandatory) - not sure what to put here so he sticks in 'Armchair Boy'. You know what people are like.
    The ad is posted and when he sees other people putting their names in he goes back to the profile puts his real name in. 'Billy Short' and then he sees the nickname field so he puts in 'Titch' coz that's his nickname.

    So now he has the following names:
    User name: Titch45
    First name: Billy
    Last name: Short
    Nickname: Titch
    Name on ad: Armchair Boy

    Now when he sees Display name, he has a fit. I mean some of the folks in my town will have trouble adding the two little numbers at the bottom of the submission so we don't want to tax them too hard.
    (I've been in IT support for many years and you wouldn't believe how dopey people can be when sitting in front of a computer).

    So, anyway titch isn't too dumb so he picks his nickname as the display name.
    But guess what? The name 'Armchair Boy' still appears on the listing.

    It gets worse.
    Sally sees the listing and sees the name 'Armchair Boy' as the seller's name and clicks it.
    That takes her to the 'About Titch' profile name which DOESN'T show his full name.

    Yikes.

    I'm going to have a go at hacking these files down to a managable set of names. I don't really think anyone would care too much about giving their full name, let alone setting up a profile , except perhaps traders like car dealers.
    I may do something like lose the real names and make the nickname mandatory and feed that through to the post page. I will have to think it through.

    If anybody else has been successful in similar changes I would appreciate a short cut. Or perhaps some thoughts on what would be a good set of requirements for what is simply a local town classifieds site.

    Cheers.

  2. #2
    Thread Starter
    Member ancient-geek's Avatar
    Join Date
    Jan 2010
    Location
    Darlington, UK
    Posts
    76
    Thanks
    1
    Thanked 2 Times in 2 Posts

    Re: Too many name fields

    I think I cracked it. Cut out a few lines here and there. Changed a few others, wasn't too difficult. I'll compile a how-to if anyone's interested.

  3. #3
    pepsi's Avatar
    Join Date
    Mar 2009
    Location
    New Zealand
    Posts
    14,883
    Thanks
    91
    Thanked 804 Times in 718 Posts

    Re: Too many name fields

    Yes we'd love if you would share please. Thanks.

    And btw.. very entertaining description of your problem

  4. #4
    Veteran sarge's Avatar
    Join Date
    Jun 2009
    Location
    USA
    Posts
    628
    Thanks
    2
    Thanked 9 Times in 9 Posts

    Re: Too many name fields

    I got so wrapped up in the story, I forgot there was a problem

    A tutorial would be nice.
    Always treat everyone with respect and courtesy, but trust no one.

  5. #5
    Thread Starter
    Member ancient-geek's Avatar
    Join Date
    Jan 2010
    Location
    Darlington, UK
    Posts
    76
    Thanks
    1
    Thanked 2 Times in 2 Posts

    Re: Too many name fields

    OK, I tried to compile some notes here, I've done some other tweaks like adding a mandatory post code but here is what I did to minimise the names used.
    In short, I completely removed the First Name and Last Name requirement in the profile. Then, I wanted the nickname to populate the name field when posting an ad. If there is no nickname it will use the login name.They can still change this, but that's their lookout. And just for tidyness, I took the name fields of the dropdown list in the Display Name field.
    Here are my notes:

    When posting a new ad. To change the pre-populated name field from User's real name to the nickname:
    In post-form.php
    In the line (about line 187) that starts: <label for="name_owner"><?php _e('Name','cp'); ?>

    Replace this part at the END OF THE LINE:
    Code:
    value="<?php if ($current_user->user_firstname != "") { echo stripslashes($current_user->user_firstname) ." ". stripslashes($current_user->user_lastname); } else { echo stripslashes($_POST['name_owner']); }?>" />
    With:
    Code:
    value="<?php if ($current_user->nickname != "") { echo stripslashes($current_user->nickname); } else { echo stripslashes($_POST['name_owner']); }?>" />
    Note that if there is no nickname it will use the name_owner field which is the login name.

    OR. If you prefer to use the login name instead of the nickname, then there is no need for an if-statement replace with this instead
    Code:
    value="<?php echo stripslashes($current_user->user_login); ?>" />

    Now, this bit is optional, but I wanted to get rid of the requirement for First Name and Last Name altogether.
    So, these fields need to come off the profile page which is tpl-profile.php

    Quite simply, remove these lines:
    Code:
    <tr>
    	<th><label for="first_name"><?php _e('First Name','cp') ?></label></th>
    	<td><input type="text" name="first_name" class="mid2" id="first_name" value="<?php echo $userdata->first_name ?>" size="35" maxlength="100" /></td>
    </tr>
    <tr>
    	<th><label for="last_name"><?php _e('Last Name','cp') ?></label></th>
    	<td><input type="text" name="last_name" class="mid2" id="last_name" value="<?php echo $userdata->last_name ?>" size="35" maxlength="100" /></td>
    </tr>
    And then, to prevent them showing up in the drop down list for 'Display Name'
    remove these lines, also in tpl-profile.php

    Code:
    $public_display['display_firstname'] = $userdata->first_name;
    $public_display['display_firstlast'] = $userdata->first_name.' '.$userdata->last_name;
    $public_display['display_lastfirst'] = $userdata->last_name.' '.$userdata->first_name;

  6. #6
    Member
    Not a Verified Customer
    lappyhappy's Avatar
    Join Date
    Jan 2010
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Too many name fields

    Would you know how to change the display name in the ads so that is displays the username instead of real name?


  7. #7
    Thread Starter
    Member ancient-geek's Avatar
    Join Date
    Jan 2010
    Location
    Darlington, UK
    Posts
    76
    Thanks
    1
    Thanked 2 Times in 2 Posts

    Re: Too many name fields

    I think that's a little more tricky, because it is using the author name of the post. You can see it displayed in single.php around 114.
    Code:
    		<span><?php _e('Posted By:','cp');?></span>
    	
    			<h1>
    			<?php if (get_the_author() != "") { ?>
    				<?php echo get_post_meta($post->ID, "name", true); ?>
    			<?php } else { 
    				echo get_post_meta($post->ID, "name", true); 
    			} ?>
    			</h1>
    I don't know if it's enough to change it here or go back and change the author name at source. I'm not a very good php programmer so it would take a bit of trial and error.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)