From f464b98a26cac9d2ec27b1f6ad249dc1074ff4fb Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 22 Aug 2009 15:51:56 +0000 Subject: move upgrade to actions - not a true registered action yet --- actions/upgrade.php | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 actions/upgrade.php (limited to 'actions') diff --git a/actions/upgrade.php b/actions/upgrade.php new file mode 100644 index 000000000..0ff04dadf --- /dev/null +++ b/actions/upgrade.php @@ -0,0 +1,38 @@ +dbprefix . 'entity_subtypes'; + $result = update_data("UPDATE {$table} set class='TidypicsImage' where id={$id}"); + if (!result) { + register_error(elgg_echo('tidypics:upgrade:failed')); + forward($_SERVER['HTTP_REFERER']); + } + } + + // 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(elgg_echo('tidypics:upgrade:failed')); + forward($_SERVER['HTTP_REFERER']); + } + } + + system_message(elgg_echo('tidypics:upgrade:success')); + + forward($_SERVER['HTTP_REFERER']); +?> \ No newline at end of file -- cgit v1.2.3