Author Topic: Username to login, But visible with full name  (Read 99332 times)

0 Members and 1 Guest are viewing this topic.

Offline cloe

  • Full Member
  • ***
  • Posts: 120
    • View Profile
Username to login, But visible with full name
« on: August 04, 2007, 03:54:11 PM »
Is there someone that can help me with this?

When someone register, I want to ask for full name before username, in two fields:

Name:
Lastname:

I want the user to login with their username.. But when they are logged inn.. they are not visible with there usernames.. but with the full name??
And in member profile, is not the username visible, but the full name.

I hope someone can help me with this?

Best Reguards
-Cecilie-
Peace And Luv :)

--Cecilie--

http://www.cloevvold-photo.com

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Username to login, But visible with full name
« Reply #1 on: August 04, 2007, 05:21:19 PM »
If no done:

// Step 1

In includes/db_field_definitions.php file, add before ?>:

Quote
$additional_user_fields['user_firstname'] = array($lang['user_firstname'], "text", 1);
$additional_user_fields['user_lastname'] = array($lang['user_lastname'], "text", 1);

// Step 2

Go to lang/your_lang/main.php file, add before ?>:

Quote
$lang['user_firstname'] = "Firstname: ";
$lang['user_lastname'] = "Lastname: ";

// Step 3

Go to templates/your_template/register_form.html file.

Find:

Quote
<tr>
            <td class="row1"><b>{lang_user_name}</b></td>
            <td class="row1">
              <input type="text" name="user_name" size="30" value="{user_name}" class="input" />
            </td>
          </tr>

Add after:

Quote
<tr>
<td class="row1"><b>{lang_user_firstname}</b></td>
<td class="row1">
<input type="text" name="user_firstname" size="30" value="{user_firstname}" class="input" />
</td>
</tr>

<tr>
<td class="row1"><b>{lang_user_lastname}</b></td>
<td class="row1">
<input type="text" name="user_lastname" size="30" value="{user_lastname}" class="input" />
</td>
</tr>

// Step 4

Go to includes/sessions.php file,

Find:

Quote
$sql = "SELECT s.session_user_id, s.session_lastaction, s.session_ip".get_user_table_field(", u.", "user_id").get_user_table_field(", u.", "user_level").get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_invisible")."

Replace:

Quote
$sql = "SELECT s.session_user_id, s.session_lastaction, s.session_ip".get_user_table_field(", u.", "user_id").get_user_table_field(", u.", "user_level").get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_invisible").", u.user_firstname, u.user_lastname

// Step 5

Find:

Quote
          $user_online_list .= "<a href=\"".$site_sess->url($user_profile_link)."\">".$username."</a>".$invisibleuser;

Replace:

Quote
$full_name = (isset($row['user_firstname']) && isset($row['user_lastname']) && !empty($row['user_firstname']) && !empty($row['user_lastname'])) ? $row['user_firstname'] . REPLACE_EMPTY . $row['user_lastname'] : $username;
          $user_online_list .= "<a href=\"".$site_sess->url($user_profile_link)."\">".((isset($full_name)) ? trim($full_name) : "")."</a>".$invisibleuser;

// Step 6

Add in USERS_TABLE (phpmyadmin):

- user_firstname, varchar(255)
- user_lastname, varchar(255)

See full name in whos online. ;)
« Last Edit: August 04, 2007, 10:59:57 PM by thunderstrike »
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline cloe

  • Full Member
  • ***
  • Posts: 120
    • View Profile
Re: Username to login, But visible with full name
« Reply #2 on: August 04, 2007, 05:55:24 PM »
Nothing works after this... blank pages :(

Where and what to put in database?? Mysql
Peace And Luv :)

--Cecilie--

http://www.cloevvold-photo.com

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Username to login, But visible with full name
« Reply #3 on: August 04, 2007, 06:02:20 PM »
Sorry ... step 6 add. ;)
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline cloe

  • Full Member
  • ***
  • Posts: 120
    • View Profile
Re: Username to login, But visible with full name
« Reply #4 on: August 04, 2007, 06:13:04 PM »
Sorry ... step 6 add. ;)

Oki.. done that.... and when i insert the code in : sessions.php.. I get this error: An unexpected error occured. Please try again later. (red text in the left corner of the page)

And when i insert the code in main.php the site is going completly blank??
Peace And Luv :)

