vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Avatar Listing as text..... (https://vborg.vbsupport.ru/showthread.php?t=44548)

obiwan8472 10-12-2002 05:02 PM

Avatar Listing as text.....
 
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

1 Attachment(s)
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}">&nbsp;</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}">&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:

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.

obiwan8472 10-13-2002 10:44 PM

Quote:

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

1 Attachment(s)
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

Quote:

PHP Code:

$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:

PHP Code:

$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

Quote:

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!


All times are GMT. The time now is 12:35 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01168 seconds
  • Memory Usage 1,765KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete