Photo shop in intranet Photo shop in intranet
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Photo shop in intranet

Started by wkpoon, June 06, 2007, 09:35:32 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

wkpoon

I had just build a intranet photo album and install the Photo Shop plugin 1.3.4, I use the staff no. as a login name and store the user name in the profile1 field. Please tell me how to show the user name in the login welcome window and the logout icon in the main widow instead of staff no. And, in the notice  mail to admin and user when user made an order of photos.

Stramm

in photo_shop_checkout.php find the function photoshop_email_the_user
user_profile1
within that function replace
'{USER_NAME}' => (USER_NAME),
and replace with
'{USER_NAME}' => $user_info['user_profile1'],

the {USER_NAME} placeholder in the confirmation email now should be replaced with the profile1 field

your first question isn't related to the plugin

wkpoon

Quote from: Stramm on June 06, 2007, 10:22:41 AM
in photo_shop_checkout.php find the function photoshop_email_the_user
user_profile1
within that function replace
'{USER_NAME}' => (USER_NAME),
and replace with
'{USER_NAME}' => $user_info['user_profile1'],

the {USER_NAME} placeholder in the confirmation email now should be replaced with the profile1 field

your first question isn't related to the plugin
It really works, thanks a lot !!!! :)

Joachim Müller

In the future, don't double-post - it causes extra moderation effort, and you wasted the time of two supporters. Use better subject lines in the future. Identical request "Profile1 display as user name in welcome screen". Flagging the other thread accordingly and locking it. Taking karma.

Sami

#4
As stramm suggested your 1st question isn't related to this plugin but I'm going to answer it here anyway !
And here is your 1st question's answer ,

You can put user's real name to $USER_DATA array but it needs some core mod.
lets try this ,

- Edit {gallery_root}/bridge/coppermine.inc.php
go to line #83 (after user_group's field name definition ) and add code below to field array


                        'realname' => 'user_profile1', // name of 'real_name' field in users table


You are done with coppermine.inc.php , save and close !

- Edit {gallery_root}/bridge/udb_base.inc.php
go to line #56 and change it from this


$sql = "SELECT u.{$f['user_id']} AS id, u.{$f['username']} AS username, u.{$f['password']} AS password, ug.{$f['usertbl_group_id']} AS group_id ".


to this


$sql = "SELECT u.{$f['user_id']} AS id, u.{$f['username']} AS username, u.{$f['password']} AS password, u.{$f['realname']} AS real_name, ug.{$f['usertbl_group_id']} AS group_id ".


go to line #60 and change it from this


$sql = "SELECT u.{$f['user_id']} AS id, u.{$f['username']} AS username, u.{$f['password']} AS password, u.{$f['usertbl_group_id']}+100 AS group_id ".


to this


$sql = "SELECT u.{$f['user_id']} AS id, u.{$f['username']} AS username, u.{$f['password']} AS password, u.{$f['realname']} AS real_name, u.{$f['usertbl_group_id']}+100 AS group_id ".


go to line #101 and add this


        define('USER_RNAME', $USER_DATA['real_name']);



go to line #146 and add this (to load_user_data function )


$USER_DATA['real_name'] = $row['real_name'];


You are done with udb_base.inc.php  too,

- Now you just need to add

$USER_DATA['real_name']


or


USER_RNAME


when ever you need user's real name
‍I don't answer to PM with support question
Please post your issue to related board

wkpoon

I do modify the code as you state and change the code in login.php in line #40 to


msg_box($lang_login_php['login'], sprintf($lang_login_php['welcome'], $USER_DATA['real_name']), $lang_continue,

and the Welcome screen displace only with Weclcome ... . Not the user name in profile1 can be display. Is there anything go wrong?

Sami

#6
sorry that was my mistake , there was a missing part (adding new line to load_user_data function on udb_base.php)
now code should works

But if you want to have user real_name only on login.php then it's different story
you should only edit {gallery_root}/bridge/coppermine.inc.php (and nothing else)

go to line #120 and change this


                $sql =  "SELECT user_id, user_name, user_password FROM {$this->usertable} WHERE ";


to this


                $sql =  "SELECT user_id, user_name, user_password, user_profile1 as real_name FROM {$this->usertable} WHERE ";
‍I don't answer to PM with support question
Please post your issue to related board

wkpoon

Thanks for your help and now I can show user name in profile1 on welcome screen. But in the main window, it show Logout [staff no.] not Logout [profile1] anything that I can do?

And do I resume the modification on {gallery_root}/bridge/coppermine.inc.php line #83 and {gallery_root}/bridge/udb_base.inc.php line #56 #60 #146 back to orginal ?



Sami

Quote from: wkpoon on June 07, 2007, 08:05:40 AM
And do I resume the modification on {gallery_root}/bridge/coppermine.inc.php line #83 and {gallery_root}/bridge/udb_base.inc.php line #56 #60 #146 back to orginal ?

If you want to use $USER_DATA['real_name'] on other pages then you should keep those changes (I've edited my 1st post ,code added to line 101 of udb_base.php)

Now you want user's real name (USER_RNAME) on logout button
to accomplish this you need to mod. theme_main_menu function

- Check if you have that function on {gallery-root}\themes\yourtheme\theme.php , if you don't copy & paste it from {gallery-root}\themes\sample\theme.php

- Find this


        '{LOGOUT_LNK}' => $lang_main_menu['logout_lnk'] . " [" . USER_NAME . "]",


and change it to this


        '{LOGOUT_LNK}' => $lang_main_menu['logout_lnk'] . " [" . USER_RNAME . "]",
‍I don't answer to PM with support question
Please post your issue to related board

wkpoon

Thanks for your help, I can now had the profile1 display in welcom screen as well as in the Logout icon. But something stange that when I click Logout icom and the staff no. still appear in the logout screen as Bye staff no. ..... Anything I was miss to type in ?

Sami

Edit {gallery-root}/logout.php and change this:


msg_box($lang_logout_php['logout'], sprintf($lang_logout_php['bye'], stripslashes(USER_NAME)), $lang_continue, $referer);


to this


msg_box($lang_logout_php['logout'], sprintf($lang_logout_php['bye'], stripslashes(USER_RNAME)), $lang_continue, $referer);
‍I don't answer to PM with support question
Please post your issue to related board

wkpoon

All my post problem solved !!! Thanks all those give me a hand to solve the problem !!!!!