// // available at http://www.wimpyplayer.com // // ©2002-2006 plaino // // // // // // // ///////////////////////////////////////////////////////////////// // // // INSTALLATION: // // // ///////////////////////////////////////////////////////////////// // // Upload wimpy.php and wimpy.swf to the folder that // contains your mp3's. // // USE AT YOUR OWN RISK. // $wimpyVersion = "v2.2.10"; // // $wimpyConfigFile = "wimpyAVconfigs.xml"; $myWimpySWFfilename = "wimpyAV.swf"; $media_types = "xml,mp3,flv,swf"; // // If you are using multibyte characters (i.e. Chinese, Korean // or non-alpha-numeric characters set $useSysCodePage to yes. // $useSysCodePage = "yes"; $useSysCodePage = "no"; // // httpOption // Allows you to run wimpy in "https" mode; //$httpOption = "https"; $httpOption = "http"; // // blockPHPinfo // Setting this value to 'Yes' will prevent anyone // to view your phpinfo() page by adding the correct ?request to the URL. // viewing the PHP info is only used for troubleshooting first installs. $blockPHPinfo = "no"; // // fileSortOrder // Controls the sort order of how the files should be listed. // Can be set to: //"asc" - sort the files in alphabetically acending order (A-Z) //"des" - sort the files in alphabetically descenting order (Z-A) // //$fileSortOrder = "des"; $fileSortOrder = "asc"; // ///////////////////////////////////////////////////////////////// // // // Do not edit anything below here unless // // you really know what you are doing! // // // ///////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////// // //> $myDataSetup = "filename|artist|album|title|track|comments|genre|seconds|filesize|bitrate|visual"; $v108 = false; $v89 = "/"; if(!@getcwd ()){ $v32['path']['physical'] = str_replace("\\", "/", dirname(__FILE__)); } else { $v32['path']['physical'] = str_replace("\\", "/", getcwd ()); } function f1(&$array, $id, $var){ $v94 = array($var => $id); $array = array_merge ($array, $v94); } if($_SERVER['PHP_SELF']){ $v64 = FALSE; $v113 = strtolower (@$_SERVER["HTTP_USER_AGENT"]); } else { $v64 = TRUE; if($v108){ $_REQUEST = array(); $v88 = get_defined_vars(); $v0 = explode("&", $v88['argv'][0]); for($i=0;$i$v){ if($v['type'] == "complete"){ $$v['tag'] = trim(@$v['value']); } } $v110 = true; } else { $v110 = false; } $v118 = $v32['path']['www']."/".$myWimpyPHPfilename; if(!isset($wimpySwf)){ $wimpySwf = $v32['path']['www']."/".$myWimpySWFfilename; } if(!isset($wimpyApp)){ $wimpyApp = $v32['path']['www']."/".$myWimpyPHPfilename; } if(!isset($tptBkgd)){ $tptBkgd = "yes"; } if(!isset($bkgdColor)){ $bkgdColor = "000000"; } if(!isset($startDir)){ $startDir = ""; } if(!isset($hide_folders)){ $hide_folders = ".svn,_notes,goodies,playlister_output,skins,getid3,_private,_private,_vti_bin,_vti_cnf,_vti_pvt,_vti_txt,cgi-bin"; } if(!isset($hide_files)){ $hide_files = "skin.xml,wimpyConfigs.xml,wimpyAVConfigs.xml,wimpy.swf,wimpyAV.swf,wasp.swf,wimpy_button.swf"; } if(!isset($wimpyHTMLpageTitle)){ $wimpyHTMLpageTitle = "La Leche League Videos"; } if(!isset($getMyid3info)){ $getMyid3info = "no"; } if(!isset($ecommerce)){ $ecommerce = "no"; } if(!isset($v45)){ $v45 = 0; } if(!isset($v44)){ $v44 = 0; } if($v45<1 || $v44<1){ $v111 = false; $v45 = "100%"; $v44 = "100%"; } if($startDir != ""){ $v32['path']['physical'] = $startDir; $serveMP3 = "yes"; } $v32['path']['physical'] = str_replace("\\", "/", $v32['path']['physical']); $v32['path']['physical'] = str_replace("//", "/", $v32['path']['physical']); $v87 = ""; function f6($v48){ $v48 = @file("$v48"); return !$v48 ? false : implode('', $v48); } $v23 = array(); $v22 = array(); function f16($v102){ global $startDir,$v89; return (str_replace($startDir.$v89, "", $v102)); } function f0($v83, $v92="no", $v60="no"){ global $v50,$wimpyApp,$startDir,$v23,$v22,$hide_files,$getMyid3info,$defaultVisualBaseName,$defaultVisualExt,$v32,$v87,$v89,$v76,$hide_folders,$media_types,$v67,$myDataSetup; if($v83 == $v32['path']['physical'] || $v92=="yes"){ $v84 = true; } else { $v84 = false; } $v58=@opendir($v83); $v6 = array (); $v12 = array (); $v16 = array (); $v15 = array(); $v14 = explode(",",$hide_files); $v15 = explode(",",$hide_folders); $v21 = explode(",",$media_types); $v43 = 0; $v37 = $v32['path']['www']; while (false !== ($v48 = @readdir($v58))){ $v52 =($v48); $ext = explode('.',$v48); $v70 = strtolower($ext[sizeof($ext)-1]); if(!in_array($v48,$v14)){ if($v48 != '.' && $v48 != '..' && @sizeof($ext)>1 && in_array(strtolower($v70),$v21)){ if($v70 == "xml"){ if(stristr(strtolower($v48), "skin") || stristr(strtolower($v48), "config")){ $v46 = ""; } else { $v12[count($v12)]=($v48); } } else if($v70 == "pls" || $v70 == "m3u"){ $v12[count($v12)]=($v48); } else { $v12[count($v12)] = ($v48); } } else { if($v48 != '.' && $v48 != '..'){ if(!in_array($v48,$v15)){ if (false !== ($v39 = @opendir($v83.$v89.$v48))){ $v6[count($v6)] =($v48); } @closedir($v83.$v89.$v48); } } } } } @closedir($v58); natcasesort($v6); natcasesort($v12); $v7 = array_values($v6); if($v50 == "des"){ $v13 = array_values(array_reverse($v12)); } else { $v13 = array_values($v12); } for($i=0;$ianalyze($v41); getid3_lib::CopyTagsToComments($v62); } else { $v62 = array(); } $v82 = array(); if(sizeof($v62)>0){ $v82[0]=@ ($v62['comments']['artist'][0]); $v82[1]=@($v62['comments']['album'][0]); $v82[2]=@ ($v62['comments']['title'][0]); $v82[3]=@($v62['comments']['track'][0]); $v82[4]="/"; $v55 = 0; if($action == "podcast"){ $v55 = 1; } if(@strlen(@$v62['comments']['comment'][0])>@strlen(@$v62['comments']['comments'][0])){ if(@substr($v62['comments']['comment'][0],0,4)=="http" || $v55 == 1){ $v82[4]=(@$v62['comments']['comment'][0]); } } else { if(@substr($v62['comments']['comments'][0],0,4)=="http" || $v55 == 1){ $v82[4]=(@$v62['comments']['comments'][0]); } } if($v82[4] == "" || $v82[4] == "null"){ $v82[4] = "/"; } $v82[5]=(@$v62['comments']['genre'][0]); $v82[6]=(@$v62['playtime_seconds']); $v82[7]=(round(@$v62['filesize']/1000000, 2)); $v82[8]=(round(@$v62['audio']['bitrate']/1000)); } else { return 0; break; } return $v82; } function f12($theFile){ global $wimpyApp,$startDir,$defaultVisualBaseName, $defaultVisualExt, $v32, $v89; $v30 = explode(".", str_replace("/", $v89, urldecode($theFile))); array_pop($v30); if($startDir == ""){ $v30 = explode(".", $theFile); array_pop($v30); $v101 = urldecode((implode(".", $v30).".".$defaultVisualExt)); if(is_file($v101)){ return (f7($v101)); } else { return false; } } else { $v101 = (implode(".", $v30).".".$defaultVisualExt); if(strpos ($v101, $v32['path']['physical']) === false){ $v101 = $v32['path']['physical'].$v89.$v101; } if(is_file($v101)){ $v82 = str_replace ( $v32['path']['physical'], "", $v101); $v82 = str_replace ( $v89, "/", $v82); return ($wimpyApp."?action=getCoverart&theFile=".$v82); } } } function f25($v104){ global $v32, $v89, $v69,$httpOption; $v79 = str_replace($v32['path']['www'], "", $v104); $v100 = $v32['path']['physical'].$v79; $v100 = str_replace("//", "/", $v100); return $v100; } function f7($v100){ global $startDir,$v32, $v89; $v79 = str_replace($v32['path']['physical'], "", $v100); $v100 = $v32['path']['www'].$v79; $v100 = str_replace("://", "__:__", $v100); $v100 = str_replace("//", "/", $v100); $v100 = str_replace("__:__", "://", $v100); return $v100; } function f2($v49){ return ereg_replace("[^a-z0-9._]", "",str_replace(" ", "_",str_replace("%20", "_", strtolower($v49)))); } function f3($v49){ return utf8_encode($v49); } function f21($v49, $v47){ $ext = explode('.',$v49); $v70 = strtolower($ext[sizeof($ext)-1]); if(strtolower($v70) != strtolower($v47)){ return false; } else { return true; } if ((!ereg('\.\.', $v49)) && (file_exists($v49))) { return true; } else { return false; } } function f23($v91){ $v82 = $v91; $v82 = strip_tags(stripslashes($v82)); $v82 = strip_tags($v82); $v82 = str_replace("sscanf", "x", $v82); $v82 = str_replace("base64_decode", "x", $v82); $v82 = str_replace("rawurldecode", "x", $v82); $v82 = str_replace("urldecode", "x", $v82); $v82 = str_replace("0;", "x", $v82); $v82 = str_replace("%5C", "x", $v82); $v82 = str_replace("\n", "x", $v82); $v82 = str_replace("\r", "x", $v82); $v82 = str_replace("\t", "x", $v82); $v82 = str_replace("\\", "x", $v82); $v82 = ereg_replace("\.+/", "x", $v82); $v82 = ereg_replace("\.\.","x",$v82); $v82 = ereg_replace("^[\/]+", "x", $v82); return $v82; } function f20($v35){ if(@is_array($v35)){ foreach ($v35 as $key => $v115){ $v28[f23(urldecode($key))] = f23($v115); } } else { $v28 = $v35; } return $v35; } if ( @get_magic_quotes_gpc () ){ function traverse ( &$arr ){ if ( !is_array ( $arr ) ){ return; } foreach ( $arr as $key => $val ){ is_array ( $arr[$key] ) ? traverse ( $arr[$key] ) : ( $arr[$key] = stripslashes ( $arr[$key] ) ); } } $gpc = array ( &$_GET, &$_POST, &$_COOKIE, &$_REQUEST); traverse ( $gpc ); } $_REQUEST = f20($_REQUEST); $_GET = f20($_GET); $_POST = f20($_POST); $_COOKIE = f20($_COOKIE); $v3 = array( "action", "theFile", "filename", "dir", "getMyid3info", "useMysql", "queryValue", "queryWhere", "forceDownload", "defaultVisualExt", "defaultVisualBaseName", "theArtist", "theTitle", "s" ); for($i=0;$i'); array_push($v26, ''); for ($i=0; $i'); foreach ($v10[$i] as $key => $v115) { $v42 = f4($v115); array_push($v26, '<'.$key.'>'.($v42).''); } array_push($v26, ''); } array_push($v26, ''); header("Pragma: public", false); header("Expires: Thu, 19 Nov 1981 08:52:00 GMT", false); header("Cache-Control: must-revalidate, post-check=0, pre-check=0", false); header("Cache-Control: no-store, no-cache, must-revalidate", false); header("Content-Type: text/xml"); print (implode("", $v26)); exit; } function f19($v8){ $v10 = array(); for($i=0;$i'.$v86; $v53 .= ''.$v86; $v53 .= ''.$v86; $v53 .= ''.$v86; $v53 .= ''.$v86; $v53 .= ''.$v86; $v53 .= ''.$v86; $v53 .= ''.$v107.$v86; $v53 .= ''.$v86; return ($v53); } if($action=="getVersion"){ print "$wimpyVersion"; exit; } else if($action == "feedPlaylist"){ $v20 = f11(f25($theFile)); if(f21($theFile, "pls") === true || f21($theFile, "m3u") === true){ if(strtolower ($v20[0]) == "[playlist]"){ f18($v20); } else if(strtoupper ($v20[0]) == "#EXTM3U"){ f17($v20); } else { f19($v20); } } else { echo ""; exit; } } else if ($action=="phpinfo"){ if($blockPHPinfo != "yes"){ $v82 = phpinfo(); echo "$v82"; exit; } } else if($action=="getCoverart"){ $theFile = urldecode($_REQUEST['theFile']); $v100 = $startDir.str_replace("/", $v89, urldecode($theFile)); $ext = explode('.',$v100); $v70 = strtolower($ext[sizeof($ext)-1]); if(f21($v100, "jpg") === true || f21($v100, "swf") === true){ header("Expires: Thu, 19 Nov 1981 08:52:00 GMT", false); header("Content-Type: image/jpeg", false); header("Content-Length: ".@f23(@urldecode(@filesize($v100))), false); f14($v100); exit; } else { echo ""; exit; } } else if($action=="getstartupdirlist"){ header("Content-Type: text/html", false); if($getMyid3info == "yes"){ if(is_file('getid3.php')){ require ('getid3.php'); $v56 = new getID3; } else if (is_file('getid3'.$v89.'getid3.php')){ require ('getid3'.$v89.'getid3.php'); $v56 = new getID3; } else if (is_file(@$v57)){ require (@$v57); $v56 = new getID3; } else { $getMyid3info = "no"; } } $v87 = f0($v32['path']['physical']); echo (($v87)); } else if ($action=="dir"){ if($getMyid3info == "yes"){ if(is_file('getid3.php')){ require ('getid3.php'); $v56 = new getID3; } else if (is_file('getid3'.$v89.'getid3.php')){ require ('getid3'.$v89.'getid3.php'); $v56 = new getID3; } else if (is_file(@$v57)){ require (@$v57); $v56 = new getID3; } else { $getMyid3info = "no"; } } $v74 = ($v32['path']['physical'].$v89.str_replace("/", $v89, str_replace($v32['path']['www']."/", "", f23($dir)))); $v87 = f0($v74); echo ( ($v87)); exit; } else if($action=="getmysql"){ require ("wimpy.sql.php"); } else if ($action=="serveMP3"){ f22($_REQUEST['theFile'], false); } else if ($action=="downloadfile"){ f22($_REQUEST['theFile'], true); } else if ($action=="podcast"){ $v67 = "mysql"; $getMyid3info = "yes"; if(is_file('getid3.php')){ require ('getid3.php'); $v56 = new getID3; } else if (is_file('getid3'.$v89.'getid3.php')){ require ('getid3'.$v89.'getid3.php'); $v56 = new getID3; } else { print 'You have elected to use ID3 information in the playlist.
'; print 'In order to present ID3 information you must upload the getID3
'; print 'library to your wimpy folder. The files can be found in the
'; print '"goodies" folder or downloaded from the following location:
'; print 'http://www.wimpyplayer.com/resources
'; print 'Please upload all of the getID3 files to the same location as wimpy.php
'; exit; } $podBack = f0($v32['path']['physical'], "yes"); } else if($action=="writeJS"){ $v86 = "\n"; $v63 = "function f27(wimpyConfigsURL){"; $v63 .= "var myContent = '".implode("", explode($v86,f26()))."';"; $v63 .= "document.write(myContent);"; $v63 .= "}"; print ($v63); exit; } else { $v53 = ''.$v86; $v53 .= ''.$v86; $v53 .= ''.$wimpyHTMLpageTitle.''.$v86; $v53 .= ''.$v86; $v53 .= ''.$v86; $v53 .= ''.$v86; $v53 .= ' '.$v86; $v53 .= ''.$v86; $v53 .= ''.$v86; $v53 .= '
'.$v86; $v53 .= ''.$v86; $v53 .= ''.$v86; $v53 .= ''.$v86; $v53 .= ''.$v86; $v53 .= '
'.$v86; $v53 .= ''.$v86; $v53 .= ''.$v86; print ($v53); exit; } ?>