From a1f08342c8b8502197159a9fd78e48e6cead4ea0 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 31 Jul 2010 19:22:47 +0000 Subject: improved the upgrade system and moved albums to use an ordered list for images --- upgrades/2009082901.php | 29 +++++++++++++++++++++++++++++ upgrades/2010073101.php | 22 ++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 upgrades/2009082901.php create mode 100644 upgrades/2010073101.php (limited to 'upgrades') diff --git a/upgrades/2009082901.php b/upgrades/2009082901.php new file mode 100644 index 000000000..dfbdf79f4 --- /dev/null +++ b/upgrades/2009082901.php @@ -0,0 +1,29 @@ +dbprefix . 'entity_subtypes'; + $result = update_data("UPDATE {$table} set class='TidypicsImage' where id={$id}"); + if (!$result) { + register_error('unable to update tidypics image class'); + } +} + +// add album class +$id = get_subtype_id("object", "album"); +if ($id != 0) { + $table = $CONFIG->dbprefix . 'entity_subtypes'; + $result = update_data("UPDATE {$table} set class='TidypicsAlbum' where id={$id}"); + if (!$result) { + register_error('unable to update tidypics album class'); + } +} diff --git a/upgrades/2010073101.php b/upgrades/2010073101.php new file mode 100644 index 000000000..20fd33144 --- /dev/null +++ b/upgrades/2010073101.php @@ -0,0 +1,22 @@ +dbprefix}entities WHERE subtype = $album_subtype_id"); +while ($guid_obj = mysql_fetch_object($album_guids)) { + $DB_QUERY_CACHE = $DB_PROFILE = $ENTITY_CACHE = array(); + + $album = get_entity($guid_obj->guid); + $images = get_entities("object", "image", $album->guid, '', 9999); + $image_list = array(); + foreach ($images as $image) { + $image_list[] = $image->guid; + } + + $album->prependImageList($image_list); +} + -- cgit v1.2.3