Incomplete Album Name & Incomplete Upload Name - SOLVED Incomplete Album Name & Incomplete Upload Name - SOLVED
 

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

Incomplete Album Name & Incomplete Upload Name - SOLVED

Started by jdbaranger, October 18, 2003, 04:52:21 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jdbaranger

Hello !

This is a wonderfull program, so i've upgraded to RC2 version last week, but i've a problem : The album name is incomplete for all new uploads : field owner_name keeps empty in table cpg_pictures when i do new uploads. This is my question :

Which modifications should i do to make the field owner_name be completed in the table Pictures, so that the Owner Name can appear in front of Album Name

This is a fonctionality i really miss

Thanks a lot

Jean-Denis
Jean-Denis

hyperion

"Then, Fletch," that bright creature said to him, and the voice was very kind, "let's begin with level flight . . . ."

-Richard Bach, Jonathan Livingston Seagull

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.mozilla.org%2Fproducts%2Ffirefox%2Fbuttons%2Fgetfirefox_small.png&hash=9f6d645801cbc882a52f0ee76cfeda02625fc537)

jdbaranger

No, i've no problem with comments. Let me descibe my problem :

When a user TOTO uploads a file in a gallery GALLERY1, the Album Name sould be TOTO / GALLERY1 in pages such as displayimage.php.

Actually, the Album Name is only GALLERY1 because the field owner_name in the table cpg_pictures is empty.

Where is the problem ? How coul'd i restore this function ?

Thanks,

Jean-Denis
Jean-Denis

irapeau


jdbaranger

More informations : The field owner_id is correct, but not the field owner_name.

Where are those fields completed ?

Coul'd someone have an answer ?  :idea:

Thanks ,

jean-Denis
Jean-Denis

jdbaranger

I finnaly find the answer.

In picmgmt.inc.php, search the following line :

$query = "INSERT INTO {$CONFIG['TABLE_PICTURES']} (pid, aid, filepath, filename, filesize, total_filesize, pwidth, pheight, ctime, owner_id, owner_name, title, caption, keywords, approved, user1, user2, user3, user4, pic_raw_ip, pic_hdr_ip) VALUES ('', '$aid', '" . addslashes($filepath) . "', '" . addslashes($filename) . "', '$image_filesize', '$total_filesize', '{$imagesize[0]}', '{$imagesize[1]}', '" . time() . "', '$user_id', '$title', '$caption', '$keywords', '$approved', '$user1', '$user2', '$user3', '$user4', '$raw_ip', '$hdr_ip')";
And replace it with these two lines :

$username=$USER_DATA['user_name'] ;
$query = "INSERT INTO {$CONFIG['TABLE_PICTURES']} (pid, aid, filepath, filename, filesize, total_filesize, pwidth, pheight, ctime, owner_id, owner_name, title, caption, keywords, approved, user1, user2, user3, user4, pic_raw_ip, pic_hdr_ip) VALUES ('', '$aid', '" . addslashes($filepath) . "', '" . addslashes($filename) . "', '$image_filesize', '$total_filesize', '{$imagesize[0]}', '{$imagesize[1]}', '" . time() . "', '$user_id', '$username' , '$title', '$caption', '$keywords', '$approved', '$user1', '$user2', '$user3', '$user4', '$raw_ip', '$hdr_ip')";


Maybe there's a more simple way but this one performs good result
Jean-Denis