I have created a popup window that will display all the Avatars...it works well on both IE and Netscape. Here is the file:
Open ubbmisc.cgi:
---------------------------------------------------------------
find:
---------------------------------------------------------------
if ($in{'action'} eq "pwrequest") {
&PWRequest;
}
---------------------------------------------------------------
add:
---------------------------------------------------------------
if ($in{'action'} eq "listavatars") {
&ListAllAvatars;
}
---------------------------------------------------------------
---------------------------------------------------------------
at the very end of the file before
exit(0); # comply with SafePerl
Add:
---------------------------------------------------------------
sub ListAllAvatars{
opendir(AVATARS, "$NonCGIPath/avatars");
my @avatars = readdir(AVATARS);
closedir(AVATARS);
@unsortedavatars = grep(/w+.gif/, @avatars);
@theavatars = sort {lc($a) cmp lc($b)} @unsortedavatars;
print<<DataOut;
<HTML>
<HEAD>
</HEAD>
<BODY $BGColor $PageBackground text="$TextColor" link="$LinkColor" alink="$ActiveLinkColor" vlink="$VisitedLinkColor" marginheight=0 marginwidth=0 topmargin=0 leftmargin=0 rightmargin=0>
<center>
<table border=0 cellpadding=4 cellspacing=1>
<tr $AltColumnColor1><td><b><font face="$FontFace" size=2>Image</td><td><b><font face="$FontFace" size=2>Name</td></tr>
DataOut
$stcol = $AltColumnColor2;
foreach $avataritem(@theavatars) {
($avatarname, $ext)=split(/./,$avataritem);
$avatarname =~ s/_/ /g;
$avatarpath = "$NonCGIURL/avatars/$avataritem";
print qq(<tr $stcol><td><img src="$avatarpath"></td><td><font face="$FontFace" size=2>$avatarname</td></tr> );
if ($stcol eq $AltColumnColor1) {$stcol = $AltColumnColor2;} else {$stcol = $AltColumnColor1;}
}
print qq(</table></body></html> );
}
----------------------------------------------------------------
find:
----------------------------------------------------------------
if ($AvatarAllow eq "YES") {
$NOTE = $CUSTOM = "";
$AvatarWording = &AvatarDropDownHTML;
if ($AvatarW ne "") { $CellWidth = ($AvatarW + 10); $AvatarW = qq(width="$AvatarW"); } else { $CellWidth = "110"; $AvatarW = ""; }
if ($AvatarH ne "") { $LayerHeight = ($AvatarH + 2); $AvatarH = qq(height="$AvatarH"); } else { $LayerHeight = "102"; $AvatarH = ""; }
$CellHeight = ($LayerHeight + 10);
$AvatarLine = qq(<tr $AltColumnColor2 valign=top><td height="$CellHeight">
<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr valign="top">
<td><FONT SIZE="$TextSize" FACE="$FontFace"><B>Avatar</B></FONT>
<FONT SIZE="1" FACE="$FontFace">Optional image you may use to appear with each of your posts.
Add after that:
----------------------------------------------------------------
<script language=JavaScript><!-- Hide the script from old browsers --
function jsitOpenWin0() {window.open('$CGIURL/ubbmisc.cgi?action=listavatars','JavaScriptIt','top=100,left=100,width=200,height=500,buttons=Yes,scrollbars=Yes,location=No,menubar=No,resizable=No,status=No ,directories=No,toolbar=No,copyhistory=No')}
//----------------></script>
<a href="JavaScript: jsitOpenWin0()">View All Avatars</a>
----------------------------------------------------------------
Open register_lib.pl
----------------------------------------------------------------
find:
----------------------------------------------------------------
if ($AvatarAllow eq "YES") {
$NOTE = $CUSTOM = "";
$AvatarWording = &AvatarDropDownHTML;
if ($AvatarW ne "") { $CellWidth = ($AvatarW + 10); $AvatarW = qq(width="$AvatarW"); } else { $CellWidth = "110"; $AvatarW = ""; }
if ($AvatarH ne "") { $LayerHeight = ($AvatarH + 2); $AvatarH = qq(height="$AvatarH"); } else { $LayerHeight = "102"; $AvatarH = ""; }
$CellHeight = ($LayerHeight + 10);
$AvatarLine = qq(<tr $AltColumnColor2 valign=top><td height="$CellHeight">
<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr valign="top">
<td><FONT SIZE="$TextSize" FACE="$FontFace"><B>Avatar</B></FONT>
<FONT SIZE="1" FACE="$FontFace">Optional image you may use to appear with each of your posts.
Add after that:
----------------------------------------------------------------
<script language=JavaScript><!-- Hide the script from old browsers --
function jsitOpenWin0() {window.open('$CGIURL/ubbmisc.cgi?action=listavatars','JavaScriptIt','top=100,left=100,width=200,height=500,buttons=Yes,scrollbars=Yes,location=No,menubar=No,resizable=No,status=No ,directories=No,toolbar=No,copyhistory=No')}
//----------------></script>
<a href="JavaScript: jsitOpenWin0()">View All Avatars</a>
----------------------------------------------------------------
##
## Done!
##
## Now upload ubbmisc.cgi and register_lib.pl files and chmod to 755 (if needed).
_________________________
I do not offer support by EMail or ICQ, please post your question at UBBDev....