From 9e0d8ea4aa08f6390c0f93f6466c2a101dffcbed Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Fri, 29 Oct 2010 11:28:00 +0000 Subject: tags now support avatars on riverdashboard (but no longer support versions of Elgg < 1.7) --- upgrades/2010102801.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 upgrades/2010102801.php (limited to 'upgrades/2010102801.php') diff --git a/upgrades/2010102801.php b/upgrades/2010102801.php new file mode 100644 index 000000000..9190912fe --- /dev/null +++ b/upgrades/2010102801.php @@ -0,0 +1,26 @@ +dbprefix}river WHERE view = 'river/object/image/tag'"; +$river_items = mysql_query($query); +while ($item = mysql_fetch_object($river_items)) { + $DB_QUERY_CACHE = $DB_PROFILE = array(); + + // find the annotation for this river item + $annotations = get_annotations($item->subject_guid, '', '', 'phototag', '', 0, 999); + foreach ($annotations as $annotation) { + $tag = unserialize($annotation->value); + if ($tag->type === 'user') { + if ($tag->value == $item->object_guid) { + $update = "UPDATE {$CONFIG->dbprefix}river SET subject_guid = $annotation->owner_guid, annotation_id = $annotation->id where id = $item->id"; + mysql_query($update); + } + } + } +} -- cgit v1.2.3