News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

IPB 1.2 -> SMF 1.0.1 failed to import avatars

Started by curmudgeon, February 09, 2005, 05:02:56 AM

Previous topic - Next topic

curmudgeon

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
---
Look at everything as though you were seeing it either for the first or
last time. Then your time on earth will be filled with glory. -- Betty Smith

Oldiesmann

#1
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.
Michael Eshom
Christian Metal Fans

Advertisement: