I just tried to use this but it didn't work...
Coppermine version 1.3.5 downloaded tonight from sourceforge.
Gallery2.0 final version downloaded tonight.
I found when making the changes to picmgmt.inc.php that the lines didn't quite match. In the first instance, it says the line will be
function add_picture($aid, $filepath, $filename, $position = 0, $title = '', $caption = '', $keywords = '', $user1 = '', $user2 = '', $user3 = '', $user4 = '', $category = 0, $raw_ip = '', $hdr_ip = '')
but it was really
function add_picture($aid, $filepath, $filename, $title = '', $caption = '', $keywords = '', $user1 = '', $user2 = '', $user3 = '', $user4 = '', $category = 0, $raw_ip = '', $hdr_ip = '',$iwidth=0,$iheight=0)
In this case I just replaced the old line with the new line.
For the second replacement, it says it will be
$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, position) VALUES ('', '{$CURRENT_PIC_DATA['aid']}', '" . addslashes($CURRENT_PIC_DATA['filepath']) . "', '" . addslashes($CURRENT_PIC_DATA['filename']) . "', '{$CURRENT_PIC_DATA['filesize']}', '{$CURRENT_PIC_DATA['total_filesize']}', '{$CURRENT_PIC_DATA['pwidth']}', '{$CURRENT_PIC_DATA['pheight']}', '" . time() . "', '{$CURRENT_PIC_DATA['owner_id']}', '{$CURRENT_PIC_DATA['owner_name']}','{$CURRENT_PIC_DATA['title']}', '{$CURRENT_PIC_DATA['caption']}', '{$CURRENT_PIC_DATA['keywords']}', '{$CURRENT_PIC_DATA['approved']}', '{$CURRENT_PIC_DATA['user1']}', '{$CURRENT_PIC_DATA['user2']}', '{$CURRENT_PIC_DATA['user3']}', '{$CURRENT_PIC_DATA['user4']}', '{$CURRENT_PIC_DATA['pic_raw_ip']}', '{$CURRENT_PIC_DATA['pic_hdr_ip']}', '{$CURRENT_PIC_DATA['position']}')";
but it was actually
$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', '" . addslashes($title) . "', '" . addslashes($caption) . "', '" . addslashes($keywords) . "', '$approved', '$user1', '$user2', '$user3', '$user4', '$raw_ip', '$hdr_ip')";
In this instance I noticed that the only change was the two added instances of "hits" so I just added them to the original code as they appeared in the new line.
I have no logical basis for those decisions, I'm just trying stuff because I don't know php :\'(
The script appeared to work up to the point where I selected an album to import. After that, I got the following error:
Album directory Members_ created...
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/mlparena/public_html/cpg135/import_gallery2.php on line 154
Warning: mysql_insert_id(): supplied argument is not a valid MySQL-Link resource in /home/mlparena/public_html/cpg135/import_gallery2.php on line 158
Warning: mysql_free_result(): 18 is not a valid MySQL result resource in /home/mlparena/public_html/cpg135/import_gallery2.php on line 159
Album created...
Importing images
Q: SELECT i.*, fs.g_pathComponent, ia.g_viewCount FROM g2_Item i, g2_ChildEntity ce, g2_FileSystemEntity fs, g2_ItemAttributesMap ia WHERE ce.g_id = i.g_id AND i.g_id = fs.g_id AND ia.g_itemId = i.g_id AND ce.g_parentId = '10' AND i.g_canContainChildren = 0
Warning: Cannot modify header information - headers already sent by (output started at /home/mlparena/public_html/cpg135/import_gallery2.php:47) in /home/mlparena/public_html/cpg135/themes/classic/theme.php on line 810
Warning: Cannot modify header information - headers already sent by (output started at /home/mlparena/public_html/cpg135/import_gallery2.php:47) in /home/mlparena/public_html/cpg135/themes/classic/theme.php on line 811
Warning: Cannot modify header information - headers already sent by (output started at /home/mlparena/public_html/cpg135/import_gallery2.php:47) in /home/mlparena/public_html/cpg135/include/functions.inc.php on line 51
Not sure what to do but I'm willing to try if you have any suggestions. I'd really like to be able to do this.
BTW, is there a converter for gallery 1.5 to coppermine?