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

0 Members and 1 Guest are viewing this topic.

Offline cloe

  • Full Member
  • ***
  • Posts: 120
    • View Profile
Re: Username to login, But visible with full name
« Reply #30 on: August 04, 2007, 11:32:04 PM »
Quote
Is there some php guru here, that can make this work for me??

Speak to one now ... dont believe ? Sorry... mine works well.

Thats really strange  :?
I've followd your instruction several times now... And it dont work.
Can you someway make a download to the files that has been modified.. so I can se your files?
And a install.php to mysql?

And yes Thunderstrike, I believe that you know php well :)...
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 #31 on: August 04, 2007, 11:43:18 PM »
Quote
Thats really strange  Confused
I've followd your instruction several times now... And it dont work.

Way it implement ...

Quote
And a install.php to mysql?

If ask this, is because you dont know how create fields ...

Anyway, here - no problem - create install.php file - upload with content:

Quote
<?php

define('ROOT_PATH', './');
include(ROOT_PATH . 'global.php');
require(ROOT_PATH . 'includes/sessions.php');

if ($user_info['user_level'] == ADMIN) {

$sql = "

ALTER TABLE " . USERS_TABLE . " ADD user_firstname VARCHAR(255) NOT NULL,
ALTER TABLE " . USERS_TABLE . " ADD user_lastname VARCHAR(255) NOT NULL

";

$result = $site_db->query($sql);

if (isset($result) && !$result) {
   echo "Error altering field.";
}

if (isset($result) && $result) {
   echo "Field install success !";
}

}
?>

This for field. Should work. (Login ADMIN - no USER).
« Last Edit: August 05, 2007, 12:27:36 AM 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 #32 on: August 05, 2007, 12:02:18 AM »
Quote
Thats really strange  Confused
I've followd your instruction several times now... And it dont work.

Way it implement ...

Quote
And a install.php to mysql?

If ask this, is because you dont know how create fields ...

Anyway, here - no problem - create install.php file - upload with content:

Quote
<?php

define('ROOT_PATH', './');
include(ROOT_PATH . 'global.php');
require(ROOT_PATH . 'includes/sessions.php');

if ($user_info['user_level'] == ADMIN) {

$sql = "

ALTER TABLE " . USERS_TABLE . " ADD user_firstname VARCHAR(255) NOT NULL,
ALTER TABLE " . USERS_TABLE . " ADD user_lastname VARCHAR(255) NOT NULL

";

$result = $site_db->query($sql);

if (isset($result) && !$result) {
   echo "Error altering field.";
}

if (isset($result) && $result)) {
   echo "Field install success !";
}
?>

This for field. Should work. (Login ADMIN - no USER).

Where do you create user_lastname and user user_lastname?
In table 4images_users or in another table?

The install.php give an error:

Parse error: syntax error, unexpected ')' in C:\wamp\www\fresh_fotoonline_skal_paa_web\install.php on line 22
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 #33 on: August 05, 2007, 12:19:59 AM »
Code correct now. Try. ;)
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 #34 on: August 05, 2007, 12:26:29 AM »
Code correct now. Try. ;)

Opps... Sorry but i get this now:

Parse error: syntax error, unexpected $end in C:\wamp\www\fresh_fotoonline_skal_paa_web\install_user.php on line 25
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 #35 on: August 05, 2007, 12:27:54 AM »
Done. Try again (for good). ;)
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 #36 on: August 05, 2007, 01:49:13 AM »
Hey.. looks like it finnaly works.. Dont know how...but its works..

Thank you Thunderstrike for your patient.. I hope that you dont give up on me, but have the patient to help me again soon  :wink:

Edit: I found out why It didnt worked for me, and I am imbaressed  :oops:

I have 2 databases with rather similar names, well the rest speak for it self  :?
I've put the fields in the wrong database...
Im SOOOOOOOO SORRY... It will not happend again.. I will learn from my mistakes.

Please forgive me  :cry:


All respect for you thunderstrike (My PHP Guru)
« Last Edit: August 05, 2007, 04:29:17 AM by cloe »
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 #37 on: August 05, 2007, 03:53:00 AM »
Now remains the last question :)
I got this working now.. so this I sholuld understand quick  :wink:

How do I display the full name (user_firstname and user_lastname) here:

Logged in as: Full name here
Under Thumbnails
Under Random Image
User profile of: Full name here
Display all images added by: Full name here
In Menberlist
In Top Images
In Comments
Image Added by: Full Name here

I dont remember anywhere else.. But I mean everywhere the username shows up.. I want the Full Name to be there instead.

Is it a way to make a "rule" theat anywhere the username shows up, will it show The full name first and last name.
So if i install other mods I dont have to think about changing it?

