diff options
| author | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-10-11 22:05:36 +0000 |
|---|---|---|
| committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-10-11 22:05:36 +0000 |
| commit | dd2033ace0ccbb711406114777dc97a34c996bdc (patch) | |
| tree | d2fe2aeaa57c15e78d037af5966dbd605cec1040 /phpBB/develop | |
| parent | e2c755710fa55e69af45827c87547c687fefc1a4 (diff) | |
| download | forums-dd2033ace0ccbb711406114777dc97a34c996bdc.tar forums-dd2033ace0ccbb711406114777dc97a34c996bdc.tar.gz forums-dd2033ace0ccbb711406114777dc97a34c996bdc.tar.bz2 forums-dd2033ace0ccbb711406114777dc97a34c996bdc.tar.xz forums-dd2033ace0ccbb711406114777dc97a34c996bdc.zip | |
Preliminary avatar gallery support
git-svn-id: file:///svn/phpbb/trunk@1173 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/develop')
| -rw-r--r-- | phpBB/develop/convert_avatars.php | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/phpBB/develop/convert_avatars.php b/phpBB/develop/convert_avatars.php new file mode 100644 index 0000000000..f6069a1e4a --- /dev/null +++ b/phpBB/develop/convert_avatars.php @@ -0,0 +1,51 @@ +<?php + +$phpbb_root_path = "../"; + +include($phpbb_root_path . 'extension.inc'); +include($phpbb_root_path . 'config.'.$phpEx); +include($phpbb_root_path . 'includes/constants.'.$phpEx); +include($phpbb_root_path . 'includes/db.'.$phpEx); + + +$sql = "ALTER TABLE " . USERS_TABLE . " + ADD user_avatar_type TINYINT(4) DEFAULT '0' NOT NULL"; +if( !$result = $db->sql_query($sql) ) +{ + die("Couldn't alter users table"); +} + +$sql = "SELECT user_id, user_avatar + FROM " . USERS_TABLE; +if( $result = $db->sql_query($sql) ) +{ + $rowset = $db->sql_fetchrowset($result); + + for($i = 0; $i < count($rowset); $i++) + { + if( ereg("^http", $rowset[$i]['user_avatar'])) + { + $sql_type = USER_AVATAR_REMOTE; + } + else if( $rowset[$i]['user_avatar'] != "" ) + { + $sql_type = USER_AVATAR_UPLOAD; + } + else + { + $sql_type = USER_AVATAR_NONE; + } + + $sql = "UPDATE " . USERS_TABLE . " + SET user_avatar_type = $sql_type + WHERE user_id = " . $rowset[$i]['user_id']; + if( !$result = $db->sql_query($sql) ) + { + die("Couldn't update users table- " . $i); + } + } +} + +echo "<BR><BR>COMPLETE<BR>"; + +?> |
