Simple Machines Community Forum

SMF Support => Converting to SMF => IPB => Topic started by: curmudgeon on February 09, 2005, 05:02:56 AM

Title: IPB 1.2 -> SMF 1.0.1 failed to import avatars
Post by: curmudgeon on February 09, 2005, 05:02:56 AM
Just converted an IPB forum and I do purely love SMF.  The conversion seemed to go smoothly without a hitch. The only problem I've noticed is the way avatars were handled. Some are of the form  /avatars/IPB_Community_Pack/Fish.gif  and every avatar-less user's post results in an instance of  /avatars/noavatar in the generated HTML.  Uploaded avatars were converted properly.

What's the best way to deal with this, I wonder?

  -- curmudgeon
Title: Re: IPB 1.2 -> SMF 1.0.1 failed to import avatars
Post by: Oldiesmann on February 10, 2005, 03:22:19 PM
I'm not sure why they didn't get converted...

However, you can attempt to fix it...

1. Copy the entire IPB_Community_Package directory to SMF's "avatars" directory.
2. Assuming that IPB is using the same database as SMF, you can do this (change the database prefixes to match your setup - if they don't use the same database, it's a bit trickier).

<?php
include_once('SSI.php');
$query1 db_query("SELECT avatar, name FROM ipb_members"__FILE____LINE__);
while(
$avatar[] = mysql_fetch_assoc($query1))
{
if(
strpos($avatar['avatar'], "IPB_Community_Pack") !=== false)
{
$query2 db_query("UPDATE smf_members SET avatar = " $avatar['avatar'] . " WHERE memberName = " $avatar['name'], __FILE____LINE__);
echo 
'Successfully updated avatar for member ' $avatar['name'], '...<br />';
}
}
?>


I think that will work, but let me know if it doesn't. I haven't had much time to look at this.