I want username only to be in use when members login... Is this possible??

Oh and another thing, I want Admin to be bold in whos online like it used to be :)
« Last Edit: August 05, 2007, 04:34:09 AM by cloe »
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 #38 on: August 05, 2007, 05:41:54 AM »
Quote
All respect for you thunderstrike (My PHP Guru)

Exacllent. ;)

Quote
Logged in as: Full name here

Ahhh ! yes. Luky you - did for my site too. ;)

In includes/page_header.php file, easy -

Find:

Quote
$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']));

Replace:

Quote
$site_template->register_vars("lang_loggedin_msg", preg_replace("/".$site_template->start."loggedin_user_name".$site_template->end."/siU", format_text(stripslashes($user_info['user_firstname']), 2) . REPLACE_EMPTY . format_text(stripslashes($user_info['user_lastname']), 2), $lang['lang_loggedin_msg']));

Quote
Under Thumbnails
Under Random Image
User profile of: Full name here
Display all images added by: Full name here
In Menberlist
In Top Images
In Comments
Image Added by: Full Name here

Wow ... huge demand ... do no help MOD (examp: memberlist). Only core.

Quote
Under Thumbnails

Which PHP file + action ? (examp: categories.php?cat_id ... index.php ... details.php ... which one ?)

Quote
Under Random Image

Core ? MOD ? (If MOD, no help for it sorry).

Quote
User profile of: Full name here

Ahh ! yes - in member.php file,

find:

Quote
"lang_show_user_images" => preg_replace("/".$site_template->start."user_name".$site_template->end."/siU", format_text($user_row['user_name'], 2), $lang['show_user_images']),

Replace:

Quote
"lang_show_user_images" => preg_replace("/".$site_template->start."user_name".$site_template->end."/siU", format_text(stripslashes($user_row['user_firstname']), 2) . REPLACE_EMPTY . format_text(stripslashes($user_info['user_lastname']), 2), $lang['show_user_images']),

Quote
In Top Images

Umm .. never did it ... make backup top.php file (safe) ...

In top.php file,

find:

Quote
// Rating
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, c.cat_name".get_user_table_field(", u.", "user_name")."

replace:

Quote
// Rating
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, c.cat_name".get_user_table_field(", u.", "user_name").", u.user_firstname, u.user_lastname

find:

