Hmm, I'm familiar with the UBB avatar bit where it just has a dropdown box that changes the image via javascript. I'll see what I can do
Ok.. here's the original from member.php:
PHP Code:
$avatarcount = 0;
while ($avatar=$DB_site->fetch_array($avatars)) {
$avatarid=$avatar[avatarid];
if ($avatarcount==0)
$avatarlist .= '<tr>';
eval("\$avatarlist .= \"".gettemplate("modifyavatarbit")."\";");
$avatarcount++;
if ($avatarcount==$numavatarswide) {
$avatarlist .= '</tr>';
$avatarcount = 0;
}
}
if ($avatarcount!=0) {
while ($avatarcount < $numavatarswide) {
$avatarlist .= '<td bgcolor="{firstaltcolor}"> </td>';
$avatarcount++;
}
$avatarlist .= '</tr>';
}
You want to make it look like this:
PHP Code:
$avatarcount = 0;
$avatarlist.="<tr><td bgcolor=\"{firstaltcolor}\"><img name=avatarswitch src=images/blank.gif></td><td bgcolor=\"{firstaltcolor}\"><select name=newavatar onChange=\"switchimg(this);\"><option value=\"\">";
while ($avatar=$DB_site->fetch_array($avatars)) {
$avatarid=$avatar[avatarid];
$avatarlist.="<option value=\"$avatar[avatarpath]\">$avatar[title]";
/*
if ($avatarcount==0)
$avatarlist .= '<tr>';
eval("\$avatarlist .= \"".gettemplate("modifyavatarbit")."\";");
$avatarcount++;
if ($avatarcount==$numavatarswide) {
$avatarlist .= '</tr>';
$avatarcount = 0;
}
*/
}
if ($avatarcount!=0) {
/*
while ($avatarcount < $numavatarswide) {
$avatarlist .= '<td bgcolor="{firstaltcolor}"> </td>';
$avatarcount++;
}
*/
$avatarlist .= '</tr>';
}
I just commented out all the old stuff.
Next you want to edit your modifyavatar template.
At the top of the template find $headinclude . Put this in after it:
Quote:
<script language="javascript">
function switchimg(newimg) {
var URL = newimg.options[newimg.selectedIndex].value;
document['avatarswitch'].src=URL;
}
</script>
|
Also, you're going to need a blank gif image for a starter. I've attached one for you. It's 1x1 and transparent. Should do nicely.