Is there a way to move photos from one gallery to another? If so, what is the proper procedure? It seems like the gallery treeview should list the photos contained in the galleries and allow drag and drop on photos as well as gallery folders. This is for CS 2007.
Gene
There is not currently a way to do this through the web UI. It may be possible update the SectionID on the GalleryPost object and update it or update the cs_Posts database table directly, however.
Ben,
Thanks for the reply. I'll check out the database angle. I would be nice to be able to do this from the UI.
Any success with the Database method? This really seems like a UI feature that should exist.
I was able to make the changes in the database without issues. I agree that there should be some way of doing this from the UI.
geneder: I was able to make the changes in the database without issues. I agree that there should be some way of doing this from the UI.
Would you mind to post the steps you used to do so? It would be a big help and save us from potentially messing up our galleries...especially if you have a working method.
- Whitney Roberts | My personal site - http://thechumbucket.org
I have found that moving a photo between galleries involves doing updates on the following database tables:
I have scripted a stored procedure that will do all the necessary steps as near as I can figure. This will move photos and any associated comments from one photo gallery to another. You will need direct access to your CommunityServer database. My backend is SQL Server 2005 and CS Personal/Developer version is 3.x, Edition 2. Things may be different for earlier or later versions. Here are the steps you need to take:
I have found that the moved photo may not appear to be moved immediately. There may be some caching going on but it does move eventually. You can check the 3 tables mentioned above to make sure that the database (SectionID) fields have been updated. Although this seems pretty straightforward, use this method at your own risk as it is based on my limited understanding of the database schema. It would be nice to get some comment from someone closer actual database design.
Hope this helps.
Here is the creation script for cs_Photo_Move:
USE [CommunityServer]GOSET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER OFFGO
CREATE PROCEDURE [dbo].[cs_Photo_Move]( @PostID int, @MoveToSectionID int)ASDECLARE @ThreadID INTDECLARE @SectionID INTDECLARE @ApplicationType INTDECLARE @ApplicationPostType INT
BEGIN TRANSACTION
-- First, get information about the post that is about to be moved.SELECT @ThreadID = ThreadID, @SectionID = SectionID, @ApplicationPostType = ApplicationPostTypeFROM cs_PostsWHERE PostID = @PostID
IF @@ERROR > 0 GOTO Error
--Get the new section ApplicationType
SELECT @ApplicationType = ApplicationTypeFROM cs_SectionsWHERE SectionID = @MoveToSectionID
--Check to see that the post is a photo and the MoveToSection is a gallery
IF (@ApplicationPostType != 64) OR (@ApplicationType != 2) GOTO SomethingWrong
--Update the Post to the new SectionID
UPDATE cs_PostsSET SectionID = @MoveToSectionIDWHERE ThreadID = @ThreadID
--Update the post attachments for this post
UPDATE cs_PostAttachmentsSET SectionID = @MoveToSectionIDWHERE PostID IN (SELECT PostID FROM cs_Posts WHERE ThreadID = @ThreadID)
--Update the threads for this post
UPDATE cs_ThreadsSET SectionID = @MoveToSectionIDWHERE ThreadID = @ThreadID
COMMIT TRANSACTION
GOTO TheEnd
SomethingWrong:
PRINT 'The PostID is not a photo or the MoveToSectionID is not a gallery'GOTO Error
TheEnd:
RETURN 0
Error:IF @@Trancount > 0 ROLLBACK TRANSACTION
RETURN -1
Copyright© 2008 Telligent Systems Inc. All rights reserved CommunityServer.com • Telligent.com