--Cecilie--

http://www.cloevvold-photo.com

Offline cloe

  • Full Member
  • ***
  • Posts: 120
    • View Profile
Re: Username to login, But visible with full name
« Reply #5 on: August 04, 2007, 06:15:59 PM »
Sorry ... step 6 add. ;)

Oki.. done that.... and when i insert the code in : sessions.php.. I get this error: An unexpected error occured. Please try again later. (red text in the left corner of the page)

And when i insert the code in main.php the site is going completly blank??

And this error when I am logged in:

DB Error: Bad SQL Query: SELECT s.session_user_id, s.session_lastaction, s.session_ip, u.user_id, u.user_level, u.user_name, u.user_invisible, u.user_firstname, u.user_lastname FROM 4images_sessions s LEFT JOIN 4images_users u ON (u.user_id = s.session_user_id) WHERE s.session_lastaction >= 1186243795 ORDER BY u.user_id ASC, s.session_ip ASC
Unknown column 'u.user_firstname' in 'field list'
Peace And Luv :)

--Cecilie--

http://www.cloevvold-photo.com

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Username to login, But visible with full name
« Reply #6 on: August 04, 2007, 06:33:57 PM »
Quote
Unknown column 'u.user_firstname' in 'field list'

This mean no added in USERS_TABLE or content empty by use account (if empty - go edit profile) ...
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline cloe

  • Full Member
  • ***
  • Posts: 120
    • View Profile
Re: Username to login, But visible with full name
« Reply #7 on: August 04, 2007, 06:39:15 PM »
Oki.. Ive added this in 4images_users... What you mean is that if the full name is not filled in by any users, this error will acure??

Is there In any more tables i should add these fields?
Peace And Luv :)

--Cecilie--

http://www.cloevvold-photo.com

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Username to login, But visible with full name
« Reply #8 on: August 04, 2007, 06:56:25 PM »
Quote
this error will acure??

Update step 5. Do again.
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline cloe

  • Full Member
  • ***
  • Posts: 120
    • View Profile
Re: Username to login, But visible with full name
« Reply #9 on: August 04, 2007, 07:16:34 PM »
Im sorry.. But I have done all twice now.. It dosent work.
Ive updated member_editprofile.html so I can edit the full name... But all the errors are still here..
And after I installed this.. there is 0 users online... but i am logged in.

Are you sure this code dont miss anything, because it really dont work.

And when I install in main.php Everything goes comletly blank (just white pages)
Peace And Luv :)

--Cecilie--

http://www.cloevvold-photo.com

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Username to login, But visible with full name
« Reply #10 on: August 04, 2007, 08:05:11 PM »
Quote
And when I install in main.php Everything goes comletly blank (just white pages)

Added top of ?> tag (no after) ?
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline cloe

  • Full Member
  • ***
  • Posts: 120
    • View Profile
Re: Username to login, But visible with full name
« Reply #11 on: August 04, 2007, 08:07:14 PM »
Quote
And when I install in main.php Everything goes comletly blank (just white pages)

Added top of ?> tag (no after) ?

No everything is before ?>
Peace And Luv :)

--Cecilie--

http://www.cloevvold-photo.com

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Username to login, But visible with full name
« Reply #12 on: August 04, 2007, 08:15:26 PM »
See content in USERS_TABLE for first, last names (phpmyadmin) ?

1. If not, register new user.
2. Content (phpmyadmin) ?
3. 4images version ?
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Username to login, But visible with full name
« Reply #13 on: August 04, 2007, 08:24:40 PM »
Quote
And after I installed this.. there is 0 users online... but i am logged in.

Edit: Ok, patch. Step 5.
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline cloe

  • Full Member
  • ***
  • Posts: 120
    • View Profile
Re: Username to login, But visible with full name
« Reply #14 on: August 04, 2007, 08:33:59 PM »
I shall try to install it again, from scrach...
I found out about the problem on main.php (when it goes blank)

This is what u wrote:

$lang['user_firstname'] = "Firstname: ":
$lang['user_lastname'] = "Lastname: ";

It can not be a space betwen : ":

The correct way is:

$lang['user_firstname'] = "Firstname:":
$lang['user_lastname'] = "Lastname:";

I will try it all again...
Peace And Luv :)

--Cecilie--

http://www.cloevvold-photo.com