Author Topic: get profile by user name  (Read 7231 times)

0 Members and 1 Guest are viewing this topic.

Offline ahmed_badawy

  • Newbie
  • *
  • Posts: 48
    • View Profile
get profile by user name
« on: February 26, 2009, 12:07:46 PM »
hi all

i want edit the link of profile

member.php?action=showprofile&user_id=1

to

member.php?action=showprofile&user_name=admin


Offline ahmed_badawy

  • Newbie
  • *
  • Posts: 48
    • View Profile
Re: get profile by user name
« Reply #1 on: March 02, 2009, 10:59:00 AM »
 :roll: i need this they are important

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: get profile by user name
« Reply #2 on: March 02, 2009, 01:36:37 PM »
in member.php find:
  if ($user_row get_user_info($user_id)) {
    
$user_homepage = (isset($user_row['user_homepage'])) ? format_url($user_row['user_homepage']) : REPLACE_EMPTY;


Insert above:
  if ($user_id == GUEST)
  {
    
$user_name = (isset($HTTP_POST_VARS['user_name']) ? un_htmlspecialchars(trim($HTTP_POST_VARS['user_name'])) : (isset($HTTP_GET_VARS['user_name']) ? un_htmlspecialchars(trim($HTTP_GET_VARS['user_name'])) : ""));
    
$sql "SELECT ".get_user_table_field("""user_id")."
            FROM "
.USERS_TABLE."
            WHERE "
.get_user_table_field("""user_name")." = '".strtolower($user_name)."'
            LIMIT 1"
;
    if (
$user_row $site_db->query_firstrow($sql))
    {
      
$user_id $user_row['user_id'];
    }
  }
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline ahmed_badawy

  • Newbie
  • *
  • Posts: 48
    • View Profile
Re: get profile by user name
« Reply #3 on: March 06, 2009, 07:15:19 PM »
thanx V@no but not getting info in profile page  :roll:

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: get profile by user name
« Reply #4 on: March 12, 2009, 02:45:18 AM »
can I see it?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline ahmed_badawy

  • Newbie
  • *
  • Posts: 48
    • View Profile
Re: get profile by user name
« Reply #5 on: March 12, 2009, 06:09:03 AM »
thanx V@no now working

my bad i Replaced Instead of Insert above