Quote
$register_array['image_rating_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text($top_list[$i][$user_table_fields['user_name']])."</a>";

replace:

Quote
$register_array['image_rating_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text(stripslashes($top_list[$i]['user_firstname']), 2) . REPLACE_EMPTY . format_text(stripslashes($top_list[$i]['user_lastname']), 2)."</a>";

find:

Quote
// Votes
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, c.cat_name".get_user_table_field(", u.", "user_name")."

replace:

Quote
// Votes
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, c.cat_name".get_user_table_field(", u.", "user_name").", u.user_firstname, u.user_lastname

find:

Quote
$register_array['image_votes_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text($top_list[$i][$user_table_fields['user_name']])."</a>";

replace:

Quote
$register_array['image_votes_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text(stripslashes($top_list[$i]['user_firstname']), 2) . REPLACE_EMPTY . format_text(stripslashes($top_list[$i]['user_lastname']), 2)."</a>";

find:

Quote
// Hits
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_hits, c.cat_name".get_user_table_field(", u.", "user_name")."

replace:

Quote
// Hits
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_hits, c.cat_name".get_user_table_field(", u.", "user_name").", u.user_firstname, u.user_lastname

find:

Quote
$register_array['image_hits_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text($top_list[$i][$user_table_fields['user_name']])."</a>";

replace:

Quote
$register_array['image_hits_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text(stripslashes($top_list[$i]['user_firstname']), 2) . REPLACE_EMPTY . $top_list[$i]['user_lastname']), 2)."</a>";

find:

Quote
// Downloads
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_downloads, c.cat_name".get_user_table_field(", u.", "user_name")."

replace:

Quote
// Downloads
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_downloads, c.cat_name".get_user_table_field(", u.", "user_name").", u.user_firstname, u.user_lastname

find:

Quote
$register_array['image_downloads_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text($top_list[$i][$user_table_fields['user_name']])."</a>";

replace:

Quote
$register_array['image_downloads_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text(stripslashes($top_list[$i]['user_firstname']), 2) . REPLACE_EMPTY . format_text(stripslashes($top_list[$i]['user_lastname']), 2)."</a>";

Quote
In Comments

Custom contract only.

Quote
Image Added by: Full Name here

Custom contract only.
« Last Edit: August 08, 2007, 03:41:46 AM 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 #39 on: August 05, 2007, 06:19:40 AM »
You are good thunderstrike... It works perfect... Almost... Just one error in member.php  this:

Parse error: syntax error, unexpected T_VARIABLE in C:\wamp\www\fresh_fotoonline_skal_paa_web\member.php on line 998

The only mod I have is memberlist.. The rest is core :)
And Image Added by: Full Name here is core.. It is under the info.. when a image is uploaded

In Thumbnails, I mean all pages there are thumbnails... I'm not sure on every page they are.. But It is all core there to :)
« Last Edit: August 05, 2007, 06:39:15 AM by cloe »
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 #40 on: August 05, 2007, 02:28:56 PM »
Quote
Parse error: syntax error, unexpected T_VARIABLE in C:\wamp\www\fresh_fotoonline_skal_paa_web\member.php on line 998

Correct. Topic update. ;)

Quote
And Image Added by: Full Name here is core.. It is under the info.. when a image is uploaded

In Thumbnails, I mean all pages there are thumbnails... I'm not sure on every page they are.. But It is all core there to

Take longer. Would do it - custom coding only.

Actual:

Quote
In Comments

This one  no need custom coding. Short. ;)

In details.php file,

find:

Quote
$sql = "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, c.comment_ip, c.comment_date".get_user_table_field(", u.", "user_level").get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email").get_user_table_field(", u.", "user_showemail").get_user_table_field(", u.", "user_invisible").get_user_table_field(", u.", "user_joindate").get_user_table_field(", u.", "user_lastaction").get_user_table_field(", u.", "user_comments").get_user_table_field(", u.", "user_homepage").get_user_table_field(", u.", "user_icq")."

replace:

Quote
$sql = "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, c.comment_ip, c.comment_date".get_user_table_field(", u.", "user_level").get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email").get_user_table_field(", u.", "user_showemail").get_user_table_field(", u.", "user_invisible").get_user_table_field(", u.", "user_joindate").get_user_table_field(", u.", "user_lastaction").get_user_table_field(", u.", "user_comments").get_user_table_field(", u.", "user_homepage").get_user_table_field(", u.", "user_icq").", u.user_firstname, u.user_lastname

find:

Quote
$comment_user_name = format_text($comment_row[$i]['comment_user_name'], 2);

replace:

Quote
$comment_user_name = format_text(stripslashes($comment_row[$i]['user_firstname']), 2) . REPLACE_EMPTY . format_text(stripslashes($comment_row[$i]['user_lastname']), 2);

;)
« Last Edit: August 08, 2007, 02:18:39 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 thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Username to login, But visible with full name
« Reply #41 on: August 05, 2007, 02:59:21 PM »
Quote
And Image Added by: Full Name here is core.. It is under the info.. when a image is uploaded

Actual, not long (function show_image code already. ;)).

In details.php file,

find:

Quote
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email")."

replace:

Quote
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email").", u.user_firstname, u.user_lastname

In includes/functions.php file,

find:

Quote
if (isset($image_row[$user_table_fields['user_name']]) && $image_row['user_id'] != GUEST) {
    $user_name = format_text($image_row[$user_table_fields['user_name']], 2);

replace:

Quote
if (isset($image_row['user_firstname']) && isset($image_row['user_lastname']) && $image_row['user_id'] != GUEST) {
    $user_name = format_text($image_row['user_firstname'] . REPLACE_EMPTY . $image_row['user_lastname'], 2);

Quote
In Thumbnails, I mean all pages there are thumbnails... I'm not sure on every page they are.. But It is all core there to

This one, only one longer. ;)
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 #42 on: August 06, 2007, 01:09:06 AM »
Thanks a lot :)

Some problems... Under thumbnail.. is it showing "guest" in all images...

Edit: Random Image is core.. Its the box on the left side, under registred users, it is a thumbnail there that shows random images :)
 
« Last Edit: August 06, 2007, 01:25:21 AM by cloe »
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 #43 on: August 06, 2007, 01:58:45 AM »
Quote
Edit: Random Image is core.. Its the box on the left side, under registred users, it is a thumbnail there that shows random images

Screenshot / Precise URL (include PHP filename) ?
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 #44 on: August 06, 2007, 02:22:13 AM »
Quote
Edit: Random Image is core.. Its the box on the left side, under registred users, it is a thumbnail there that shows random images

Screenshot / Precise URL (include PHP filename) ?


I am not sure in witch php file it is in.. but this random image is visible in every page.

If you se the other thumbs is it saying (gjest) = guest on norwegian

And there is some other bugs here.. I will findt it and tell you ;)
Peace And Luv :)

--Cecilie--

http://www.cloevvold-photo.com