forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 plugins => Topic started by: wkpoon on June 11, 2007, 08:11:16 am

Title: display the profile1 in the Photo Shop order list
Post by: wkpoon on June 11, 2007, 08:11:16 am
As I store user name in profile1, please kindly tell how to display the profile1 in the photo shop order list.
Title: Re: display the profile1 in the Photo Shop order list
Post by: Stramm on June 11, 2007, 09:20:43 am
in photo_shop_admin.php (update with the todays release before you start modding)

find
Code: [Select]
$sql = "SELECT s.*, u.{$udb_var['field']['username']}, u.{$udb_var['field']['email']}  FROM {$CONFIG['TABLE_SHOP']} AS s LEFT JOIN {$udb_var['usertable']} as u ON u.{$udb_var['field']['user_id']} = s.uid WHERE aktive=".$box." AND cd=1 ORDER BY ". $sort_codes[$sort] ." LIMIT $lower_limit, $orders_per_page";
and replace with
Code: [Select]
$sql = "SELECT s.*, u.*  FROM {$CONFIG['TABLE_SHOP']} AS s LEFT JOIN {$udb_var['usertable']} as u ON u.{$udb_var['field']['user_id']} = s.uid WHERE aktive=".$box." AND cd=1 ORDER BY ". $sort_codes[$sort] ." LIMIT $lower_limit, $orders_per_page";

find
Code: [Select]
$sql = "SELECT s.*, u.{$udb_var['field']['username']}, u.{$udb_var['field']['email']}  FROM {$CONFIG['TABLE_SHOP']} AS s LEFT JOIN {$udb_var['usertable']} as u ON u.{$udb_var['field']['user_id']} = s.uid WHERE oid=".$oid." AND cd=1 LIMIT 1";
replace with
Code: [Select]
$sql = "SELECT s.*, u.*  FROM {$CONFIG['TABLE_SHOP']} AS s LEFT JOIN {$udb_var['usertable']} as u ON u.{$udb_var['field']['user_id']} = s.uid WHERE oid=".$oid." AND cd=1 LIMIT 1";

find
Code: [Select]
$user_name[] = $i['user_name'];
replace with
Code: [Select]
$user_name[] = $i['user_profile1'];

find
Code: [Select]
<span style="cursor:pointer" onclick="window.location='profile.php?uid={$row['uid']}';">{$row['user_name']}</span> -
replace with
Code: [Select]
<span style="cursor:pointer" onclick="window.location='profile.php?uid={$row['uid']}';">{$row['user_profile1']}</span> -


at your own risk, no guarantees
Title: Re: display the profile1 in the Photo Shop order list
Post by: wkpoon on June 12, 2007, 10:09:16 am
Thanks for your code and I will test on my test website, but one more importance thing that I found the item id is the same as the pid could it be possible to display the file name in the email notice instead of pid ?
Title: Re: display the profile1 in the Photo Shop order list
Post by: Stramm on June 13, 2007, 12:49:48 pm
pretty easy, in photo_shop_checkout.php find
Code: [Select]
$out['text'].= sprintf("%10.10s\t", $item_id['pid']).sprintf("%15.15s\t", $SHOP_CONFIG[$item_id['id']]['name']).sprintf("%10.10s\t", $item_id['amount']).sprintf("%15.15s\n",$lang_photoshop['USD'].' '.$price);

here just replace
Code: [Select]
$item_id['pid']with
Code: [Select]
$row['filename']
however you'll most probably won't see the entire filename (if it's a long one). Read in the php manual more about the sprintf command to format the output like you need it. You also may want to format the header in a similar way and replace 'Item ID with 'Filename'.
Title: Re: display the profile1 in the Photo Shop order list
Post by: wkpoon on June 14, 2007, 03:27:25 am
That wonderful !! really thanks for your help !
I had try to download the latest photo shop 1.3.5 both in office and home but was failed with the same error "404" and I did clear all cache cookie and everything in both IE and Firfox could it be possible to post the photo shop to sourceforce as the previous version

Thanks
with regard
Title: Re: display the profile1 in the Photo Shop order list
Post by: Joachim Müller on June 14, 2007, 08:43:54 am
I had try to download the latest photo shop 1.3.5 both in office and home but was failed with the same error "404" and I did clear all cache cookie and everything in both IE and Firfox could it be possible to post the photo shop to sourceforce as the previous version
You already have started a thread where you reported that you can't download the plugin (http://forum.coppermine-gallery.net/index.php?topic=44451.0). Don't cross-post!
Is the issue discussed in this thread solved? Resolve your threads!
Title: Re: display the profile1 in the Photo Shop order list
Post by: wkpoon on June 15, 2007, 05:27:41 am
After download the latest photo shop and change the code, the profile1 can now be display on order list.

Thanks a lot !!