[Solved]: Who can I modify Item ID in photo shop plug in? [Solved]: Who can I modify Item ID in photo shop plug in?
 

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

[Solved]: Who can I modify Item ID in photo shop plug in?

Started by friisco, May 06, 2008, 02:10:51 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

friisco

hello!!!
I am doing a photo gallery and I did install the photo shop plug in and modified a lot of things but I can´t find out how to change the Item ID (that is set to display the pos= -) from the order mail to a 'title' or caption?
The Item ID is not especific to a product and can cause problems whith orders.
Can somebody say to me if it is possible and help me if is possible???

Thanks a lot! ;)

Stramm

I'm not sure if I understand what you mean! If you do not want the pid (what you call item id) to display you'll have to look through the code... but it's there to help you not to get problems with your orders as title or description are not unique. But the pid is. Each picture has a unique pid (picture id).
Don't mix that up with the relative addresing. This is not distinct. You can see that in the url with no minus (pos=xxx). The unique addressing with the pid uses (pos=-xxx) (note the minus - )

friisco

What I would like to do is to have a description of the pictures as a extra info to be displayed in the order mail. I understand that the pid is a unique but doesn´t describe what it is as I want. The orders will go to someone that will redirect e mails and will be a bit complicated if they have to check each pic id to send the order futher and add text to especify the product info.
Anyway... What I am thinking is to make a similar thing as is displayed in the e-card where the caption is showing when you send the e -card .
I am a bit afraid to mess with codes... I can remore or change a bit of the codes that will be displayed but I don´t know with this plug in what should I do...
I know that in e card the caption comes with:
'{PIC_CAPTION}'
'pc' => $pic_caption,

can you help me so I can place the right code in the right place and things work fine???

Thanks a lot!!! ;)

Stramm


friisco

I did test and modify to 'filename' amd works but isn´t what I really want... so I tried:

$out['text'].= sprintf("%10.10s\t", $pic_caption['pc']).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);


but I got nothind this time!!! The item id is empty.

Is that right to add this: $pic_caption['pc']?
or maybe I should put that code somewhere else also???

Please help me!!!
Thanks a lot!!! ;)

Stramm

it's wishful thinking to grab variables/ array names from other files...

First you need to check if the necessary data is available in checkout. Initially the data's stored in the pictures table.
Few lines above where you do your tries you'll find
$select_columns = 'filepath, filename, url_prefix, filesize, pwidth, pheight, ctime, title, aid';

that variable holds the culumns the following query will get from the pictures table. You'll see the title, but no caption. If you need it, add it there. The exact name for the caption you'll find if you browse the database with a tool like phpmayadmin. In this case it's by accident 'caption' as well.

If you've done that, then you can examine the query and see where it saves the data and how it's processed.
    $result = cpg_db_query("SELECT $select_columns from {$CONFIG['TABLE_PICTURES']} WHERE pid='{$item_id['pid']}' LIMIT 1");
    $row = mysql_fetch_array($result);

the array $row holds all the data we want.
eg. $row['filename'] caontains the filename, $row['caption'] the caption

friisco

ok.. I did add caption to this line:

$select_columns = 'filepath, filename, url_prefix, filesize, pwidth, pheight, ctime, title, aid, caption';


then I tried:
$result = cpg_db_query("SELECT $select_columns from {$CONFIG['TABLE_PICTURES']} WHERE pid='{$row['caption']}' LIMIT 1");


and:
$result = cpg_db_query("SELECT $select_columns from {$CONFIG['TABLE_PICTURES']} WHERE caption='{$row['caption']}' LIMIT 1");


but I get this message in check out:
Critical error
There was an error while processing a database query


What I am doing wrong?

Sorry for that!!!

Would be nice if you can tell me what is wrong!!!

Thanks

Stramm

you do not modify
    $result = cpg_db_query("SELECT $select_columns from {$CONFIG['TABLE_PICTURES']} WHERE pid='{$item_id['pid']}' LIMIT 1");
This grabs the data from the db... and it now gets a lil bit more now, the caption

$row['filename'] or $row['caption'] (depending on what you want) you use instead of your made up $pic_caption['pc']

friisco

Works....
But the shows only some letters like this:

Item ID              Type       Amount       Price total
Style numb               Box            1         DK 100.00

and it is supose to show the style number like this:
Style number: 46594030

What should I do? I have to add more space somehow or the number(that´s the date that I type) will not show?

thanks a lot for your help...

Stramm


friisco

Ok... I did look after your link and that is a bit greek for me !!! I need time to trie to figure it out!!!
Sorry that much questions... but what is happening is that I have a big project to delivery for a company in 3 days and I am far to finish... I need to fix this functionality for order control of the company . Can you maybe give me another link from other users that had similar problems??? I think I saw somewhere around the forum when i was searching information but I can´t find anymore!!!!

Please...

Thank´s :-\

Stramm

You probably have read about that in the link I've given above. Afaik that's the only similar question.

friisco

I did fix... Thank´s a lot for the information!!!!