Arama butonu
Bu konudaki kullanıcılar: 1 misafir, 1 mobil kullanıcı
1
Cevap
1085
Tıklama
0
Öne Çıkarma
Flash MP3 Player ayarları
S
17 yıl
Yüzbaşı
Konu Sahibi

http://www.gigfoot.net/software/1.html
adresindeki "Flash MP3 Player"i satın aldım. Ancak kurulumu nasıl yapacağımı bilmiyorum.
Aşağıdaki sayfada (kodlar içinde) nerede nasıl ayarlamalar yapılacağı konusunda yardımcı olabilecek var mı acaba?

#!/usr/bin/perl 
#################################################
#################################################
#################################################
# The web-based flash mp3player
# version 052305
# Gigfoot LLC
# James True
#################################################
# MP3_BIN
# The default for this to run smooth is that this script
# reside inside the folder where your mp3 files exist.
# If you want to change this, you may specify an
# absolute directory path where your mp3files are found.
# examples are "/home/you/web/mp3" or "c:/IIS/web/shares/" etc
# If you change the MP3_BIN you will need to also change to MP3_BIN_URL accordingly.
# Hint, MP3_BIN_URL will usually be your absolute MP3_BIN without the DOCUMENT_ROOT at the front.
# ALWAYS end both of these variables with a slash (/).
# Change at your own risk and rock on.
my $MP3_BIN = "";
my $MP3_BIN_URL = "";
#################################################
# START_PAGE
# This is optional, set this to a url if you do not
# want this program to decide on your start page.
# The start page is the url displayed in the main frames window
my $START_PAGE = "";
#################################################
# BG_COLOR
# if you want to override the random colors you can specify a hex color below.
# Example: $BG_COLOR = ""; = RANDOM
# Example: $BG_COLOR = "FF0000"; = ALWAYS RED
# Example: $BG_COLOR = "00FF00"; = ALWAYS GREEN
# Example: $BG_COLOR = "0000FF"; = ALWAYS BLUE
my $BG_COLOR = "";
#################################################
# RECURSE
# if your mp3 files are stored inside of seperate subfolders
# turn on FOLDER_RECURSE to have it scan the subfolders for a new song
# Example: 0 = off 1 = on
my $FOLDER_RECURSE = 0;
#################################################
# SECURITY
# UNIX,LINUX,MACOSX servers may be able to provide
# extra security by enabling CHMODING. This turns
# the file permissions off for all mp3 files cept
# the one currently being played. If you turn this
# feature on, make sure your player is working properly on your server!
# 1 = on | 0 = off
my $SECURITY_CHMOD = 0;
#################################################
# AUTOCOMPLETE
# used mainly by folks who are running their player out of a cgi-bin folder
# If auto-complete is on, you can request a mp3song by the title of the mp3 only.
# This only works if you pass an src variable with no slashes in it.
# So if AUTO_COMPLETE_URL is set to 1 then the url below will work
#http://www.yourdomain.com/cgi-bin/mp3player.cgi?src=Acoustic Syndicate - secret track.mp3
my $AUTO_COMPLETE = 1;
#################################################
#################################################
### End of user defined section
#################################################
#################################################
use strict;##### strick means if you see an internal server error, check your logs for complete details :)
#use LWP::Simple;
use Cwd;
print "Content-type:text/html\n\n";
my $debug = "";
my %MYENV = &initENV;
my %GET = &readGet;
if (($AUTO_COMPLETE)&&($GET{'src'})&&($GET{'src'} !~ /[\\\/]+/)){$GET{'src'} = $MP3_BIN_URL.$GET{'src'};}
#################################################
#################################################
#################################################
if ($SECURITY_CHMOD){&SecureFiles();}
&readGet;
if ($GET{'action'} eq ""){$GET{'action'} = "frames";}
if ($GET{'action'} eq "Info"){&Info();exit;}
#if ($GET{'action'} eq "Visual"){&Visual();exit;}
if ($GET{'action'} eq "Playlist"){&Playlist();exit;}
if ($GET{'action'} eq "Playlist2"){&Playlist2();exit;}
if ($GET{'action'} eq "Search"){&Search();exit;}
if ($GET{'action'} eq "frames"){&frames();exit;}
if ($GET{'action'} eq "frames2"){&frames2();exit;}
if ($GET{'action'} eq "framesvisual"){&framesvisual();exit;}
if ($GET{'action'} eq "PlaylistFrames"){&PlaylistFrames();exit;}
if ($GET{'action'} eq "mp3frame"){&mp3frame();exit;}
if ($GET{'action'} eq "mp3frame2"){&mp3frame2();exit;}
if ($GET{'action'} eq "mp3framevisual"){&mp3framevisual();exit;}
exit;
#################################################
#################################################
#################################################
sub AllowFile{
chmod (0755,$_[0]);
}########################################### end AllowFile
sub SecureFiles{
## turn off all permissions for mp3 file to prrevent users from downloading
my @sec;
if ($FOLDER_RECURSE){
@sec = &RecurseMP3($MP3_BIN);
}else{
@sec = &ReadContent($MP3_BIN,'\.mp3');
}
foreach my $file(@sec){
chmod (0700,"$MP3_BIN$file");
}
}########################################### end SecureFiles
#sub Visual{
## OUTPUT a numeric representation of this song to the flash environment
#if (!$GET{'VMETHOD'}){$GET{'VMETHOD'} = "SINGLE";}
#my %MP;
#print "//<pre>Output Flash readable code for this mp3 src\n";
#if ($GET{'src'}){
##%MP = &DescribeMP3($GET{'src'});
#print "&VMETHOD=$GET{'VMETHOD'}&\n";
#print "&viznotes=V:$MP{'VERSION'} L:$MP{'LAYER'} M:$MP{'MODE'}&\n";
#print "&bsize=".(-s "$GET{'src'}")."&\n";
#my $xx;
#if ($GET{'VMETHOD'} eq "SINGLE"){$xx = &SINGLE(%MP);}
#foreach my $li(keys %MP){
#my $clsrc = $MP{$li};
#$clsrc =~ s/\&/\%26/g;
#print "&$li=$clsrc&\n";
#}
#print "&xx=".$xx."&\n";
#}#################
#print "&vloaded=1&\n";
#print "//</pre>\n";
#exit;
#}############################################### end Visual
sub SINGLE{
my %MP = @_;
my $str;
for(my $tt=0;$tt<$MP{'SECS'};$tt++){
my @sec;
my $startSeek = ($MP{'BYTES_PER_SECOND'}*($tt+1))+$MP{'START_SOUND'};
while(($#sec+1)<=20){
##################
local $/ = \1;
my $scnt;
open (FILE,"$GET{'src'}");
seek(FILE,$startSeek,0);
while (my $zline = <FILE>){$scnt++;
$zline = unpack 'c2', $zline;
$zline = $zline+128;
$zline = int(($zline*100)/256);
if ($GET{'debug'}){print "<li>$zline\n";}
push(@sec,$zline);
$startSeek = $startSeek+($MP{'BYTES_PER_SECOND'}*($#sec+2))+1;
last;
}close FILE;
##################
my $vl = $tt;
$vl =~ s/.*(.)$/$1/;
push(@sec,$vl);
}
$str .= join("|",@sec)."|";
}
$str =~ s/\|$//;
return $str;
}################################################# end SINGLE
#sub DescribeMP3{
#my $file = $_[0];
#my %OUT;
#$OUT{'src'} = $file;
#use MP3::Info qw(:all);
#my $info = get_mp3info($file) or ($OUT{'ERROR'} = "get_mp3info $1 $! $_");
#if ($OUT{'ERROR'}){return %OUT;}
#foreach my $ky(keys %$info){
#$OUT{$ky} = $info->{$ky};
#my $kvv = $info->{$ky};
#$kvv =~ s/\&/\%26/g;
#}
#$OUT{'BYTES_PER_SECOND'} = ($OUT{'SIZE'}/$OUT{'SECS'});
#$OUT{'START_SOUND'} = (-s $file)-$OUT{'SIZE'};
#my $tag = get_mp3tag($file) or ($OUT{'ERROR'} = "get_mp3tag $1 $! $_");
#if ($OUT{'ERROR'}){return %OUT;}
#foreach my $ky(keys %$tag){
#$OUT{$ky} = $tag->{$ky};
#my $kv = $OUT{$ky};$kv =~ s/\&/\%26/g;
#}
#return %OUT;
#}################################### end DescribeMP3
sub frames{
##########################action=$GET{'action'}&shuffle=$GET{'shuffle'}&reload=$GET{'reload'}&autoStart=$GET{'autoStart'}&src=$src
my $auto = "";
if ($ENV{'QUERY_STRING'} !~ /\&/){
$auto = "y";
$GET{'shuffle'} = "y";
$GET{'autoStart'} = "y";
$GET{'reload'} = "y";
}
if (!$GET{'startPage'}){$GET{'startPage'} = $START_PAGE;}
if (!$GET{'startPage'}){$GET{'startPage'} = $ENV{'HTTP_REFERER'};}
if (!$GET{'startPage'}){$GET{'startPage'} = "http://$ENV{'SERVER_NAME'}";}
if ($GET{'bgColor'}){$GET{'bgColor'} = "bgColor=$GET{'bgColor'}";}
if ($GET{'vol'}){$GET{'vol'} = "vol=$GET{'vol'}";}
print <<EOM;
<title>MP3 Player / $ENV{'SERVER_NAME'}</title>
<frameset frameborder=0 framespacing="0" framepadding="0" rows="*,32">
<frame name="mainWindow" target="mainWindow" src="$GET{'startPage'}" scrolling="auto">
<frame name="mp3Player" target="mainWindow" src="?action=mp3frame&shuffle=$GET{'shuffle'}&autoStart=$GET{'autoStart'}&reload=$GET{'reload'}&$GET{'bgColor'}&$GET{'vol'}&src=$GET{'src'}" scrolling="no">
<noframes>
<body>
<p>This Page Requires Frames.</p>
</body>
</noframes>
</frameset>
EOM
}################################################## end frames
sub framesvisual{
##########################action=$GET{'action'}&shuffle=$GET{'shuffle'}&reload=$GET{'reload'}&autoStart=$GET{'autoStart'}&src=$src
my $auto = "";
if ($ENV{'QUERY_STRING'} !~ /\&/){
$auto = "y";
$GET{'shuffle'} = "y";
$GET{'autoStart'} = "y";
$GET{'reload'} = "y";
}
if (!$GET{'startPage'}){$GET{'startPage'} = $START_PAGE;}
if (!$GET{'startPage'}){$GET{'startPage'} = $ENV{'HTTP_REFERER'};}
if (!$GET{'startPage'}){$GET{'startPage'} = "http://$ENV{'SERVER_NAME'}";}
if ($GET{'bgColor'}){$GET{'bgColor'} = "bgColor=$GET{'bgColor'}";}
my $tm = time;
print <<EOM;
<title>MP3 Player / $ENV{'SERVER_NAME'}</title>
<frameset frameborder=0 framespacing="0" framepadding="0" rows="*,300">
<frame name="mainWindow" target="mainWindow" src="$GET{'startPage'}" scrolling="auto">
<frame name="mp3Player" target="mainWindow" src="?action=mp3framevisual&c=$tm&shuffle=$GET{'shuffle'}&autoStart=$GET{'autoStart'}&reload=$GET{'reload'}&$GET{'bgColor'}&src=$GET{'src'}" scrolling="no">
<noframes>
<body>
<p>This Page Requires Frames.</p>
</body>
</noframes>
</frameset>
EOM
}################################################## end framesvisual
sub frames2{
##########################action=$GET{'action'}&shuffle=$GET{'shuffle'}&reload=$GET{'reload'}&autoStart=$GET{'autoStart'}&src=$src
my $auto = "";
if ($ENV{'QUERY_STRING'} !~ /\&/){
$auto = "y";
$GET{'shuffle'} = "y";
$GET{'autoStart'} = "y";
$GET{'reload'} = "y";
}
if ($GET{'vol'}){$GET{'vol'} = "&vol=$GET{'vol'}&";}
if (!$GET{'startPage'}){$GET{'startPage'} = $START_PAGE;}
if (!$GET{'startPage'}){$GET{'startPage'} = $ENV{'HTTP_REFERER'};}
if (!$GET{'startPage'}){$GET{'startPage'} = "http://$ENV{'SERVER_NAME'}";}
if ($GET{'bgColor'}){$GET{'bgColor'} = "bgColor=$GET{'bgColor'}";}
my $tm = time;
print <<EOM;
<title>MP3 Player / $ENV{'SERVER_NAME'}</title>
<frameset frameborder=0 framespacing="0" framepadding="0" rows="*,200">
<frame name="mainWindow" target="mainWindow" src="$GET{'startPage'}" scrolling="auto">
<frame name="mp3Player" target="mainWindow" src="?$GET{'vol'}&action=mp3frame2&c=$tm&shuffle=$GET{'shuffle'}&autoStart=$GET{'autoStart'}&reload=$GET{'reload'}&$GET{'bgColor'}&src=$GET{'src'}" scrolling="no">
<noframes>
<body>
<p>This Page Requires Frames.</p>
</body>
</noframes>
</frameset>
EOM
}################################################## end frames2
sub PlaylistFrames{
##########################action=$GET{'action'}&shuffle=$GET{'shuffle'}&reload=$GET{'reload'}&autoStart=$GET{'autoStart'}&src=$src
my $auto = "";
if ($ENV{'QUERY_STRING'} !~ /\&/){
$auto = "y";
$GET{'shuffle'} = "y";
$GET{'autoStart'} = "y";
$GET{'reload'} = "y";
}
if (!$GET{'startPage'}){$GET{'startPage'} = $START_PAGE;}
if (!$GET{'startPage'}){$GET{'startPage'} = $ENV{'HTTP_REFERER'};}
if (!$GET{'startPage'}){$GET{'startPage'} = "http://$ENV{'SERVER_NAME'}";}
if ($GET{'bgColor'}){$GET{'bgColor'} = "bgColor=$GET{'bgColor'}";}
print <<EOM;
<title>MP3 Player / $ENV{'SERVER_NAME'}</title>
<frameset frameborder=0 framespacing="0" framepadding="0" rows="*,32">
<frame name="mainWindow" target="mainWindow" src="?action=Playlist2&" scrolling="auto">
<frame name="mp3Player" target="mainWindow" src="?action=mp3frame&shuffle=$GET{'shuffle'}&autoStart=$GET{'autoStart'}&reload=$GET{'reload'}&$GET{'bgColor'}&src=$GET{'src'}" scrolling="no">
<noframes>
<body>
<p>This Page Requires Frames.</p>
</body>
</noframes>
</frameset>
EOM
}################################################## end PlaylistFrames
sub mp3framevisual{
#my %GET = %_;
my @mp3s;
my @cnt;
##print "$MP3_BIN cnt=$#cnt<hr>";
if ($FOLDER_RECURSE){
@cnt = &RecurseMP3($MP3_BIN);
}else{
@cnt = &ReadContent($MP3_BIN,'\.mp3');
}
my $LIBRARY_TOTAL = $#cnt+1;
my $nowx = 0;
my $emptymp3;
my $st;
my $src;
my $srcX;
if ($GET{'src'}){$src = $GET{'src'};}
my $lastSrc = $GET{'lastSrc'};
my $lastSrcPattern;
$lastSrc =~ s/.*\///;
$srcX = $src;
$srcX =~ s/.*\///;
my @dcnt = @cnt;
if ($lastSrc eq ""){$lastSrcPattern = "BLAGGABLUGGABLOOGA";}else{$lastSrcPattern = "$lastSrc";}
foreach my $of(@dcnt){
if ($of =~ /\.mp3$/i){
$emptymp3 = $of;
my $cof = $of;
my $clastSrcPattern = $lastSrcPattern;
$cof =~ s/\W+//g;
$clastSrcPattern =~ s/\W+//g;
if ($cof !~ /$clastSrcPattern/i){
push (@mp3s,$of);
}
$of =~ s/\W+//g;
my $srcD = $src;
$srcD =~ s/\W+//g;
my $srcXD = $srcX;
$srcXD =~ s/\W+//g;
my $lastSrcD = $lastSrc;
$lastSrcD =~ s/\W+//g;
if (($srcXD)&&($of =~ /$srcXD$/i)){$st = $nowx;}
if (($lastSrcD)&&($of =~ /$lastSrcD$/i)){$st = $nowx;}
$nowx++;
}
}
if ($st > $#mp3s){$st = 0;}
if ($src eq ""){$src = "".$mp3s[$st];$srcX = $mp3s[$st];
}
if ($src eq ""){$src = $emptymp3;}
#$GET{'src'} = $src;
my $tPlaylist = "y";
my $tShuffle = "y";
my $tReload = "y";
my $tAutoStart = "y";
my $tPlaylistStyle = "blon";
my $tShuffleStyle = "BlackLinks";
my $tReloadStyle = "BlackLinks";
my $tAutoStartStyle = "BlackLinks";
if ($GET{'shuffle'}){$src = $mp3s[rand($#mp3s)];$tShuffle = "";$tShuffleStyle = "blon";}
if ($GET{'reload'}){$tReload = "";$tReloadStyle = "blon";}
if ($GET{'autoStart'}){$tAutoStart = "";$tAutoStartStyle = "blon";}
#####
my %newQ = ();
my $qstr = "$ENV{'QUERY_STRING'}";
my @qs = split(/\&/,$qstr);
foreach my $li(@qs){
my($ln,$lv)=split(/\=/,$li);
#print "$li / $ln==$lv<hr>";
$newQ{$ln} = $lv;
}
my $cleanQ = "";
foreach my $li(keys %newQ){
if ($li){$cleanQ .= "$li=".$newQ{$li}."&";}
}
$ENV{'QUERY_STRING'} = $cleanQ;
my @colors = ("333333","9f0000","009f00","9f0000","9f009f","0000aa","dddddd","af64af","646464","98aa99");
my $bgColor;
if ($GET{'bgColor'} eq ""){$bgColor = $colors[rand($#colors)];$GET{'bgColor'} = $bgColor;}else{$bgColor = $GET{'bgColor'};}
if ($BG_COLOR){$bgColor = $BG_COLOR;}

my $srcQ = $MP3_BIN_URL.$src;
$srcQ =~ s/\%/\%25/g;
$srcQ =~ s/\+/\%2B/g;
$srcQ =~ s/\&/\%26/g;
$srcQ =~ s/\#/\%23/g;
$srcQ =~ s/\~/\%7E/g;
$srcQ =~ s/\'/\%27/g;
$srcQ =~ s/\(/\%28/g;
$srcQ =~ s/\)/\%29/g;
$srcQ =~ s/\-/\%2D/g;
$srcQ =~ s/\=/\%3D/g;
$srcQ =~ tr/ /+/;
$src = $srcQ;
if ($GET{'src'}){$src = $GET{'src'};}
$src =~ s/\&/\%26/g;
$tPlaylist = <<EOM;
<a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=25848374&url=?action=Playlist2" data-href="?action=Playlist2">Playlist</a>
EOM
$tShuffle = <<EOM;
<a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=25848374&url=?$ENV{'QUERY_STRING'}shuffle=$tShuffle&src=$src" data-href="?$ENV{'QUERY_STRING'}shuffle=$tShuffle&src=$src">Shuffle</a>
EOM
$tReload = <<EOM;
<a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=25848374&url=?$ENV{'QUERY_STRING'}reload=$tReload&src=$src" data-href="?$ENV{'QUERY_STRING'}reload=$tReload&src=$src">Reload</a>
EOM
$tAutoStart = <<EOM;
<a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=25848374&url=?$ENV{'QUERY_STRING'}&autoStart=$tAutoStart&src=$src" data-href="?$ENV{'QUERY_STRING'}&autoStart=$tAutoStart&src=$src">AutoStart</a>
EOM
print <<EOM;
<style>
a.blon:link{font-family:tahoma;text-decoration:underline;color:$bgColor;}
a.blon:visited{font-family:tahoma;text-decoration:underline;color:$bgColor;}
a.blon:hover{font-family:tahoma;text-decoration:underline;color:ff0000;}
a.BlackLinks:link{font-family:tahoma;text-decoration:none;color:$bgColor;}
a.BlackLinks:visited{font-family:tahoma;text-decoration:none;color:$bgColor;}
a.BlackLinks:hover{font-family:tahoma;text-decoration:none;color:ff0000;}
</style>
<body bgcolor=000000 leftmargin="0" topmargin="0" rightmargin="0" bottomargin="0" bottommargin="0">
<table width=100% border=0 cellpadding=0 cellspacing=0><tr>
<td align=right><font face=tahoma size=-2 color=$bgColor>
$tPlaylist /
$tReload /
$tAutoStart /
$tShuffle /
<a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=25848374&url=?$ENV{'QUERY_STRING'}&src=&lastSrc=$src" data-href="?$ENV{'QUERY_STRING'}&src=&lastSrc=$src">Next Song</a> /
<a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=25848374&url=#" onClick="var df = ''+parent.frames[0].location;if (df != ''){parent.location = parent.frames[0].location;}else{parent.location = 'http://$ENV{'SERVER_NAME'}';}" data-href="#" onClick="var df = ''+parent.frames[0].location;if (df != ''){parent.location = parent.frames[0].location;}else{parent.location = 'http://$ENV{'SERVER_NAME'}';}">Hide MP3 Player</a>
</font></td>
<td valign=top title="TOTAL SONGS=$LIBRARY_TOTAL\n$src" width=32 bgcolor=$bgColor><img src="$MP3_BIN_URL/anglenew.gif" border=0></td>
<td width=450 align=right bgcolor=$bgColor>
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
WIDTH="450" HEIGHT="300" id="MP3player" ALIGN="">
<PARAM NAME=movie VALUE="$MP3_BIN_URL/MP3PlayerVisual.swf?action=$GET{'action'}&shuffle=$GET{'shuffle'}&reload=$GET{'reload'}&autoStart=$GET{'autoStart'}&src=$src">
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE="#$bgColor">
<EMBED src="$MP3_BIN_URL/MP3PlayerVisual.swf?action=$GET{'action'}&shuffle=$GET{'shuffle'}&reload=$GET{'reload'}&autoStart=$GET{'autoStart'}&src=$src"
quality=high bgcolor=#$bgColor WIDTH="450" HEIGHT="300" NAME="MP3player"
ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
</EMBED></OBJECT></td>
</tr></table>
</html>
<body onLoad="window.MP3player.focus();">
EOM
}################################################## end mp3framevisual
sub mp3frame{
#my %GET = %_;
my @mp3s;
my @cnt;
##print "$MP3_BIN cnt=$#cnt<hr>";
if ($FOLDER_RECURSE){
@cnt = &RecurseMP3($MP3_BIN);
}else{
@cnt = &ReadContent($MP3_BIN,'\.mp3');
}
my $LIBRARY_TOTAL = $#cnt+1;
my $nowx = 0;
my $emptymp3;
my $st;
my $src;
my $srcX;
if ($GET{'src'}){$src = $GET{'src'};}
my $lastSrc = $GET{'lastSrc'};
my $lastSrcPattern;
$lastSrc =~ s/.*\///;
$srcX = $src;
$srcX =~ s/.*\///;
my @dcnt = @cnt;
if ($lastSrc eq ""){$lastSrcPattern = "BLAGGABLUGGABLOOGA";}else{$lastSrcPattern = "$lastSrc";}
foreach my $of(@dcnt){
if ($of =~ /\.mp3$/i){
$emptymp3 = $of;
my $cof = $of;
my $clastSrcPattern = $lastSrcPattern;
$cof =~ s/\W+//g;
$clastSrcPattern =~ s/\W+//g;
if ($cof !~ /$clastSrcPattern/i){
push (@mp3s,$of);
}
$of =~ s/\W+//g;
my $srcD = $src;
$srcD =~ s/\W+//g;
my $srcXD = $srcX;
$srcXD =~ s/\W+//g;
my $lastSrcD = $lastSrc;
$lastSrcD =~ s/\W+//g;
if (($srcXD)&&($of =~ /$srcXD$/i)){$st = $nowx;}
if (($lastSrcD)&&($of =~ /$lastSrcD$/i)){$st = $nowx;}
$nowx++;
}
}
if ($st > $#mp3s){$st = 0;}
if ($src eq ""){$src = "".$mp3s[$st];$srcX = $mp3s[$st];
}
if ($src eq ""){$src = $emptymp3;}
#$GET{'src'} = $src;
my $tPlaylist = "y";
my $tShuffle = "y";
my $tReload = "y";
my $tAutoStart = "y";
my $tPlaylistStyle = "blon";
my $tShuffleStyle = "BlackLinks";
my $tReloadStyle = "BlackLinks";
my $tAutoStartStyle = "BlackLinks";
if ($GET{'shuffle'}){$src = $mp3s[rand($#mp3s)];$tShuffle = "";$tShuffleStyle = "blon";}
if ($GET{'reload'}){$tReload = "";$tReloadStyle = "blon";}
if ($GET{'autoStart'}){$tAutoStart = "";$tAutoStartStyle = "blon";}
#####
my %newQ = ();
my $qstr = "$ENV{'QUERY_STRING'}";
my @qs = split(/\&/,$qstr);
foreach my $li(@qs){
my($ln,$lv)=split(/\=/,$li);
#print "$li / $ln==$lv<hr>";
$newQ{$ln} = $lv;
}
my $cleanQ = "";
foreach my $li(keys %newQ){
if ($li){$cleanQ .= "$li=".$newQ{$li}."&";}
}
$ENV{'QUERY_STRING'} = $cleanQ;
my @colors = ("333333","9f0000","009f00","9f0000","9f009f","0000aa","dddddd","af64af","646464","98aa99");
my $bgColor;
if ($GET{'bgColor'} eq ""){$bgColor = $colors[rand($#colors)];$GET{'bgColor'} = $bgColor;}else{$bgColor = $GET{'bgColor'};}
if ($BG_COLOR){$bgColor = $BG_COLOR;}
if ($SECURITY_CHMOD){&AllowFile("$MP3_BIN$src");}
my $srcQ = $MP3_BIN_URL.$src;
$srcQ =~ s/\%/\%25/g;
$srcQ =~ s/\+/\%2B/g;
$srcQ =~ s/\&/\%26/g;
$srcQ =~ s/\#/\%23/g;
$srcQ =~ s/\~/\%7E/g;
$srcQ =~ s/\'/\%27/g;
$srcQ =~ s/\(/\%28/g;
$srcQ =~ s/\)/\%29/g;
$srcQ =~ s/\-/\%2D/g;
$srcQ =~ s/\=/\%3D/g;
$srcQ =~ tr/ /+/;
$src = $srcQ;
if ($GET{'src'}){$src = $GET{'src'};}
$src =~ s/\&/\%26/g;
$tPlaylist = <<EOM;
<a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=25848374&url=?action=Playlist2" data-href="?action=Playlist2">Playlist</a>
EOM
$tShuffle = <<EOM;
<a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=25848374&url=?$ENV{'QUERY_STRING'}shuffle=$tShuffle&src=$src" data-href="?$ENV{'QUERY_STRING'}shuffle=$tShuffle&src=$src">Shuffle</a>
EOM
$tReload = <<EOM;
<a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=25848374&url=?$ENV{'QUERY_STRING'}reload=$tReload&src=$src" data-href="?$ENV{'QUERY_STRING'}reload=$tReload&src=$src">Reload</a>
EOM
$tAutoStart = <<EOM;
<a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=25848374&url=?$ENV{'QUERY_STRING'}&autoStart=$tAutoStart&src=$src" data-href="?$ENV{'QUERY_STRING'}&autoStart=$tAutoStart&src=$src">AutoStart</a>
EOM
my $volmod;
if ($GET{'vol'}){$volmod = "vol=$GET{'vol'}";}
print <<EOM;
<style>
a.blon:link{font-family:tahoma;text-decoration:underline;color:$bgColor;}
a.blon:visited{font-family:tahoma;text-decoration:underline;color:$bgColor;}
a.blon:hover{font-family:tahoma;text-decoration:underline;color:ff0000;}
a.BlackLinks:link{font-family:tahoma;text-decoration:none;color:$bgColor;}
a.BlackLinks:visited{font-family:tahoma;text-decoration:none;color:$bgColor;}
a.BlackLinks:hover{font-family:tahoma;text-decoration:none;color:ff0000;}
</style>
<body bgcolor=000000 leftmargin="0" topmargin="0" rightmargin="0" bottomargin="0" bottommargin="0">
<table width=100% border=0 cellpadding=0 cellspacing=0><tr>
<td align=right><font face=tahoma size=-2 color=$bgColor>
$tPlaylist /
$tReload /
$tAutoStart /
$tShuffle /
<a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=25848374&url=?$ENV{'QUERY_STRING'}&src=&lastSrc=$src" data-href="?$ENV{'QUERY_STRING'}&src=&lastSrc=$src">Next Song</a> /
<a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=25848374&url=#" onClick="var df = ''+parent.frames[0].location;if (df != ''){parent.location = parent.frames[0].location;}else{parent.location = 'http://$ENV{'SERVER_NAME'}';}" data-href="#" onClick="var df = ''+parent.frames[0].location;if (df != ''){parent.location = parent.frames[0].location;}else{parent.location = 'http://$ENV{'SERVER_NAME'}';}">Hide MP3 Player</a>
</font></td>
<td title="TOTAL SONGS=$LIBRARY_TOTAL\n$src" width=32 bgcolor=$bgColor><img src="$MP3_BIN_URL/anglenew.gif" border=0></td>
<td width=450 align=right bgcolor=$bgColor>
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
WIDTH="450" HEIGHT="25" id="MP3player" ALIGN="">
<PARAM NAME=movie VALUE="$MP3_BIN_URL/MP3PlayerMini.swf?action=$GET{'action'}&$volmod&shuffle=$GET{'shuffle'}&reload=$GET{'reload'}&autoStart=$GET{'autoStart'}&src=$src">
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE="#$bgColor">
<EMBED src="$MP3_BIN_URL/MP3PlayerMini.swf?action=$GET{'action'}&shuffle=$GET{'shuffle'}&$volmod&reload=$GET{'reload'}&autoStart=$GET{'autoStart'}&src=$src"
quality=high bgcolor=#$bgColor WIDTH="450" HEIGHT="25" NAME="MP3player"
ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
</EMBED></OBJECT></td>
</tr></table>
</html>
<body onLoad="window.MP3player.focus();">
EOM
}################################################## end mp3frame
sub mp3frame2{
my @mp3s;
my @cnt;
if ($FOLDER_RECURSE){
@cnt = &RecurseMP3($MP3_BIN);
}else{
@cnt = &ReadContent($MP3_BIN,'\.mp3');
}
my $LIBRARY_TOTAL = $#cnt+1;
my $nowx = 0;
my $emptymp3;
my $st;
my $src;
my $srcX;
if ($GET{'src'}){$src = $GET{'src'};}
my $lastSrc = $GET{'lastSrc'};
my $lastSrcPattern;
$lastSrc =~ s/.*\///;
$srcX = $src;
$srcX =~ s/.*\///;
my @dcnt = @cnt;
if ($lastSrc eq ""){$lastSrcPattern = "BLAGGABLUGGABLOOGA";}else{$lastSrcPattern = "$lastSrc";}
foreach my $of(@dcnt){
if ($of =~ /\.mp3$/i){
$emptymp3 = $of;
my $cof = $of;
my $clastSrcPattern = $lastSrcPattern;
$cof =~ s/\W+//g;
$clastSrcPattern =~ s/\W+//g;
if ($cof !~ /$clastSrcPattern/i){
push (@mp3s,$of);
}
$of =~ s/\W+//g;
my $srcD = $src;
$srcD =~ s/\W+//g;
my $srcXD = $srcX;
$srcXD =~ s/\W+//g;
my $lastSrcD = $lastSrc;
$lastSrcD =~ s/\W+//g;
if (($srcXD)&&($of =~ /$srcXD$/i)){$st = $nowx;}
if (($lastSrcD)&&($of =~ /$lastSrcD$/i)){$st = $nowx;}
$nowx++;
}
}
if ($st > $#mp3s){$st = 0;}
if ($src eq ""){$src = "".$mp3s[$st];$srcX = $mp3s[$st];
}
if ($src eq ""){$src = $emptymp3;}
#$GET{'src'} = $src;
my $tPlaylist = "y";
my $tShuffle = "y";
my $tReload = "y";
my $tAutoStart = "y";
my $tPlaylistStyle = "blon";
my $tShuffleStyle = "BlackLinks";
my $tReloadStyle = "BlackLinks";
my $tAutoStartStyle = "BlackLinks";
if ($GET{'shuffle'}){$src = $mp3s[rand($#mp3s)];$tShuffle = "";$tShuffleStyle = "blon";}
if ($GET{'reload'}){$tReload = "";$tReloadStyle = "blon";}
if ($GET{'autoStart'}){$tAutoStart = "";$tAutoStartStyle = "blon";}
#####
my %newQ = ();
my $qstr = "$ENV{'QUERY_STRING'}";
my @qs = split(/\&/,$qstr);
foreach my $li(@qs){
my($ln,$lv)=split(/\=/,$li);
$newQ{$ln} = $lv;
}
my $cleanQ = "";
foreach my $li(keys %newQ){
if ($li){$cleanQ .= "$li=".$newQ{$li}."&";}
}
$ENV{'QUERY_STRING'} = $cleanQ;
my @colors = ("333333","9f0000","009f00","9f0000","9f009f","0000aa","dddddd","af64af","646464","98aa99");
my $bgColor;
if ($GET{'bgColor'} eq ""){$bgColor = $colors[rand($#colors)];$GET{'bgColor'} = $bgColor;}else{$bgColor = $GET{'bgColor'};}
if ($BG_COLOR){$bgColor = $BG_COLOR;}
my $srcQ = $MP3_BIN_URL.$src;
$srcQ =~ s/\%/\%25/g;
$srcQ =~ s/\+/\%2B/g;
$srcQ =~ s/\&/\%26/g;
$srcQ =~ s/\#/\%23/g;
$srcQ =~ s/\~/\%7E/g;
$srcQ =~ s/\'/\%27/g;
$srcQ =~ s/\(/\%28/g;
$srcQ =~ s/\)/\%29/g;
$srcQ =~ s/\-/\%2D/g;
$srcQ =~ s/\=/\%3D/g;
$srcQ =~ tr/ /+/;
$src = $srcQ;
if ($GET{'src'}){$src = $GET{'src'};}
$src =~ s/\&/\%26/g;
$tPlaylist = <<EOM;
<a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=25848374&url=?action=Playlist2" data-href="?action=Playlist2">Playlist</a>
EOM
$tShuffle = <<EOM;
<a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=25848374&url=?$ENV{'QUERY_STRING'}shuffle=$tShuffle&src=$src" data-href="?$ENV{'QUERY_STRING'}shuffle=$tShuffle&src=$src">Shuffle</a>
EOM
$tReload = <<EOM;
<a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=25848374&url=?$ENV{'QUERY_STRING'}reload=$tReload&src=$src" data-href="?$ENV{'QUERY_STRING'}reload=$tReload&src=$src">Reload</a>
EOM
$tAutoStart = <<EOM;
<a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=25848374&url=?$ENV{'QUERY_STRING'}&autoStart=$tAutoStart&src=$src" data-href="?$ENV{'QUERY_STRING'}&autoStart=$tAutoStart&src=$src">AutoStart</a>
EOM
if ($GET{'vol'} =~ /^\d+$/){
$GET{'vol'} = "&vol=$GET{'vol'}&";
}
print <<EOM;
<style>
a.blon:link{font-family:tahoma;text-decoration:underline;color:$bgColor;}
a.blon:visited{font-family:tahoma;text-decoration:underline;color:$bgColor;}
a.blon:hover{font-family:tahoma;text-decoration:underline;color:ff0000;}
a.BlackLinks:link{font-family:tahoma;text-decoration:none;color:$bgColor;}
a.BlackLinks:visited{font-family:tahoma;text-decoration:none;color:$bgColor;}
a.BlackLinks:hover{font-family:tahoma;text-decoration:none;color:ff0000;}
</style>
<body bgcolor=000000 leftmargin="0" topmargin="0" rightmargin="0" bottomargin="0" bottommargin="0">
<table width=100% border=0 cellpadding=0 cellspacing=0><tr>
<td align=right><font face=tahoma size=-2 color=$bgColor>
$tPlaylist /
$tReload /
$tAutoStart /
$tShuffle /
<a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=25848374&url=?$ENV{'QUERY_STRING'}&src=&lastSrc=$src" data-href="?$ENV{'QUERY_STRING'}&src=&lastSrc=$src">Next Song</a> /
<a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=25848374&url=#" onClick="var df = ''+parent.frames[0].location;if (df != ''){parent.location = parent.frames[0].location;}else{parent.location = 'http://$ENV{'SERVER_NAME'}';}" data-href="#" onClick="var df = ''+parent.frames[0].location;if (df != ''){parent.location = parent.frames[0].location;}else{parent.location = 'http://$ENV{'SERVER_NAME'}';}">Hide MP3 Player</a>
</font></td>
<td valign=top title="TOTAL SONGS=$LIBRARY_TOTAL\n$src" width=32 bgcolor=$bgColor><img src="$MP3_BIN_URL/anglenew.gif" border=0></td>
<td width=640 align=right bgcolor=$bgColor>
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
WIDTH="640" HEIGHT="200" id="MP3player" ALIGN="">
<PARAM NAME=movie VALUE="$MP3_BIN_URL/play.swf?$GET{'vol'}action=$GET{'action'}&shuffle=$GET{'shuffle'}&reload=$GET{'reload'}&autoStart=$GET{'autoStart'}&src=$src">
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE="#$bgColor">
<EMBED src="$MP3_BIN_URL/play.swf?$GET{'vol'}action=$GET{'action'}&shuffle=$GET{'shuffle'}&reload=$GET{'reload'}&autoStart=$GET{'autoStart'}&src=$src"
quality=high bgcolor=#$bgColor WIDTH="640" HEIGHT="200" NAME="MP3player"
ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
</EMBED></OBJECT></td>
</tr></table>
</html>
<body onLoad="window.MP3player.focus();">
<body onFocus="window.MP3player.focus();">
EOM
}################################################## end mp3frame2
sub Search{
my $FONT = "font-family:arial;";
my $COL1 = "background-color:#AAAA00;";
my $COL2 = "background-color:#CCCC00;";
my $borders = <<EOM;
border-top:solid 1px #CCCCCC;
border-left:solid 1px #CCCCCC;
border-bottom:solid 1px #333333;
border-right:solid 1px #333333
EOM
my $RESULT;
if ($GET{'Q'}){
my @cnt;
my $fnd;
if ($FOLDER_RECURSE){
@cnt = &RecurseMP3($MP3_BIN);
}else{
@cnt = &ReadContent($MP3_BIN,'\.mp3');
}
foreach my $li(@cnt){
if ($li =~ /$GET{'Q'}/si){$fnd++;}
}
if ($fnd >= 1){
$GET{'RESULT'} = "Results found: $fnd";
&Playlist2;
}else{
$RESULT = "No results found";
}
}
print <<EOM;
<title>MP3 Player Playlist</title>
<style>
td.C{font-size:xx-small;background-color:#AAAAAA;color:#FFFFFF;$FONT$borders}
</style>
<BODY BGCOLOR="#646455">
<form action="?">
<input type=hidden name=action value="Search">
<table border=0 cellspacing=0 cellpadding=3><tr>
<td class=C colspan=2>Search</td></tr><tr>
<td class=RESULT colspan=2>$RESULT</td></tr><tr>
<td align=right>Search</td><td align=right><input type=text name=Q value=""></td></tr><tr>
<td class=F colspan=2><input type=submit value="SEARCH"></td></tr><tr>
</tr></table>
</form>
EOM
exit;
}################################# end Search
sub Playlist2{
my @playlist;
my $SHOW_TITLE = 1;
my $SHOW_SIZE = 1;
my $SHOW_MODIFIED = 1;
my $SHOW_CREATED = 0;
my $SHOW_CNT = 1;
my $COL;
my $FONT = "font-family:arial;";
my $COL1 = "background-color:#998899;";
my $COL2 = "background-color:#887788;";
my $borders = <<EOM;
border-top:solid 1px #CCCCCC;
border-left:solid 1px #CCCCCC;
border-bottom:solid 1px #333333;
border-right:solid 1px #333333
EOM
if ($GET{'flip'} =~ /^\-(.*)/){my $iz = $1;if ($iz =~ /[a-zA-Z]/){$GET{'flip'} = "";}else{$GET{'flip'} = "T";}}
my $SORT = $GET{'sortby'};
my $FLIP = $GET{'flip'};
my @fields = ("TITLE","SIZE","MODIFIED","CREATED");
my $colspan = $#fields+2;
if ($FOLDER_RECURSE){
@playlist = &RecurseMP3($MP3_BIN);
}else{
@playlist = &ReadContent($MP3_BIN,'\.mp3');
}
################## SEARCH THE PLAYLIST
if ($GET{'Q'}){
my $fnd;
my @keep;
foreach my $li(@playlist){
if ($li =~ /$GET{'Q'}/si){$fnd++;push(@keep,$li);}
}
@playlist = @keep;
}
################## SORT THE PLAYLIST?
if ($SORT){
my $cnt;
my @SORTME;
foreach my $mp3(@playlist){$cnt++;
my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat("$MP3_BIN$mp3");
my $sor;
if ($SORT eq "TITLE"){$sor = $mp3;}
if ($SORT eq "SIZE"){$sor = $size;}
if ($SORT eq "MODIFIED"){$sor = $mtime;}
if ($SORT eq "CREATED"){$sor = $ctime;}
$sor =~ s/\|/\%7C/gs;
if ($sor =~ /^[0-9]+/){$sor = $sor+1000000000000;
}else{
$sor = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".$sor;
$sor =~ s/.*(.{256})$/$1/;
$sor =~ tr/[A-Z]/[a-z]/;
}
push(@SORTME,"$sor\|$mp3");
}
my @kp;
if ($FLIP){@SORTME = reverse sort @SORTME;}else{@SORTME = sort @SORTME;}
foreach my $done(@SORTME){
$done =~ s/.*\|//;
push(@kp,$done);
}
@playlist = @kp;
}
my $smod;
if ($GET{'RESULT'}){
$smod = <<EOM;
<a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=25848374&url=?action=Playlist2" data-href="?action=Playlist2">All Songs</a> /
EOM
}
my $LIBRARY_TOTAL = $#playlist+1;
my @RECURSE_TITLE = ("Off","On");
print <<EOM;
<title>MP3 Player Playlist</title>
<style>
td.C{font-size:xx-small;background-color:#AAAAAA;color:#FFFFFF;$FONT$borders}
</style>
<BODY BGCOLOR="#646455">
<table border=0 cellspacing=0 cellpadding=3><tr>
<td class=C colspan=$colspan>MP3Player Playlist $smod<a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=25848374&url=?action=Search" data-href="?action=Search">Search Playlist</a></td></tr><tr>
<td class=RESULT colspan=$colspan>$GET{'RESULT'}</td></tr><tr>
EOM
if ($SHOW_CNT){print "<td class=C> </td>";}
foreach my $field(@fields){my $vl = eval("\$SHOW_$field");if ($vl){print "<td class=C><a href=\"?action=Playlist2&sortby=$field&flip=\-$GET{'flip'}\">$field</a></td>";}}print "</tr><tr>\n";
my $cnt;
foreach my $mp3(@playlist){$cnt++;
my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat("$MP3_BIN$mp3");
my $mp3q = $mp3;
$mp3q =~ s/\&/\%26/g;
$mp3q =~ s/\s+/\+/g;
if ($COL eq "$COL2"){$COL = "$COL1";}else{$COL = "$COL2";}
if ($SHOW_CNT){print "<td style=\"$FONT$COL$borders;font-size:xx-small;text-align:right;\">$cnt</td>\n";}
if ($SHOW_TITLE){print "<td style=\"$FONT$COL$borders;font-size:x-small;\"><a target=\"mp3Player\" href=\"?action=mp3frame&reload=y&autoStart=y&vol=100&src=$MP3_BIN_URL$mp3q\">$mp3</a></td>\n";}
if ($SHOW_SIZE){$size = &DescribeSize($size);print "<td alt=\"$MP3_BIN$mp3\" style=\"$FONT$COL$borders;font-size:xx-small;text-align:right;\">$size</td>\n";}
if ($SHOW_MODIFIED){$mtime = &Epoch2Style($mtime,"mon/dat/yr time");print "<td style=\"$FONT$COL$borders;font-size:xx-small;text-align:right;\">$mtime</td>\n";}
if ($SHOW_CREATED){$ctime = &Epoch2Style($ctime,"mon/dat/yr time");print "<td style=\"$FONT$COL$borders;font-size:xx-small;text-align:right;\">$ctime</td>\n";}
print "</tr><tr>";
}
print <<EOM;
<td colspan=$colspan> </td></tr><tr>
</table>
EOM
exit;
}################################################## end Playlist2
sub Info{
my @playlist;
if ($FOLDER_RECURSE){
@playlist = &RecurseMP3($MP3_BIN);
}else{
@playlist = &ReadContent($MP3_BIN,'\.mp3');
}
my $LIBRARY_TOTAL = $#playlist+1;
my @RECURSE_TITLE = ("Off","On");
print <<EOM;
<title>MP3 Player Info</title>
<table border=0><tr>
<td class=2>MP3 Player Info</td></tr><tr>
<td align=right>MP3_BIN:</td><td style="font-weight:bold;">$MP3_BIN</td></tr><tr>
<td align=right>TOTAL SONGS:</td><td style="font-weight:bold;">$LIBRARY_TOTAL</td></tr><tr>
<td align=right>FOLDER_RECURSE:</td><td style="font-weight:bold;">$RECURSE_TITLE[$FOLDER_RECURSE]</td></tr><tr>
</table>
EOM
foreach my $mp3(@playlist){
print "<li>$mp3\n";
}
exit;
}################################################## end Info
sub Playlist{
my @playlist;
my $SHOW_TITLE = 1;
my $SHOW_SIZE = 1;
my $SHOW_MODIFIED = 1;
my $SHOW_CREATED = 0;
my $SHOW_CNT = 1;
my $COL;
my $FONT = "font-family:arial;";
my $COL1 = "background-color:#AAAA00;";
my $COL2 = "background-color:#CCCC00;";
my $borders = <<EOM;
border-top:solid 1px #CCCCCC;
border-left:solid 1px #CCCCCC;
border-bottom:solid 1px #333333;
border-right:solid 1px #333333
EOM
if ($GET{'flip'} =~ /^\-(.*)/){my $iz = $1;if ($iz =~ /[a-zA-Z]/){$GET{'flip'} = "";}else{$GET{'flip'} = "T";}}
my $SORT = $GET{'sortby'};
my $FLIP = $GET{'flip'};
my @fields = ("TITLE","SIZE","MODIFIED","CREATED");
my $colspan = $#fields+2;
if ($FOLDER_RECURSE){
@playlist = &RecurseMP3($MP3_BIN);
}else{
@playlist = &ReadContent($MP3_BIN,'\.mp3');
}
################## SORT THE PLAYLIST?
if ($SORT){
my $cnt;
my @SORTME;
foreach my $mp3(@playlist){$cnt++;
my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat("$MP3_BIN$mp3");
my $sor;
if ($SORT eq "TITLE"){$sor = $mp3;}
if ($SORT eq "SIZE"){$sor = $size;}
if ($SORT eq "MODIFIED"){$sor = $mtime;}
if ($SORT eq "CREATED"){$sor = $ctime;}
$sor =~ s/\|/\%7C/gs;
if ($sor =~ /^[0-9]+/){$sor = $sor+1000000000000;
}else{
$sor = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".$sor;
$sor =~ s/.*(.{256})$/$1/;
$sor =~ tr/[A-Z]/[a-z]/;
}
push(@SORTME,"$sor\|$mp3");
}
my @kp;
if ($FLIP){@SORTME = reverse sort @SORTME;}else{@SORTME = sort @SORTME;}
foreach my $done(@SORTME){
$done =~ s/.*\|//;
push(@kp,$done);
}
@playlist = @kp;
}
my $LIBRARY_TOTAL = $#playlist+1;
my @RECURSE_TITLE = ("Off","On");
print <<EOM;
<title>MP3 Player Playlist</title>
<style>
td.C{font-size:xx-small;background-color:#AAAAAA;color:#FFFFFF;$FONT$borders}
</style>
<BODY BGCOLOR="#646455">
<table border=0 cellspacing=0 cellpadding=3><tr>
<td class=C colspan=$colspan>MP3Player Playlist</td></tr><tr>
EOM
if ($SHOW_CNT){print "<td class=C> </td>";}
foreach my $field(@fields){my $vl = eval("\$SHOW_$field");if ($vl){print "<td class=C><a href=\"?action=Playlist&sortby=$field&flip=\-$GET{'flip'}\">$field</a></td>";}}print "</tr><tr>\n";
my $cnt;
foreach my $mp3(@playlist){$cnt++;
my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat("$MP3_BIN$mp3");
if ($COL eq "$COL2"){$COL = "$COL1";}else{$COL = "$COL2";}
if ($SHOW_CNT){print "<td style=\"$FONT$COL$borders;font-size:xx-small;text-align:right;\">$cnt</td>\n";}
if ($SHOW_TITLE){print "<td style=\"$FONT$COL$borders;font-size:x-small;\"><a target=\"_top\" href=\"?reload=y&autoStart=y&vol=100&src=$MP3_BIN_URL$mp3\">$mp3</a></td>\n";}
if ($SHOW_SIZE){$size = &DescribeSize($size);print "<td alt=\"$MP3_BIN$mp3\" style=\"$FONT$COL$borders;font-size:xx-small;text-align:right;\">$size</td>\n";}
if ($SHOW_MODIFIED){$mtime = &Epoch2Style($mtime,"mon/dat/yr time");print "<td style=\"$FONT$COL$borders;font-size:xx-small;text-align:right;\">$mtime</td>\n";}
if ($SHOW_CREATED){$ctime = &Epoch2Style($ctime,"mon/dat/yr time");print "<td style=\"$FONT$COL$borders;font-size:xx-small;text-align:right;\">$ctime</td>\n";}
print "</tr><tr>";
}
print <<EOM;
<td colspan=$colspan> </td></tr><tr>
</table>
EOM
exit;
}################################################## end Playlist
sub DescribeSize{
my $bytes = $_[0];
my $val = 0;my $size = 0;my $kilobytes = 0;my $megabytes = 0;my $gigabytes = 0;
my $fmat = "b";
if ($bytes > 1024){$val = $bytes/1024;$fmat = "k";$kilobytes = $bytes/1024;}
if ($bytes > (1024*1024)){$val = $bytes/(1024*1024);$fmat = "M";$megabytes = $bytes/(1024*1024);}
if ($bytes > (1024*1024*1024)){$val = $bytes/(1024*1024*1024);$fmat = "G";$gigabytes = $bytes/(1024*1024*1024);}
$val =~ s/\.(.).*/\.$1/;
if (($_[0] > 0)&&($_[0] < 1025)){$val = 1;$fmat = "k";}
$val = "$val $fmat";
if ($val eq "0 b"){$val = "";}
return $val;
}#################################### end DescribeSize
sub Epoch2Style{
my $tima = $_[0];
my $template = $_[1];
my %TIM = ();
$TIM{'time'} = $tima;
$TIM{'template'} = $template;
$TIM{'date'} = localtime($TIM{'time'});
my($dow,$mon,$dat,$tim,$yer)=split(/\s+/,$TIM{'date'});
my $yr = $yer;$yr =~ s/^\d\d//;
my($hr,$min,$sec)=split(/\:/,$tim);
my $time24 = $tim;
$time24 =~ s/\D+//g;
my($hr24,$min24,$sec24)=split(/\:/,$tim);

my $mer = "am";if ($hr > 11){$mer = "pm";$hr = $hr - 12;}
$hr =~ s/^0//;
my $monthid = &GetMonthID("$mon");
my $monthvalue = "00".$monthid;
$monthvalue =~ s/.*(..)$/$1/;
my $datevalue = "00".$dat;
$datevalue =~ s/.*(..)$/$1/;
my $hrv = "00".$hr;
$hrv =~ s/.*(..)$/$1/;
my $minv = "00".$min;
$minv =~ s/.*(..)$/$1/;
$TIM{'template'} =~ s/mmm/$mon/g;
$TIM{'template'} =~ s/timestamp/$yer$monthvalue$datevalue$time24/gi;
$TIM{'template'} =~ s/month/$mon/g;
$TIM{'template'} =~ s/mon/$mon/g;
$TIM{'template'} =~ s/mm/$monthid/g;
$TIM{'template'} =~ s/mv/$monthvalue/g;
$TIM{'template'} =~ s/dd/$dat/g;
$TIM{'template'} =~ s/hv/$hrv/g;
$TIM{'template'} =~ s/hrv/$hrv/g;
$TIM{'template'} =~ s/time24/$hr24$min24$sec24/g;
$TIM{'template'} =~ s/hr24/$hr24/g;
$TIM{'template'} =~ s/min24/$min24/g;
$TIM{'template'} =~ s/sec24/$sec24/g;
$TIM{'template'} =~ s/hr/$hr/g;
$TIM{'template'} =~ s/minv/$minv/g;
$TIM{'template'} =~ s/min/$min/g;
$TIM{'template'} =~ s/sec/$sec/g;
$TIM{'template'} =~ s/mer/$mer/g;
$TIM{'template'} =~ s/datevalue/$datevalue/g;
$TIM{'template'} =~ s/datvalue/$datevalue/g;
$TIM{'template'} =~ s/datv/$datevalue/g;
$TIM{'template'} =~ s/dv/$datevalue/g;
$TIM{'template'} =~ s/date/$dat/g;
$TIM{'template'} =~ s/dat/$dat/g;
$TIM{'template'} =~ s/year/$yer/gi;
$TIM{'template'} =~ s/yr/$yr/gi;
$TIM{'template'} =~ s/yy/$yr/gi;
$TIM{'template'} =~ s/dow/$dow/g;
$TIM{'template'} =~ s/time/$tim/g;
#20040203200000
if ($TIM{'template'} =~ /mysql/){
my $monthid = &GetMonthID("$mon");
my $dateid = "00".$dat;$dateid =~ s/.*(\d\d)$/$1/;
my $hourid = "00".$hr;$hourid =~ s/.*(\d\d)$/$1/;
my $minid = "00".$min;$minid =~ s/.*(\d\d)$/$1/;
my $secid = "00".$sec;$secid =~ s/.*(\d\d)$/$1/;
my $mysql = $yer.$monthid.$dateid.$hourid.$minid.$secid;
$TIM{'template'} =~ s/mysql/$mysql/g;
}
return $TIM{'template'};
}################################ end Epoch2Style
sub GetMonthID{
my $month = $_[0];
my $month_id;
my @month_titles = ("January","February","March","April","May","June","July","August","September","October","November","December");
my $Y = 0;
foreach my $month_title(@month_titles){$Y++;
if ($month_title =~ /$month/i){$month_id = $Y;}
}
return $month_id;
}##################################### end GetMonthID
sub RecurseMP3{
my @playlist = &ReadContent($MP3_BIN,'\.mp3');
my %PLIST;
foreach my $song(@playlist){$PLIST{$song} = 1;}
my @FOLDERS = &Recurse($MP3_BIN);
my $RECURSE;
foreach my $subf(@FOLDERS){
my @subdir = &ReadContent($subf,'\.mp3');
$RECURSE .= "<li>$subf=".($#subdir+1)."\n";
my $apend = $subf;
$apend =~ s/^$MP3_BIN//;
if ($MP3_BIN =~ /\\/){$apend .= "\\";}else{$apend .= "/";}
foreach my $submp3(@subdir){
if (!$PLIST{$submp3}){push(@playlist,$apend.$submp3);}
}
}
return @playlist;
}################################################## end RecurseMP3
sub Recurse{
my $path = $_[0];
my $req = $_[1];
my @subs = ();
my @dir = &ReadContent("$path");
if ($path =~ /\\/){#### are we using the downhill slash in our path?
$path =~ s/\\+$//;
foreach my $ld(@dir){
if (-d $path."\\".$ld){
push (@subs,$path."\\".$ld);
my @asubs = &Recurse("$path\\$ld");
foreach my $ald(@asubs){if (-d $ald){push(@subs,$ald);}}
}
}
}else{#### then do it the nice unix way
$path =~ s/\/+$//;
foreach my $ld(@dir){
if (-d $path."/".$ld){
push (@subs,$path."/".$ld);
my @asubs = &Recurse("$path/$ld");
foreach my $ald(@asubs){if (-d $ald){push(@subs,$ald);}}
}
}

}
return @subs;
}####################################### end Recurse
sub ReadContent{
my $content = $_[0];
my $qrequire = $_[1];
my @content = ();
if (!$content){return;}
if (-d "$content"){
opendir Tdir, "$content";
my $dir = readdir(Tdir);
while($dir = readdir(Tdir)){chomp $dir;
if ($dir eq ".."){}else{if ($qrequire){if ($dir =~ /$qrequire/i){push (@content,"$dir");}}else{push (@content,"$dir");}}
}close Tdir;
}else{
open (FILE,$content);
#flock(FILE,LOCK_EX);
while (<FILE>){chomp $_;
push (@content,$_);
}
#flock(FILE,LOCK_UN);
close FILE;
}
return @content;
}##################################### end ReadContent
sub ReadContentOLD{
my $content = $_[0];
my @content=();
if (-d "$content"){
opendir Tdir, "$content";
my $dir = readdir(Tdir);
while($dir = readdir(Tdir)){chomp $dir;
if ($dir eq ".."){}else{push (@content,"$dir");}
}close Tdir;
}else{
open (FILE,"$content");
while (<FILE>){chomp $_;
push (@content,"$_");
}close FILE;
}
return @content;
}##################################### end ReadContent
sub readGet{
my %GET = ();
if ($ENV{'QUERY_STRING'} =~ /lastSrc\=(.*)/){$GET{'ZlastSrc'} = $1;
$GET{'ZlastSrc'} =~ tr/+/ /;
$GET{'ZlastSrc'} =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
}
if ($ENV{'QUERY_STRING'}){
my $qstring= $ENV{'QUERY_STRING'};
my @get = split(/\&/,$qstring);
foreach (@get){
my ($qname,$qvalue)=split(/=/,$_,2);
$qvalue =~ tr/+/ /;
$qvalue =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$GET{$qname} = $qvalue;
}
}
if ($ARGV[0] =~ /^\w\:[\\|\/]/){
#print "YO";
$GET{'drop'} = $ARGV[0];
$ARGV[0] = "";
foreach (@ARGV){
my @line = split(/\=/,$_,2);
if ($line[0]){
$GET{'drop'} .= ",".$line[0];
}
}
@ARGV = ();
}
if (@ARGV){
foreach (@ARGV){
my @line = split(/\=/,$_,2);
if ($line[0]){
$GET{$line[0]} = $line[1];
}
}
}
if ($GET{'ZlastSrc'}){$GET{'lastSrc'} = $GET{'ZlastSrc'};}
return %GET;
}################################
sub initENV{
my %MYENV = ();
my $this_dir = cwd."/".$0;
if ($0 =~ /^[a-zA-Z]\:/){$this_dir = $0;}
$this_dir =~ s/(.*)([\/|\\]+)[^\/|\\]+$/$1$2/;
if ($this_dir eq ""){print "Failed to find a working directory path=$this_dir\n";exit;}
$this_dir =~ s/[\/|\\]+$//;
$this_dir =~ s/\\+/\//g;
$MYENV{'this_dir'} = "$this_dir";
if ($ENV{'SERVER_NAME'}){
$MYENV{'this_cgi'} = "http://$ENV{'SERVER_NAME'}$ENV{'SCRIPT_NAME'}";
$MYENV{'this_url'} = $MYENV{'this_cgi'};
$MYENV{'this_url'} =~ s/\/[^\/]+$//;
}
return %MYENV;
}######################################## end initENV





P
17 yıl
Binbaşı

sorunu teknik destek bölümüne açmalısın buradakiler pek yardımcı olabileceğini sanmıyorum...
zira yazılım geliştirme ile ilgili bir yanıda yok sorunun :)



DH Mobil uygulaması ile devam edin. Mobil tarayıcınız ile mümkün olanların yanı sıra, birçok yeni ve faydalı özelliğe erişin. Gizle ve güncelleme çıkana kadar tekrar gösterme.