PDA

View Full Version : Avatar Listing as text.....


obiwan8472
10-12-2002, 05:02 PM
Some of my users have mentioned that when changing their Avatar... it takes FOREVER to load in the avatars. On my old UBB board, I had an option to List the avatars as names... is this availble in VB? is there a hack for it?

So the avatars would appear in a dropdown box!

Thanx

obiwan8472
10-13-2002, 10:22 PM
anyone?

Eander
10-13-2002, 10:24 PM
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:


$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}">&nbsp;</td>';
$avatarcount++;
}
$avatarlist .= '</tr>';
}


You want to make it look like this:


$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}">&nbsp;</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:


<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.

obiwan8472
10-13-2002, 10:44 PM
Originally posted by Eander
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

Brilliant. Thankyou. I owe you one. :)

obiwan8472
10-15-2002, 09:57 PM
Hi Eander. Thank you for helping me with this.

Slight problem. I have done all the code, but it drop down box has nothing in it, and its got Pages,1,2,3 at the bottom of the box.

Heres the pic.

Do you know the problem?
Thanx

Eander
10-15-2002, 10:15 PM
$avatarcount = 0;
$avatarlist.="<tr><td bgcolor=\"#13486D\"><img name=avatarswitch src=images/blank.gif></td><td bgcolor=\"#13486D\"><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="#13486D">&nbsp;</td>';
$avatarcount++;
}
*/
$avatarlist .= '</tr>';
}



The only thing I can think of is it having problems with the select not being ended, though it worked on my server. Try this instead:


$avatarcount = 0;
$avatarlist.="<tr><td bgcolor=\"#13486D\"><img name=avatarswitch src=images/blank.gif></td><td bgcolor=\"#13486D\"><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="#13486D">&nbsp;</td>';
$avatarcount++;
}
*/
$avatarlist .= '</select></tr>';
}

obiwan8472
10-15-2002, 10:22 PM
Nope. Still the same problem.
I have over 100 avatars, if thats a problem. I named a few of them to see if they would appear but nothing. :(

obiwan8472
10-17-2002, 02:58 PM
I have fiddled with it, but nothing. Still comes up with the same problem. :(

obiwan8472
10-19-2002, 02:58 PM
I solved half the problem!
It now lists the avatar names. yay! had to name them all.

However:

When I select an Avatar and click SUBMIT it comes up with this error

There has been an error in the upload. Please ensure that the file has been correctly selected and that the upload has taken place successfully.

Thanx

obiwan8472
10-21-2002, 03:16 PM
Originally posted by obiwan8472
I solved half the problem!
It now lists the avatar names. yay! had to name them all.

However:

When I select an Avatar and click SUBMIT it comes up with this error

There has been an error in the upload. Please ensure that the file has been correctly selected and that the upload has taken place successfully.



Thanx

help. anyone?
Theres a shiny nickle in it for the person who can help me!

obiwan8472
10-25-2002, 03:28 PM
Help!

obiwan8472
10-26-2002, 10:15 PM
OK as no one seems to know the answer (or I have a bad reputation so no one likes me), can anyone come up with another way of doing the list?

Tar.

obiwan8472
10-29-2002, 09:46 PM
alabump!

obiwan8472
11-02-2002, 10:35 PM
someone must know how to help me! plz!

N9ne
11-02-2002, 11:02 PM
lol I wish I could help you, it's annoying when a thread doesn't get answered...oh well..hope you find some help soon!

obiwan8472
11-04-2002, 09:57 PM
heh, thanx. Ill keep 'bumping' it till either someone gives me a hand or until someone silences me. :D :D

obiwan8472
11-07-2002, 10:27 AM
*cough*
i tried to do it myself, but it completely screwed up.
Must be someone who knows something.

obiwan8472
11-12-2002, 09:51 PM
I found something!
When you Register, IT does have a drop down box. Its just in Edit Profile.
So can anyone tell me where the bit of code is that has the drop down box in Register page?