#531 (bug) - Pelorous.Publishing.clearCookies not clearing everything
#535 (bug) - Insert/edit hyper link not working
#536 (bug) - Update search indexes to only include files if they are
included in the what to search list
#8 (new feature) - Integrate standalone photo galleries into site manger
Requires following SQL update (photo_galleries module):

INSERT INTO site_sectionContent (`sectionId`, `module`, `itemId`,
`name`, `contentContainerId`, `maxItems`, `position`, `createdDate`,
`createdBy`)
SELECT s.sectionId, 'photo_galleries', i.itemId, 'photos',
cc.contentContainerId,  1,  COUNT(sc.sectionContentId) + 1,  NOW(), 	
'system' 
  FROM photos_photoGallery p
       INNER JOIN
       site_itemLookup il ON il.name='photoGalleryId' and
il.value=p.photoGalleryId
       INNER JOIN
       site_item i ON i.itemId=il.itemId AND
i.handler='Pelorous_PhotoGallery'
       LEFT JOIN
       site_section s ON s.sectionId=p.sectionId
       LEFT JOIN
       site_contentContainer cc ON cc.`primary`=1
       LEFT JOIN
       site_sectionContent sc ON sc.sectionId=s.sectionId
 WHERE p.deleted=0
 GROUP BY s.sectionId;

ALTER TABLE `photos_photoGallery`
 ADD COLUMN `sectionContentId` INT UNSIGNED NOT NULL DEFAULT 0  AFTER
`photoGalleryId`,
 ADD INDEX `sectionContentId_idx` (`sectionContentId` ASC);

UPDATE `photos_photoGallery` p SET `sectionContentId`=
(SELECT sc.sectionContentId
  FROM `site_sectionContent` sc
       INNER JOIN
       `site_item` i ON i.itemId=sc.itemId AND
i.handler='Pelorous_PhotoGallery'
       INNER JOIN
       `site_itemLookup` il ON il.name='photoGalleryId' and
il.itemId=i.itemId
 WHERE sc.deleted=0 AND il.value=p.photoGalleryId);

ALTER TABLE `photos_photoGallery` DROP COLUMN `sectionId`;

ALTER TABLE `photos_file` ADD COLUMN `mimeType` VARCHAR(64) NULL  AFTER
`originalName`,
 ADD COLUMN `size` INT UNSIGNED NOT NULL DEFAULT 0 AFTER `mimeType`,
 ADD COLUMN `uploadRef` VARCHAR(255) NULL  AFTER `size`,
 ADD COLUMN `chunk` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 0  AFTER
`uploadRef`,
 ADD COLUMN `chunks` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 0  AFTER
`chunk`,
 ADD COLUMN `uploadLastUpdate` DATETIME NOT NULL DEFAULT '0000-00-00
00:00:00' AFTER `chunks`,
 ADD COLUMN `uploadComplete` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0
AFTER `uploadLastUpdate`,
 ADD COLUMN `position` INT(10) UNSIGNED NOT NULL DEFAULT 1  AFTER
`uploadComplete`,
 ADD INDEX `uploadRef_idx` (`uploadRef` ASC),
 ADD INDEX `uploadComplete_idx` (`uploadComplete` ASC);

UPDATE `photos_file` SET uploadComplete=1;

REPLACE INTO photos_file (`fileId`, `albumId`, `originalName`,
`mimeType`, `size`, `uploadRef`, `chunk`, 
    `chunks`, `uploadLastUpdate`, `uploadComplete`, `metaData`,
`position`)
SELECT `f`.`fileId`, `f`.`albumId`, `f`.`originalName`, `f`.`mimeType`,
`f`.`size`, 
	`f`.`uploadRef`, `f`.`chunk`, `f`.`chunks`, `f`.`uploadLastUpdate`, 
	`f`.`uploadComplete`, `f`.`metaData`, 
	COUNT(f2.fileId) + 1
   from photos_file f
        left join 
        photos_file f2 on f2.albumId=f.albumId and f2.fileId<f.fileId
 GROUP BY f.fileId;


REPLACE INTO `site_sectionContent`
 (`sectionContentId`, `aliasedSectionContentId`, `sectionId`,
`contentContainerId`, `module`, `moduleId`,
  `itemId`, `name`, `domId`, `alternativeLayoutId`, `developerOnly`,
`menu`, `multiItems`, `maxItems`, `allowInheritance`,
  `restrictBySite`, `ajaxLoad`, `position`, `numItems`, `createdDate`,
`createdBy`, `deleted`, `deletedDate`, `deletedBy`)

SELECT 
  `sc`.`sectionContentId`, `sc`.`aliasedSectionContentId`,
`sc`.`sectionId`, `sc`.`contentContainerId`, 
  `sc`.`module`, `sc`.`moduleId`, `sc`.`itemId`, `sc`.`name`,
`sc`.`domId`, `sc`.`alternativeLayoutId`, 
  `sc`.`developerOnly`, `sc`.`menu`, `sc`.`multiItems`, 0,
`sc`.`allowInheritance`,
  `sc`.`restrictBySite`, `sc`.`ajaxLoad`, `sc`.`position`,
COUNT(pa.albumId), `sc`.`createdDate`, 
  `sc`.`createdBy`, `sc`.`deleted`, `sc`.`deletedDate`, `sc`.`deletedBy`
  FROM `site_sectionContent` AS `sc`
       INNER JOIN
	   `photos_photoGallery` `pg` ON
`pg`.`sectionContentId`=`sc`.`sectionContentId`
       INNER JOIN
	   `photos_album` `pa` ON `pa`.`photoGalleryId`=`pg`.`photoGalleryId`
 WHERE `pa`.`deleted`=0
 GROUP BY `sc`.`sectionContentId`;