php forum
php mysql forum
php mysql smarty
 
Topic Options
#42750 - 04/30/00 06:14 PM Avatar PopUp Window Add-On
Dark_Wizard Offline
Member

Registered: 06/11/00
Posts: 57
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....

Top



Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks