Index: avatar_selection.install =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/avatar_selection/Attic/avatar_selection.install,v retrieving revision 1.1.2.8.2.5 diff -u -p -r1.1.2.8.2.5 avatar_selection.install --- avatar_selection.install 13 May 2008 14:18:37 -0000 1.1.2.8.2.5 +++ avatar_selection.install 9 Jul 2008 22:54:43 -0000 @@ -155,3 +155,23 @@ function avatar_selection_update_3() { } return $ret; } + +/** + * Updates the avatar entry so it's just a filename, rather than a path + + * filename. + * + * @return + * Array to which query results will be added. + */ +function avatar_selection_update_4() { + $ret = array(); + + $result = db_query("SELECT avatar FROM {avatar_selection}"); + while ($avatar_info = db_fetch_object($result)) { + $avatar = $avatar_info->avatar; + $path_info = pathinfo($avatar); + $ret[] = update_sql("UPDATE {avatar_selection} SET avatar = '". $path_info['basename'] ."' WHERE avatar = '". $avatar ."'"); + } + + return $ret; +}