diff options
author | Cash Costello <cash.costello@gmail.com> | 2010-10-29 11:28:00 +0000 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2010-10-29 11:28:00 +0000 |
commit | 9e0d8ea4aa08f6390c0f93f6466c2a101dffcbed (patch) | |
tree | 17599dbfb02929b524384dff386efa5a66b724cd /upgrades | |
parent | 893364a28955358ad259bfb75798560616ab3d49 (diff) | |
download | elgg-9e0d8ea4aa08f6390c0f93f6466c2a101dffcbed.tar.gz elgg-9e0d8ea4aa08f6390c0f93f6466c2a101dffcbed.tar.bz2 |
tags now support avatars on riverdashboard (but no longer support versions of Elgg < 1.7)
Diffstat (limited to 'upgrades')
-rw-r--r-- | upgrades/2010102801.php | 26 |
1 files changed, 26 insertions, 0 deletions
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 @@ +<?php +/** + * Convert river entries for tags to be tagger-tagee-annotation from + * image-tagee + */ + +$album_subtype_id = get_subtype_id('object', 'album'); + +global $DB_QUERY_CACHE, $DB_PROFILE, $ENTITY_CACHE, $CONFIG; +$query = "SELECT * FROM {$CONFIG->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); + } + } + } +} |