Could I migrate WPG2 tag to WPG2ID tag ?

dennys
dennys's picture

Joined: 2003-08-24
Posts: 32
Posted: Sun, 2007-12-09 00:34

Original I use WPG2 tag before, but I changed to use WPG2ID now and I see the post http://gallery.menalto.com/node/69294, WPG2 tag is not an option anymore.

So, is there any way to migrate the WPG2 tag to WPG2ID tag ? I know WPG2 still has backwards compatibility, but I need to change my G2 structure and WPG2 tag may broken.

http://dennys.tiger2.net/

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Sun, 2007-12-09 16:28

I think you misunderstood my post on G2Image. We got rid of the option to insert wpg2id tags, because we combined the functionality of wpg2id tags into the wpg2 tags. We retained the logic that processes wpg2id tags for backwards compatibility, but g2image will not insert wpg2id tags anymore.

So, no need to change anything on your wpg2 tags.

Kirk
____________________________________
G2Image Documentation, G2Image Demo Page, My Family Website

 
dennys
dennys's picture

Joined: 2003-08-24
Posts: 32
Posted: Sun, 2007-12-16 15:55

Thanks, I know I can still use wpg2, but there are 2 reasons to migrate. 1. The directory structure of my Gallery may be changed 2. I plan to migrate my wordpress to Drupal. I checked the gallery module of drupal (http://drupal.org/project/gallery), if I migrate to use WPG2ID, it easy to migrate to Drupal (only change "WPG2" to "G2:" tag).

Any way, I have a ugly solution for it. This SQL can get the mapping for the path v.s. gallery id. My plan is to use a replace tool to replace all these outputs. I'm still checking this SQL, it seems ok if the depth of the directory is less or equal than 5 levels.

select
concat(
case
when f5.g_pathComponent is null then ''
else concat(f5.g_pathComponent, '/')
end,
case
when f4.g_pathComponent is null then ''
else concat(f4.g_pathComponent, '/')
end,
case
when f3.g_pathComponent is null then ''
else concat(f3.g_pathComponent, '/')
end,
case
when f2.g_pathComponent is null then ''
else concat(f2.g_pathComponent, '/')
end,
case
when f1.g_pathComponent is null then ''
else concat(f1.g_pathComponent)
end
) URL,
c1.g_id
#,f5.g_pathComponent, f4.g_pathComponent, f3.g_pathComponent, f2.g_pathComponent, f1.g_pathComponent, c1.*, c2.*, c3.*
from g2_ChildEntity c1
left join g2_FileSystemEntity f1
on c1.g_id = f1.g_id
left join g2_FileSystemEntity f2
on c1.g_parentId = f2.g_id
left join g2_ChildEntity c2
on c1.g_parentId = c2.g_id
left join g2_FileSystemEntity f3
on c2.g_parentId = f3.g_id
left join g2_ChildEntity c3
on c2.g_parentId = c3.g_id
left join g2_FileSystemEntity f4
on c3.g_parentId = f4.g_id
left join g2_ChildEntity c4
on c3.g_parentId = c4.g_id
left join g2_FileSystemEntity f5
on c4.g_parentId = f5.g_id
where f1.g_pathComponent is not null
;

The output is like:
URL G_ID
======================================= ====
Bowl-Cake/bean-curd-sauce/IMG_0086.jpg 0001
Bowl-Cake/bean-curd-sauce/IMG_0085.jpg 0002
Bowl-Cake/bean-curd-sauce/IMG_0084.jpg 0003
Collection-of-CPU/IMG_0532.jpg 0004
Foliage-Plant/IMG_0560.jpg 0005

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Mon, 2007-12-17 00:45

Just be aware the way we use the WPG2 Tag is going to be changed in WPG2 3.1 to store the characteristics of what we want the tag to do in the post metadata etc. We will be writing a migration tool which will be extracting a lot of this data including the removal of the wpg2id tags all together

___________________________________
Wordpress / Gallery2 (WPG2) Plugin, , WPG2 Documentation, WPG2 Demo