PageRenderTime 64ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/public/mod/wimpy.php

https://github.com/noonchild/rsa
PHP | 1020 lines | 973 code | 0 blank | 47 comment | 315 complexity | 6dfbd8068ccd4f04bc2b1ea740044d1f MD5 | raw file
  1. <?php
  2. if(!@session_id()){
  3. @session_start();
  4. }
  5. $wimpyVersion = "v5.2.5";
  6. //<//////////////////////////////////////////////////////////////
  7. // //
  8. // //
  9. // //
  10. // //
  11. // Wimpy MP3 Player //
  12. // //
  13. // by Mike Gieson <info@wimpyplayer.com> //
  14. // available at http://www.wimpyplayer.com //
  15. // ©2002-2005 plaino //
  16. // //
  17. // //
  18. // //
  19. /////////////////////////////////////////////////////////////////
  20. // //
  21. // INSTALLATION: //
  22. // //
  23. /////////////////////////////////////////////////////////////////
  24. //
  25. // Upload wimpy.php and wimpy.swf to the folder that
  26. // contains your mp3's.
  27. //
  28. // USE AT YOUR OWN RISK.
  29. //
  30. $wimpyConfigFile = "wimpyConfigs.xml";
  31. $myWimpySWFfilename = "wimpy.swf";
  32. $wimpy_auth = "wimpy_auth.php";
  33. $media_types = "xml,mp3,m3u,pls";
  34. // If you are using multibyte characters (i.e. Chinese, Korean
  35. // or non-alpha-numeric characters set $useSysCodePage to yes.
  36. // $useSysCodePage = "yes";
  37. $useSysCodePage = "no";
  38. //
  39. $httpOption = "http";
  40. //
  41. // Setting "blockPHPinfo" this value to 'Yes' will prevent anyone
  42. // to view your phpinfo() page by adding the correct ?request to the URL.
  43. // viewing the PHP info is only used for troubleshooting first installs.
  44. $blockPHPinfo = "yes";
  45. //
  46. /////////////////////////////////////////////////////////////////
  47. // //
  48. // Do not edit anything below here unless //
  49. // you really know what you are doing! //
  50. // //
  51. /////////////////////////////////////////////////////////////////
  52. /////////////////////////////////////////////////////////////////
  53. /////////////////////////////////////////////////////////////////
  54. /////////////////////////////////////////////////////////////////
  55. /////////////////////////////////////////////////////////////////
  56. //
  57. // NOTE: for encryption, an un-encrypted variable must follow the ending comment
  58. // (which i can't print, otheriwse it wil reckog
  59. //>
  60. $myDataSetup = "filename|artist|album|title|track|comments|genre|seconds|filesize|bitrate|visual";
  61. $v103 = false;
  62. strstr( PHP_OS, "WIN") ? $v81 = "\\" : $v81 = "/";
  63. strstr( PHP_OS, "WIN") ? $v67 = "win" : $v67 = "unix";
  64. if(!@getcwd ()){
  65. $v31['path']['physical'] = dirname(__FILE__);
  66. } else {
  67. $v31['path']['physical'] = getcwd ();
  68. }
  69. function f1(&$array, $id, $var){
  70. $v86 = array($var => $id);
  71. $array = array_merge ($array, $v86);
  72. }
  73. if($_SERVER['PHP_SELF']){
  74. $v58 = FALSE;
  75. $v108 = strtolower (@$_SERVER["HTTP_USER_AGENT"]);
  76. } else {
  77. $v58 = TRUE;
  78. if($v103){
  79. $_REQUEST = array();
  80. $v78 = get_defined_vars();
  81. $v0 = explode("&", $v78['argv'][0]);
  82. for($i=0;$i<sizeof($v0);$i++){
  83. $v1 = explode("=", $v0[$i]);
  84. f1($_REQUEST, $v1[1], $v1[0]);
  85. }
  86. } else {
  87. $v78 = get_defined_vars();
  88. $_REQUEST = $v78;
  89. }
  90. $v108 = strtolower (@$_REQUEST["HTTP_USER_AGENT"]);
  91. }
  92. if($v58){
  93. $v70 = $HTTP_SERVER_VARS['PHP_SELF'];
  94. } else {
  95. $v70 = $_SERVER['PHP_SELF'];
  96. }
  97. $v22 = explode("/", $v70);
  98. $myWimpyPHPfilename = array_pop($v22);
  99. $v69 = implode("/", $v22);
  100. if($v58){
  101. $v31['path']['www'] = $httpOption."://".$HTTP_SERVER_VARS['HTTP_HOST'].$v69;
  102. } else {
  103. $v31['path']['www'] = $httpOption."://".$_SERVER['HTTP_HOST'].$v69;
  104. }
  105. if($v40 = f5($wimpyConfigFile)){
  106. $v113 = @xml_parser_create('');
  107. @xml_parser_set_option ($v113, XML_OPTION_CASE_FOLDING, false );
  108. @xml_parse_into_struct($v113, $v40, $v109, $v56);
  109. @xml_parser_free($v113);
  110. foreach ($v109 as $k=>$v){
  111. if($v['type'] == "complete"){
  112. $$v['tag'] = trim(@$v['value']);
  113. }
  114. }
  115. }
  116. if(!isset($wimpySwf)){
  117. $wimpySwf = $v31['path']['www']."/".$myWimpySWFfilename;
  118. }
  119. if(!isset($wimpyApp)){
  120. $wimpyApp = $v31['path']['www']."/".$myWimpyPHPfilename;
  121. }
  122. if(!isset($wimpySkin)){
  123. $wimpySkin = "";
  124. }
  125. if(!isset($trackPlays)){
  126. $trackPlays = "";
  127. }
  128. if(!isset($voteScript)){
  129. $voteScript = "";
  130. }
  131. if(!isset($defaultImage)){
  132. $defaultImage = "";
  133. }
  134. if(!isset($startPlayingOnload)){
  135. $startPlayingOnload = "yes";
  136. }
  137. if(!isset($shuffleOnLoad)){
  138. $shuffleOnLoad = "no";
  139. }
  140. if(!isset($randomOnLoad)){
  141. $randomOnLoad = "no";
  142. }
  143. if(!isset($displayDownloadButton)){
  144. $displayDownloadButton = "no";
  145. }
  146. if(!isset($forceDownload)){
  147. $forceDownload = "no";
  148. }
  149. if(!isset($startOnTrack)){
  150. $startOnTrack = "";
  151. }
  152. if(!isset($autoAdvance)){
  153. $autoAdvance = "yes";
  154. }
  155. if(!isset($popUpHelp)){
  156. $popUpHelp = "yes";
  157. }
  158. if(!isset($getMyid3info)){
  159. $getMyid3info = "no";
  160. }
  161. if(!isset($serveMP3)){
  162. $serveMP3 = "no";
  163. }
  164. if(!isset($loopPlaylist)){
  165. $loopPlaylist = "off";
  166. }
  167. if(!isset($forceXMLplaylist)){
  168. $forceXMLplaylist = "no";
  169. }
  170. if(!isset($useSysCodePage)){
  171. $useSysCodePage = "no";
  172. }
  173. if(!isset($ecommerce)){
  174. $ecommerce = "no";
  175. }
  176. if(!isset($useMysql)){
  177. $useMysql = "no";
  178. }
  179. if(!isset($tptBkgd)){
  180. $tptBkgd = "yes";
  181. }
  182. if(!isset($startDir)){
  183. $startDir = "";
  184. }
  185. if(!isset($defaultVisualExt)){
  186. $defaultVisualExt = "jpg";
  187. }
  188. if(!isset($scrollInfoDisplay)){
  189. $scrollInfoDisplay = "yes";
  190. }
  191. if(!isset($infoDisplayTime)){
  192. $infoDisplayTime = 3;
  193. }
  194. if(!isset($bufferAudio)){
  195. $bufferAudio = 3;
  196. }
  197. if(!isset($theVolume)){
  198. $theVolume = 100;
  199. }
  200. if(!isset($bkgdColor)){
  201. $bkgdColor = "000000";
  202. }
  203. if(!isset($ecomWindow)){
  204. $ecomWindow = "_BLANK";
  205. }
  206. if(!isset($defaultVisualBaseName)){
  207. $defaultVisualBaseName = "coverart";
  208. }
  209. if(!isset($hide_folders)){
  210. $hide_folders = "goodies,playlister_output,skins,getid3,_private,_private,_vti_bin,_vti_cnf,_vti_pvt,_vti_txt,cgi-bin";
  211. }
  212. if(!isset($hide_files)){
  213. $hide_files = "skin.xml,wimpyConfigs.xml";
  214. }
  215. if(!isset($wimpyHTMLpageTitle)){
  216. $wimpyHTMLpageTitle = "Wimpy Player";
  217. }
  218. if($ecommerce == "yes"){
  219. $forceDownload = "no";
  220. $displayDownloadButton = "yes";
  221. $getMyid3info = "yes";
  222. }
  223. $v106 = true;
  224. $v80 = 0;
  225. $v79 = 0;
  226. if(strlen(@$wimpySkin)>4){
  227. if($v40 = f5($wimpySkin)){
  228. $v114 = @xml_parser_create('');
  229. @xml_parse_into_struct($v114, $v40, $v109, $v56);
  230. @xml_parser_free($v114);
  231. $v80 = @$v109[@$v56['BKGD_MAIN'][0]]['attributes']['WIDTH'];
  232. $v79 = @$v109[@$v56['BKGD_MAIN'][0]]['attributes']['HEIGHT'];
  233. } else {
  234. $v106 = false;
  235. }
  236. } else {
  237. $v106 = false;
  238. }
  239. if($v80<1 || $v79<1){
  240. $v106 = false;
  241. $v80 = "480";
  242. $v79 = "140";
  243. }
  244. $v77 = "";
  245. function f22($v68){
  246. global $v31;
  247. return $v68;
  248. }
  249. function f5($v45){
  250. $v45 = @file("$v45");
  251. return !$v45 ? false : implode('', $v45);
  252. }
  253. $v21 = array();
  254. $v20 = array();
  255. function f13($v96){
  256. global $startDir,$v81;
  257. return (str_replace($startDir.$v81, "", $v96));
  258. }
  259. function f0($v74, $v84="no", $v55="no"){
  260. global $wimpyApp,$startDir,$v21,$v20,$hide_files,$getMyid3info,$defaultVisualBaseName,$defaultVisualExt,$v31,$v77,$v81,$v69,$hide_folders,$media_types,$v62,$myDataSetup;
  261. if($v74 == $v31['path']['physical'] || $v84=="yes"){
  262. $v75 = true;
  263. } else {
  264. $v75 = false;
  265. }
  266. $v53=opendir($v74);
  267. $v6 = array ();
  268. $v10 = array ();
  269. $v14 = array ();
  270. $v13 = array();
  271. $v12 = explode(",",$hide_files);
  272. $v13 = explode(",",$hide_folders);
  273. $v19 = explode(",",$media_types);
  274. $v41 = 0;
  275. $v35 = $v31['path']['www'];
  276. while (false !== ($v45 = readdir($v53))){
  277. $v48 =($v45);
  278. $ext = explode('.',$v45);
  279. $v64 = strtolower($ext[sizeof($ext)-1]);
  280. if(!in_array($v45,$v12)){
  281. if($v45 != '.' && $v45 != '..' && @sizeof($ext)>1 && in_array(strtolower($v64),$v19)){
  282. if($v64 == "xml"){
  283. if(stristr(strtolower($v45), "skin") || stristr(strtolower($v45), "config")){
  284. $v43 = "";
  285. } else {
  286. $v10[count($v10)]=($v45);
  287. }
  288. } else if($v64 == "pls" || $v64 == "m3u"){
  289. $v10[count($v10)]=($v45);
  290. } else {
  291. $v10[count($v10)] = ($v45);
  292. }
  293. } else {
  294. if($v45 != '.' && $v45 != '..'){
  295. if(!in_array($v45,$v13)){
  296. if (false !== ($v37 = @opendir($v74.$v81.$v45))){
  297. $v6[count($v6)] =($v45);
  298. }
  299. @closedir($v74.$v81.$v45);
  300. }
  301. }
  302. }
  303. }
  304. }
  305. closedir($v53);
  306. natcasesort($v6);
  307. natcasesort($v10);
  308. $v7 = array_values($v6);
  309. $v11 = array_values($v10);
  310. for($i=0;$i<sizeof($v7);$i++){
  311. $v87 = (f3($v7[$i]));
  312. $v7[$i]=f6($v74.$v81.$v87)."||||";
  313. $v41++;
  314. }
  315. for($i=0;$i<sizeof($v11);$i++){
  316. $v87 = (f3($v11[$i]));
  317. $ext = explode('.',$v87);
  318. $v64 = strtolower($ext[sizeof($ext)-1]);
  319. if($v64 == "pls" || $v64 == "m3u"){
  320. $v11[$i]=$wimpyApp."%3Faction%3DfeedPlaylist%26theFile%3D".f6($v74.$v81.$v87)."||||";
  321. } else {
  322. $v11[$i]=f6($v74.$v81.$v87)."|".(f10 ($v74.$v81.$v87, "full"));
  323. }
  324. }
  325. if($v62 == "mysql"){
  326. if(sizeof($v11)){
  327. for($i=0;$i<sizeof($v11); $i++){
  328. array_push ($v14,($v11[$i]));
  329. }
  330. }
  331. return $v14;
  332. } else {
  333. if(sizeof($v7)){
  334. for($i=0;$i<sizeof($v7); $i++){
  335. array_push ($v14, ($v7[$i]));
  336. }
  337. }
  338. if(sizeof($v11)){
  339. for($i=0;$i<sizeof($v11); $i++){
  340. array_push ($v14, ($v11[$i]));
  341. }
  342. }
  343. for($i=0;$i<sizeof($v14);$i++){
  344. $v77 .= "&item".$i."=".($v14[$i]);
  345. }
  346. $v100 = sizeof ($v14);
  347. if($startDir == ""){
  348. $v112 = $v74.$v81.$defaultVisualBaseName.".".$defaultVisualExt;
  349. if (is_file($v112)){
  350. $v111 = "&visualURL=".(f6($v112));
  351. } else {
  352. $v111 = "";
  353. }
  354. } else {
  355. $v112 = $v74.$v81.$defaultVisualBaseName.".".$defaultVisualExt;
  356. if(is_file($v112)){
  357. $v73 = str_replace ( $v31['path']['physical'], "", $v112);
  358. $v73 = str_replace ( $v81, "/", $v73);
  359. $v111 = "&visualURL=".($wimpyApp."%3Faction%3DgetCoverart%26theFile%3D".$v73);
  360. } else {
  361. $v111 = "";
  362. }
  363. }
  364. $v77 .= "&totalitems=$v100".$v111;
  365. $v77 .= "&datasetup=$myDataSetup";
  366. return $v77;
  367. clearstatcache();
  368. }
  369. }
  370. function asc2hex ($v97) {
  371. $v85 = $v97;
  372. $v40 = "";
  373. for ($i=0; $i<strlen($v85); $i++){
  374. $char = substr($v85,$i,1);
  375. if(!ereg('[A-Za-z0-9|/:.^]', $char)){
  376. $v40 .= rawurlencode(f20(ord($char)));
  377. }else{
  378. $v40.=$char;
  379. }
  380. }
  381. return $v40;
  382. }
  383. function f20($dec) {
  384. if ($dec < 128) {
  385. $utf = chr($dec);
  386. } else if ($dec < 2048) {
  387. $utf = chr(192 + (($dec - ($dec % 64)) / 64));
  388. $utf .= chr(128 + ($dec % 64));
  389. } else {
  390. $utf = chr(224 + (($dec - ($dec % 4096)) / 4096));
  391. $utf .= chr(128 + ((($dec % 4096) - ($dec % 64)) / 64));
  392. $utf .= chr(128 + ($dec % 64));
  393. }
  394. return $utf;
  395. }
  396. function f3($v97){
  397. global $v67;
  398. if($v67 == "win"){
  399. return asc2hex ($v97);
  400. } else {
  401. return rawurlencode($v97);
  402. }
  403. }
  404. function f10($v93, $v104=""){
  405. global $v31,$v81,$v33,$getMyid3info,$v63;
  406. @set_time_limit(30);
  407. @flush();
  408. $v64 = explode(".", $v93);
  409. if ($getMyid3info=="yes" && strtolower($v64[sizeof($v64)-1]) != "xml"){
  410. $v73 = f7($v93);
  411. } else {
  412. $v73 = array();
  413. $v73[0]="";
  414. $v73[1]="";
  415. $v73[2]="";
  416. $v73[3]="";
  417. $v73[4]="";
  418. $v73[5]="";
  419. $v73[6]="";
  420. $v73[7]="";
  421. $v73[8]="";
  422. }
  423. for($i=0;$i<sizeof($v73);$i++){
  424. $v73[$i] = f3($v73[$i], "display");
  425. }
  426. $v25 = explode($v81,$v93);
  427. $v90 = $v25[sizeof($v25)-1];
  428. $v27=explode('.',$v90);
  429. $v91 = $v27[sizeof($v27)-2];
  430. if($v73[0]=="" || $v73[0]==null){
  431. $v73[0] = ($v91);
  432. }
  433. if($v73[2]=="" || $v73[2]==null){
  434. $v73[2] = ($v91);
  435. }
  436. $v73[9] = f3(f9($v93));
  437. return ((implode ("|", $v73)));
  438. }
  439. function f7($v93){
  440. global $startDir,$getMyid3info,$v31, $v81, $v51, $action;
  441. $v39 = urldecode($v93);
  442. if($getMyid3info == "yes"){
  443. $v57 = $v51->analyze($v39);
  444. getid3_lib::CopyTagsToComments($v57);
  445. } else {
  446. $v57 = array();
  447. }
  448. $v73 = array();
  449. if(sizeof($v57)>0){
  450. $v73[0]=@ ($v57['comments']['artist'][0]);
  451. $v73[1]=@($v57['comments']['album'][0]);
  452. $v73[2]=@ ($v57['comments']['title'][0]);
  453. $v73[3]=@($v57['comments']['track'][0]);
  454. $v73[4]="/";
  455. $v50 = 0;
  456. if($action == "podcast"){
  457. $v50 = 1;
  458. }
  459. if(@strlen(@$v57['comments']['comment'][1])>@strlen(@$v57['comments']['comment'][0])){
  460. if(@substr($v57['comments']['comment'][1],0,4)=="http" || $v50 == 1){
  461. $v73[4]=(@$v57['comments']['comment'][1]);
  462. }
  463. } else {
  464. if(@substr($v57['comments']['comment'][0],0,4)=="http" || $v50 == 1){
  465. $v73[4]=(@$v57['comments']['comment'][0]);
  466. }
  467. }
  468. if($v73[4] == "" || $v73[4] == "null"){
  469. $v73[4] = "/";
  470. }
  471. $v73[5]=(@$v57['comments']['genre'][0]);
  472. $v73[6]=(@$v57['playtime_seconds']);
  473. $v73[7]=(round(@$v57['filesize']/1000000, 2));
  474. $v73[8]=(round(@$v57['audio']['bitrate']/1000));
  475. } else {
  476. return 0;
  477. break;
  478. }
  479. return $v73;
  480. }
  481. function f9($theFile){
  482. global $wimpyApp,$startDir,$defaultVisualBaseName, $defaultVisualExt, $v31, $v81;
  483. $v26 = explode(".", str_replace("/", $v81, urldecode($theFile)));
  484. array_pop($v26);
  485. if($startDir == ""){
  486. $v26 = explode(".", $theFile);
  487. array_pop($v26);
  488. $v95 = urldecode((implode(".", $v26).".".$defaultVisualExt));
  489. if(is_file($v95)){
  490. return (f6($v95));
  491. } else {
  492. return false;
  493. }
  494. } else {
  495. $v95 = (implode(".", $v26).".".$defaultVisualExt);
  496. if(strpos ($v95, $v31['path']['physical']) === false){
  497. $v95 = $v31['path']['physical'].$v81.$v95;
  498. }
  499. if(is_file($v95)){
  500. $v73 = str_replace ( $v31['path']['physical'], "", $v95);
  501. $v73 = str_replace ( $v81, "/", $v73);
  502. return ($wimpyApp."?action=getCoverart&theFile=".$v73);
  503. }
  504. }
  505. }
  506. function f21($v98){
  507. global $v31, $v81;
  508. $v26 = explode ("/", $v98);
  509. $v92 = array_pop($v26);
  510. $v30 = explode ("/", $v31['path']['www']);
  511. $v28 = array_values (array_diff ($v26, $v30));
  512. if($v28){
  513. $v88 = $v31['path']['physical'].$v81.implode($v81, $v28).$v81.$v92;
  514. } else {
  515. $v88 = $v31['path']['physical'].implode($v81, $v28).$v81.$v92;
  516. }
  517. return $v88;
  518. }
  519. function f6($v94){
  520. global $startDir,$v31, $v81;
  521. $v26 = explode ($v81, $v94);
  522. $v92 = array_pop($v26);
  523. $v29 = explode ($v81, $v31['path']['physical']);
  524. $v28 = array_values (array_diff ($v26, $v29));
  525. if($v28){
  526. $v89 = "/".implode("/", $v28)."/".$v92;
  527. } else {
  528. $v89 = implode("/", $v28)."/".$v92;
  529. }
  530. return ($v31['path']['www']."$v89");
  531. }
  532. function f2($v46){
  533. return ereg_replace("[^a-z0-9._]", "",str_replace(" ", "_",str_replace("%20", "_", strtolower($v46))));
  534. }
  535. function f18($v46, $v44){
  536. $ext = explode('.',$v46);
  537. $v64 = strtolower($ext[sizeof($ext)-1]);
  538. if(strtolower($v64) != strtolower($v44)){
  539. print ("no media selected");
  540. exit;
  541. return false;
  542. } else {
  543. return true;
  544. }
  545. if ((!ereg('\.\.', $v46)) && (file_exists($v46))) {
  546. return true;
  547. } else {
  548. print ("no media selected");
  549. exit;
  550. return false;
  551. }
  552. }
  553. function f19($v83){
  554. $v73 = $v83;
  555. $v73 = strip_tags(stripslashes($v73));
  556. $v73 = strip_tags($v73);
  557. $v73 = str_replace("\n", "x", $v73);
  558. $v73 = str_replace("\r", "x", $v73);
  559. $v73 = str_replace("\t", "x", $v73);
  560. $v73 = str_replace("\\", "x", $v73);
  561. $v73 = ereg_replace("\.+/", "x", $v73);
  562. $v73 = ereg_replace("\.\.","x",$v73);
  563. $v73 = ereg_replace("^[\/]+", "x", $v73);
  564. return $v73;
  565. }
  566. function f17($v34){
  567. if(@is_array($v34)){
  568. foreach ($v34 as $key => $v110){
  569. $v24[f19(urldecode($key))] = f19($v110);
  570. }
  571. } else {
  572. $v24 = $v34;
  573. }
  574. return $v34;
  575. }
  576. $_REQUEST = f17($_REQUEST);
  577. $v2 = array(
  578. "action",
  579. "theFile",
  580. "filename",
  581. "dir",
  582. "getMyid3info",
  583. "useMysql",
  584. "queryValue",
  585. "queryWhere",
  586. "forceDownload",
  587. "defaultVisualExt",
  588. "theArtist",
  589. "theTitle",
  590. "s"
  591. );
  592. for($i=0;$i<sizeof($v2);$i++){
  593. $var = $v2[$i];
  594. if(!isset($_REQUEST[$var])){
  595. if(!isset($$var)){
  596. $$var = "";
  597. }
  598. } else {
  599. $$var = $_REQUEST[$var];
  600. }
  601. }
  602. if($useMysql=="yes"){
  603. $action = "getmysql";
  604. }
  605. if(is_file($wimpy_auth)){
  606. $v105 = TRUE;
  607. require ($wimpy_auth);
  608. }
  609. function f11($v47){
  610. $v38 = 1*(1024*1024);
  611. $v36 = '';
  612. $cnt =0;
  613. $v53 = fopen($v47, 'rb');
  614. if ($v53 === false) {
  615. return false;
  616. }
  617. while (!feof($v53)) {
  618. $v36 = fread($v53, $v38);
  619. echo $v36;
  620. }
  621. $v82 = fclose($v53);
  622. return $v82;
  623. }
  624. if($startDir != ""){
  625. $v31['path']['physical'] = $startDir;
  626. $serveMP3 = "yes";
  627. }
  628. function f8($v47){
  629. $v38 = 1*(1024*1024);
  630. $v36 = '';
  631. $cnt = 0;
  632. $v53 = fopen($v47, 'r');
  633. if ($v53 === false) {
  634. return false;
  635. }
  636. while (!feof($v53)) {
  637. $v36 = fread($v53, $v38);
  638. }
  639. $v82 = fclose($v53);
  640. $v4 = explode("\n", $v36);
  641. $v5 = array();
  642. foreach($v4 as $v59){
  643. $v60 = trim($v59);
  644. if($v60 !== ""){
  645. array_push($v5, $v60);
  646. }
  647. }
  648. return $v5;
  649. }
  650. function f4($v9){
  651. $v23 = array();
  652. array_push($v23, '<'.urldecode("%3F").'xml version="1.0"'.urldecode("%3F").'>');
  653. array_push($v23, '<playlist>');
  654. for ($i=0; $i<sizeof($v9); $i++) {
  655. array_push($v23, '<item>');
  656. foreach ($v9[$i] as $key => $v110) {
  657. $v40 = f3($v110);
  658. array_push($v23, '<'.$key.'>'.($v40).'</'.$key.'>');
  659. }
  660. array_push($v23, '</item>');
  661. }
  662. array_push($v23, '</playlist>');
  663. header("Pragma: public");
  664. header("Expires: Thu, 19 Nov 1981 08:52:00 GMT");
  665. header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
  666. header("Cache-Control: no-store, no-cache, must-revalidate");
  667. header("Content-Type: text/xml");
  668. print (implode("", $v23));
  669. exit;
  670. }
  671. function f16($v8){
  672. $v9 = array();
  673. for($i=0;$i<sizeof($v8);$i++){
  674. $v32 = array();
  675. $v32['filename'] = $v8[$i];
  676. $v32['artist'] = "";
  677. $v32['album'] = "";
  678. $v32['title'] = "";
  679. $v32['track'] = "";
  680. $v32['comments'] = "";
  681. $v32['genre'] = "";
  682. $v32['seconds'] = "";
  683. $v32['filesize'] = "";
  684. $v32['bitrate'] = "";
  685. $v32['visual'] = "";
  686. $v9[$i] = $v32;
  687. }
  688. f4($v9);
  689. }
  690. function f14($v8){
  691. $v9 = array();
  692. for($i=0;$i<sizeof($v8);$i++){
  693. $v65 = $v8[$i];
  694. if(stristr($v65, '#EXTINF:')){
  695. $v15 = explode(":", $v65);
  696. $v16 = explode(",", $v15[1]);
  697. $v32 = array();
  698. $v32['filename'] = $v8[$i+1];
  699. $v32['artist'] = "";
  700. $v32['album'] = "";
  701. $v32['title'] = $v16[1];;
  702. $v32['track'] = "";
  703. $v32['comments'] = "";
  704. $v32['genre'] = "";
  705. $v32['seconds'] = $v16[0];
  706. $v32['filesize'] = "";
  707. $v32['bitrate'] = "";
  708. $v32['visual'] = "";
  709. $v9[sizeof($v9)] = $v32;
  710. $i++;
  711. }
  712. }
  713. f4($v9);
  714. }
  715. function f15($v8){
  716. $v9 = array();
  717. for($i=0;$i<sizeof($v8);$i++){
  718. $v65 = $v8[$i];
  719. if(strtolower(substr($v65, 0, 4)) == "file"){
  720. $v15 = explode("=", $v65);
  721. $v16 = explode("=", $v8[$i+1]);
  722. $v17 = explode("=", $v8[$i+2]);
  723. $v32 = array();
  724. $v32['filename'] = $v15[1];
  725. $v32['artist'] = "";
  726. $v32['album'] = "";
  727. $v32['title'] = $v16[1];;
  728. $v32['track'] = "";
  729. $v32['comments'] = "";
  730. $v32['genre'] = "";
  731. $v32['seconds'] = $v17[1];
  732. $v32['filesize'] = "";
  733. $v32['bitrate'] = "";
  734. $v32['visual'] = "";
  735. $i++;
  736. $i++;
  737. $v9[sizeof($v9)] = $v32;
  738. }
  739. }
  740. f4($v9);
  741. }
  742. if($action=="getVersion"){
  743. print "$wimpyVersion";
  744. exit;
  745. } else if($action == "feedPlaylist"){
  746. $v18 = f8(f21($theFile));
  747. if(strtolower ($v18[0]) == "[playlist]"){
  748. f15($v18);
  749. } else if(strtoupper ($v18[0]) == "#EXTM3U"){
  750. f14($v18);
  751. } else {
  752. f16($v18);
  753. }
  754. } else if ($action=="phpinfo"){
  755. if($blockPHPinfo != "yes"){
  756. $v73 = phpinfo();
  757. echo "$v73";
  758. exit;
  759. }
  760. } else if($action=="getCoverart"){
  761. $theFile = urldecode($_REQUEST['theFile']);
  762. $v88 = $startDir.str_replace("/", $v81, urldecode($theFile));
  763. $ext = explode('.',$v88);
  764. $v64 = strtolower($ext[sizeof($ext)-1]);
  765. if(f18($v88, "jpg") === true || f18($v88, "swf") === true){
  766. header("Expires: Thu, 19 Nov 1981 08:52:00 GMT");
  767. header("Content-Type: image/jpeg");
  768. header("Content-Length: ".@f19(@urldecode(@filesize($v88))));
  769. f11($v88);
  770. exit;
  771. } else {
  772. return "";
  773. exit;
  774. }
  775. } else if($action=="getstartupdirlist"){
  776. header("Content-Type: text/html");
  777. header("charset: UTF-8");
  778. if($getMyid3info == "yes"){
  779. if(is_file('getid3.php')){
  780. require ('getid3.php');
  781. $v51 = new getID3;
  782. } else if (is_file('getid3'.$v81.'getid3.php')){
  783. require ('getid3'.$v81.'getid3.php');
  784. $v51 = new getID3;
  785. } else if (is_file(@$v52)){
  786. require (@$v52);
  787. $v51 = new getID3;
  788. } else {
  789. $getMyid3info = "no";
  790. }
  791. }
  792. $v77 = f0($v31['path']['physical']);
  793. echo (($v77));
  794. } else if ($action=="dir"){
  795. if($getMyid3info == "yes"){
  796. if(is_file('getid3.php')){
  797. require ('getid3.php');
  798. $v51 = new getID3;
  799. } else if (is_file('getid3'.$v81.'getid3.php')){
  800. require ('getid3'.$v81.'getid3.php');
  801. $v51 = new getID3;
  802. } else if (is_file(@$v52)){
  803. require (@$v52);
  804. $v51 = new getID3;
  805. } else {
  806. $getMyid3info = "no";
  807. }
  808. }
  809. $v66 = ($v31['path']['physical'].$v81.str_replace("/", $v81, str_replace($v31['path']['www']."/", "", f19($dir))));
  810. $v77 = f0($v66);
  811. echo ( ($v77));
  812. exit;
  813. } else if($action=="getmysql"){
  814. require ("wimpy_mysql_get.php");
  815. } else if($action == "updateMySQL"){
  816. $v62 = "mysql";
  817. $getMyid3info = "yes";
  818. if(is_file('getid3.php')){
  819. require ('getid3.php');
  820. $v51 = new getID3;
  821. } else if (is_file('getid3'.$v81.'getid3.php')){
  822. require ('getid3'.$v81.'getid3.php');
  823. $v51 = new getID3;
  824. } else {
  825. print 'You have elected to use ID3 information in the playlist.<br>';
  826. print 'In order to present ID3 information you must upload the getID3<br>';
  827. print 'library to your wimpy folder. The files can be found in the <br>';
  828. print '"goodies" folder or downloaded from the following location:<br>';
  829. print 'http://www.wimpyplayer.com/resources<br>';
  830. print 'Please upload all of the getID3 files to the same location as wimpy.php<br>';
  831. exit;
  832. }
  833. print "<b>Checking the mp3 directory specified in wimpy_mysql_conf.php configs</b><br>";
  834. $AMySQLsendback = f0($v31['path']['physical'], "yes");
  835. } else if ($action=="serveMP3"){
  836. $theFile = f19($_REQUEST['theFile']);
  837. @f18($theFile, "mp3");
  838. if($startDir == ""){
  839. $v88 = f21(urldecode($theFile));
  840. } else {
  841. $v88 = $v31['path']['physical'].$v81.(str_replace($v31['path']['www']."/", "", f19($_REQUEST['theFile'])));
  842. }
  843. $v88 = str_replace("/", $v81, $v88);
  844. header("Pragma: public");
  845. header("Expires: Thu, 19 Nov 1981 08:52:00 GMT");
  846. header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
  847. header("Cache-Control: no-store, no-cache, must-revalidate");
  848. header("Content-Type: audio/x-mpeg, audio/x-mpeg-3, audio/mpeg3");
  849. header("Content-Length: ".@f19(@urldecode(@filesize($v88))));
  850. f11($v88);
  851. exit;
  852. } else if ($action=="downloadfile"){
  853. $theFile = f19($_REQUEST['theFile']);
  854. @f18($theFile, "mp3");
  855. $v88 = f21(urldecode($theFile));
  856. if($startDir == ""){
  857. $v88 = f21(urldecode($theFile));
  858. } else {
  859. $v88 = $v31['path']['physical'].$v81.(str_replace($v31['path']['www']."/", "", f19($_REQUEST['theFile'])));
  860. }
  861. $v3 = explode (".", basename($v88));
  862. $v99 = array_pop($v3);
  863. if(strtolower($v99) != "mp3"){
  864. $v42 = basename($v88).".mp3";
  865. } else {
  866. $v42 = basename($v88);
  867. }
  868. header("Pragma: public");
  869. header("Expires: Thu, 19 Nov 1981 08:52:00 GMT");
  870. header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
  871. header("Cache-Control: no-store, no-cache, must-revalidate");
  872. header("Cache-Control: private");
  873. header("Content-Type: audio/x-mpeg, audio/x-mpeg-3, audio/mpeg3");
  874. header( 'Content-Disposition: attachment; filename="'.$v42.'"' );
  875. header("Content-Transfer-Encoding: binary");
  876. header("Content-Length: ".filesize($v88));
  877. f11($v88);
  878. exit;
  879. } else if ($action=="podcast"){
  880. $v62 = "mysql";
  881. $getMyid3info = "yes";
  882. if(is_file('getid3.php')){
  883. require ('getid3.php');
  884. $v51 = new getID3;
  885. } else if (is_file('getid3'.$v81.'getid3.php')){
  886. require ('getid3'.$v81.'getid3.php');
  887. $v51 = new getID3;
  888. } else {
  889. print 'You have elected to use ID3 information in the playlist.<br>';
  890. print 'In order to present ID3 information you must upload the getID3<br>';
  891. print 'library to your wimpy folder. The files can be found in the <br>';
  892. print '"goodies" folder or downloaded from the following location:<br>';
  893. print 'http://www.wimpyplayer.com/resources<br>';
  894. print 'Please upload all of the getID3 files to the same location as wimpy.php<br>';
  895. exit;
  896. }
  897. $podBack = f0($v31['path']['physical'], "yes");
  898. } else {
  899. $v71 = "";
  900. $v71 .= $wimpySwf;
  901. $v71 .= "?wimpyApp=".$wimpyApp;
  902. if($v106){
  903. $v71 .= "&wimpySkin=".$wimpySkin;
  904. }
  905. if($trackPlays != ""){
  906. $v71 .= "&trackPlays=".$trackPlays;
  907. }
  908. if($voteScript != ""){
  909. $v71 .= "&voteScript=".$voteScript;
  910. }
  911. if($defaultImage != ""){
  912. $v71 .= "&defaultImage=".$defaultImage;
  913. }
  914. if($startOnTrack != ""){
  915. $v71 .= "&startOnTrack=".$startOnTrack;
  916. }
  917. if($startPlayingOnload == "yes"){
  918. $v71 .= "&startPlayingOnload=".$startPlayingOnload;
  919. }
  920. if($shuffleOnLoad == "yes"){
  921. $v71 .= "&shuffleOnLoad=".$shuffleOnLoad;
  922. }
  923. if($randomOnLoad == "yes"){
  924. $v71 .= "&randomOnLoad=".$randomOnLoad;
  925. }
  926. if($displayDownloadButton == "yes"){
  927. $v71 .= "&displayDownloadButton=".$displayDownloadButton;
  928. }
  929. if($forceDownload == "yes"){
  930. $v71 .= "&forceDownload=".$forceDownload;
  931. }
  932. if($popUpHelp == "yes"){
  933. $v71 .= "&popUpHelp=".$popUpHelp;
  934. }
  935. if($getMyid3info == "yes"){
  936. $v71 .= "&getMyid3info=".$getMyid3info;
  937. }
  938. if($autoAdvance == "no"){
  939. $v71 .= "&autoAdvance=".$autoAdvance;
  940. }
  941. if($serveMP3 == "yes"){
  942. $v71 .= "&serveMP3=".$serveMP3;
  943. }
  944. if($loopPlaylist == "one" || $loopPlaylist == "all"){
  945. $v71 .= "&loopPlaylist=".$loopPlaylist;
  946. }
  947. if($forceXMLplaylist == "yes"){
  948. $v71 .= "&forceXMLplaylist=".$forceXMLplaylist;
  949. }
  950. if($useSysCodePage == "yes"){
  951. $v71 .= "&useSysCodePage=".$useSysCodePage;
  952. }
  953. if($ecommerce == "yes"){
  954. $v71 .= "&ecommerce=".$ecommerce;
  955. }
  956. if($useMysql == "yes"){
  957. $v71 .= "&useMysql=".$useMysql;
  958. }
  959. if($defaultVisualExt == "swf"){
  960. $v71 .= "&defaultVisualExt=".$defaultVisualExt;
  961. }
  962. if($scrollInfoDisplay == "yes"){
  963. $v71 .= "&scrollInfoDisplay=".$scrollInfoDisplay;
  964. }
  965. if($infoDisplayTime != ""){
  966. $v71 .= "&infoDisplayTime=".$infoDisplayTime;
  967. }
  968. if($bufferAudio != ""){
  969. $v71 .= "&bufferAudio=".$bufferAudio;
  970. }
  971. if($theVolume != "" && $theVolume <= 100 && $theVolume >= 0){
  972. $v71 .= "&theVolume=".$theVolume;
  973. }
  974. if($ecomWindow != ""){
  975. $v71 .= "&ecomWindow=".$ecomWindow;
  976. }
  977. if($bkgdColor == ""){
  978. $bkgdColor = "000000";
  979. }
  980. if($tptBkgd == "yes"){
  981. $v71 .= "&tptBkgd=".$tptBkgd;
  982. $v107 = true;
  983. } else {
  984. $v107 = false;
  985. }
  986. $v76 = "\r\n";
  987. if($v107){
  988. $v101 = 'wmode="transparent" ';
  989. $v102 = '<param name="wmode" value="transparent" />'.$v76;
  990. } else {
  991. $v101 = "";
  992. $v102 = "";
  993. }
  994. $v49 = '<HTML>'.$v76;
  995. $v49 .= '<HEAD>'.$v76;
  996. $v49 .= '<TITLE>'.$wimpyHTMLpageTitle.'</TITLE>'.$v76;
  997. $v49 .= '</HEAD>'.$v76;
  998. $v49 .= '<BODY bgcolor="#'.$bkgdColor.'" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">'.$v76;
  999. $v49 .= '<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">'.$v76;
  1000. $v49 .= ' <tr>'.$v76;
  1001. $v49 .= '<td align="center" valign="middle">'.$v76;
  1002. $v49 .= '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,47,0" width="'.$v80.'" height="'.$v79.'" id="wimpy">'.$v76;
  1003. $v49 .= '<param name="movie" value="'.$v71.'" />'.$v76;
  1004. $v49 .= '<param name="loop" value="false" />'.$v76;
  1005. $v49 .= '<param name="menu" value="false" />'.$v76;
  1006. $v49 .= '<param name="quality" value="high" />'.$v76;
  1007. $v49 .= '<param name="scale" value="noscale" />'.$v76;
  1008. $v49 .= '<param name="salign" value="lt" />'.$v76;
  1009. $v49 .= '<param name="bgcolor" value="#'.$bkgdColor.'" />'.$v76;
  1010. $v49 .= "$v102";
  1011. $v49 .= '<embed src="'.$v71.'" width="'.$v80.'" height="'.$v79.'" bgcolor="#'.$bkgdColor.'" loop="false" menu="false" quality="high" scale="noscale" salign="lt" id="wimpy" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" '.$v101.'/></object>'.$v76;
  1012. $v49 .= '</td>'.$v76;
  1013. $v49 .= '</tr>'.$v76;
  1014. $v49 .= '</table>'.$v76;
  1015. $v49 .= '</BODY>'.$v76;
  1016. $v49 .= '</HTML>'.$v76;
  1017. print ($v49);
  1018. exit;
  1019. }
  1020. ?>