Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Welcome Username  (Read 3423 times)

0 Members and 1 Guest are viewing this topic.

gateway_46806

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Welcome Username
« on: February 06, 2013, 06:12:33 am »

How would I go about modifying the 'Welcome Username' to Welcome First Name/Nickname/Other Name in CPG15x which was possible in earlier versions of the Coppermine Gallery. Thanks in advance for any assistance.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Welcome Username
« Reply #1 on: February 06, 2013, 09:50:51 am »

Please post a link to the old mod, so we don't have to re-invent it from scratch. Basically you have to edit the line
Code: [Select]
cpgRedirectPage($redirect, $lang_login_php['login'], sprintf($lang_login_php['welcome'], $USER_DATA['user_name']).$pending_approvals, 3, 'success');in login.php.
Logged

gateway_46806

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Welcome Username
« Reply #2 on: February 08, 2013, 04:37:14 am »

Since I don't have a hosted site, I have attached a copy of cpg1.2.0_final
with the example of using first_name instead of user_name in the login and logout.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Welcome Username
« Reply #3 on: February 08, 2013, 09:27:50 am »

Unfortunately that doesn't help much. What exactly should be displayed as welcome message?
Logged

gateway_46806

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Welcome Username
« Reply #4 on: February 10, 2013, 04:29:01 am »

At different times, I will require something other than the user_name for the welcome and the parting statements.
Logged

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4885
    • Windsurf.me
Re: Welcome Username
« Reply #5 on: February 10, 2013, 05:25:27 pm »

You need to be as detailed as you can. We need exact details if we are to come up with come code for you. Al link to the modification on this site would also help. If you cannot provide that then maybe hire a freelancer to code it for you.
Logged
It is a mistake to think you can solve any major problems just with potatoes.

gateway_46806

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Welcome Username
« Reply #6 on: February 10, 2013, 06:14:35 pm »

Andre suggested, "edit the line
Code: [Select]
'cpgRedirectPage($redirect, $lang_login_php['login'], sprintf($lang_login_php['welcome'], $USER_DATA['user_name']).$pending_approvals, 3, 'success');". I have tried adding a field in cpg15x_users of first_name and calling $USER_DATA['first_name'] in the login and calling stripslashes(FIRST_NAME) in the logout,
Code: [Select]
cpgRedirectPage('index.php', $lang_logout_php['logout'], sprintf($lang_logout_php['bye'], stripslashes(USER_NAME)), 3);. Calling 'first_name' or 'FIRST_NAME' doesn't produce anything.

To my knowledge, there isn't a link to the modification for cpg15x. Since I don't have a hosted site to provide a hyperlink, I have attached a copy of cpg1.2.0_final
with the example of using first_name instead of user_name in the login and logout. Something in addition to Andre's suggestion needs to be implemented for cpg15x.
« Last Edit: February 11, 2013, 09:40:44 pm by Jeff Bailey »
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Welcome Username
« Reply #7 on: February 10, 2013, 07:35:19 pm »

Open login.php, find
Code: [Select]
        cpgRedirectPage($redirect, $lang_login_php['login'], sprintf($lang_login_php['welcome'], $USER_DATA['user_name']).$pending_approvals, 3, 'success');and replace with
Code: [Select]
        $first_name = mysql_result(cpg_db_query("SELECT first_name FROM {$CONFIG['TABLE_USERS']} WHERE user_id = ".USER_ID." LIMIT 1"), 0);
        cpgRedirectPage($redirect, $lang_login_php['login'], sprintf($lang_login_php['welcome'], $first_name).$pending_approvals, 3, 'success');
Logged

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4885
    • Windsurf.me
Re: Welcome Username
« Reply #8 on: February 10, 2013, 08:40:32 pm »



To my knowledge, there isn't a link to the modification for cpg15x. Since I don't have a hosted site to provide a hyperlink, I have attached a copy of cpg1.2.0_final
with the example of using first_name instead of user_name in the login and logout.

I was hoping you had a link to an earlier version, for 1.2, 1.3 or 1.4

If Andre's suggestion doesn't do what you want then maybe see if you can find the original mod.
Logged
It is a mistake to think you can solve any major problems just with potatoes.
Pages: [1]   Go Up
 

Page created in 0.026 seconds with 21 queries.