2
Alright... since no one noticed my post who could answer, I figured it out myself. If there's anything that will cause trouble down the line, please advise, but this seems to work properly.
Note that I'm not checking the return values because they will return 0 when there are no photos / comments to update.
This is from xoopsgallery/classes/AlbumDB.php, Line 89:
if (fs_is_dir("$dir/$oldName")) {
$success = fs_rename("$dir/$oldName", "$dir/$newName");
if (!$success) {
return 0;
}
$xoopsgalleryimage_handler =& xoops_getmodulehandler('image');
// Update xoopsgallery_image.image_albumdir with new album name
$sql = sprintf("UPDATE %s SET image_albumdir='%s' WHERE image_albumdir='%s'", $xoopsgalleryimage_handler->db->prefix('xoopsgallery_image'), $newName, $oldName);
$result = $xoopsgalleryimage_handler->db->queryF($sql);
// Update xoopscomments.com_extraparams with new album name
$sql = sprintf("UPDATE %s SET com_exparams=REPLACE(com_exparams, 'albumName=%s&', 'albumName=%s&') WHERE com_exparams LIKE '%%albumName=%s%%' AND com_modid=%d", $xoopsgalleryimage_handler->db->prefix('xoopscomments'), $oldName, $newName, $oldName, $GLOBALS['xoopsModule']->getVar('mid'));
$result = $xoopsgalleryimage_handler->db->queryF($sql);
}