PHP interesse |
|
Ik gebruik de volgende code, echter hij geeft continu de noavatar.gif aan, ik snap er niets meer van.
$avatarid = $_SESSION['suserid'];
if (file_exists('/img/avatars/'.$avatarid.'/avatar.gif')) {
$tpl->assign( "AVATARURL", "/img/avatars/".$avatarid."/avatar.gif" );
} elseif (file_exists('/img/avatars/'.$avatarid.'/avatar.jpg')) {
$tpl->assign( "AVATARURL", "/img/avatars/".$avatarid."/avatar.jpg" );
} elseif (file_exists('/img/avatars/'.$avatarid.'/avatar.png')) {
$tpl->assign( "AVATARURL", "/img/avatars/".$avatarid."/avatar.png" );
} else {
$tpl->assign( "AVATARURL", "/img/avatars/noavatar.gif" );
}
$avatarid = $_SESSION['suserid']; if (file_exists('/img/avatars/'.$avatarid.'/avatar.gif')) { $tpl->assign( "AVATARURL", "/img/avatars/".$avatarid."/avatar.gif" ); } elseif (file_exists('/img/avatars/'.$avatarid.'/avatar.jpg')) { $tpl->assign( "AVATARURL", "/img/avatars/".$avatarid."/avatar.jpg" ); } elseif (file_exists('/img/avatars/'.$avatarid.'/avatar.png')) { $tpl->assign( "AVATARURL", "/img/avatars/".$avatarid."/avatar.png" ); } else { $tpl->assign( "AVATARURL", "/img/avatars/noavatar.gif" ); }
Greetz,
merlin_nl
|