wimpyVersion = "v1.0.0"; // // // available at http://www.wimpyplayer.com // // ©2002-2007 plaino // // // // // // // // // ///////////////////////////////////////////////////////////////// // // // INSTALLATION: // // // ///////////////////////////////////////////////////////////////// // // Upload wimpy.php and wimpy.swf to the folder that // contains your mp3's. // // USE AT YOUR OWN RISK. // wimpyConfigFile = "raveConfigs.xml"; myWimpySWFfilename = "rave.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 = "https"; httpOption = "http"; // // clearClassCache // Setting clearClassCache to false will optimize performance. By default // Wimpy removes any temporary files that ColdFusion stores. Temporary // files stored by ColdFusion can cause issues when modifying the contents // of your folders. i.e. if you add or remove files from the Wimpy folder, // ColdFusion may not recognize that the contents of the folder have changed, // because ColdFusion sometimes caches information. By default, Wimpy tries // to remove any cached information so that the most up to date information // is available in the player, however if you do not change the contents of // the Wimpy folder oftern, or if you have direct acces to the ColdFusion // admin panel, you may want to set this to false, which will optimize the // performance of the CFM page. clearClassCache = true; ///////////////////////////////////////////////////////////////// // // // DO NOT EDIT BELOW HERE // // // ///////////////////////////////////////////////////////////////// //> SYSTEM_OS = Server.OS.Name.substring(0, 3); SYSTEM_CF_VERSION = Server.ColdFusion.ProductVersion; IF(LCase(SYSTEM_OS) EQ "win"){ slash = "\"; } else { slash = "/"; } wimpyAppPhysical = GetBaseTemplatePath(); wimpyAppWWW = CGI.SERVER_NAME & CGI.PATH_INFO; list_physical = ListToArray(wimpyAppPhysical, slash); list_www = ListToArray(wimpyAppWWW, "/"); wimpyAppFilename = list_www[ArrayLen(list_www)]; ArrayDeleteAt(list_physical, ArrayLen(list_physical)); ArrayDeleteAt(list_www, ArrayLen(list_www)); PATH_PHYSICAL = ArrayToList(list_physical, slash); PATH_WWW_SANS_HTTP = ArrayToList(list_www, "/"); PATH_WWW = httpOption & "://" & PATH_WWW_SANS_HTTP; wimpyAppWWW = httpOption & "://" & wimpyAppWWW; wimpyDirectory = PATH_PHYSICAL & slash; mp3url = PATH_WWW & "/"; wimpyApp = wimpyAppWWW; wimpySwf = PATH_WWW & "/" & myWimpySWFfilename; wimpyJS = PATH_WWW & "/" & "rave.js"; myConfigFile = wimpyDirectory & wimpyConfigFile; if(FileExists(myConfigFile)){ useConfigFile = true; } else { useConfigFile = false; } SetVariable(trim(xml.wimpyConfigs.XmlChildren[i].XmlName), trim(xml.wimpyConfigs.XmlChildren[i].XmlText)); function filepath2url(theFilepath){ nameSwapA = ReplaceNoCase (theFilepath, PATH_PHYSICAL, PATH_WWW); nameSwapB = ReplaceNoCase (nameSwapA, slash, "/", "All"); // nameSwapA = REReplace ('[' & URLDecode(theFilepath) & ']', PATH_PHYSICAL, PATH_WWW); // nameSwapB = ReplaceNoCase (nameSwapA, slash, "/", "All"); return nameSwapB; return httpOption&"://"&retval; } function url2filepath(theURL){ nameSwapA = ReplaceNoCase (URLDecode(theURL), PATH_WWW, PATH_PHYSICAL); nameSwapB = ReplaceNoCase (nameSwapA, "/", slash, "All"); return nameSwapB; } function getBasename(theFilepath){ return ListLast(Replace(URLDecode(theFilepath), slash, "/"), "/"); } function FileSize(filenameIN){ var daFile = createObject("java", "java.io.File"); daFile.init(JavaCast("string", filenameIN)); return daFile.length(); } if(not IsDefined("wimpySwf")){ wimpySwf = PATH_WWW&"/"&myWimpySWFfilename; } if(not IsDefined("wimpyApp")){ wimpyApp = wimpyAppWWW; } if(not IsDefined("wimpySkin")){ wimpySkin = ""; } if(not IsDefined("tptBkgd")){ tptBkgd = "yes"; } if(not IsDefined("bkgdColor")){ bkgdColor = chr(35) & "000000"; } if(not IsDefined("startDir")){ startDir = ""; } if(not IsDefined("hide_folders")){ hide_folders = "_notes,goodies,playlister_output,skins,getid3,_private,_private,_vti_bin,_vti_cnf,_vti_pvt,_vti_txt,cgi-bin"; } if(not IsDefined("hide_files")){ hide_files = "rave.swf,raveConfigs.xml,skin.xml,wimpyConfigs.xml,wimpyAVConfigs.xml,wimpy.swf,wimpyAV.swf,wasp.swf,wimpy_button.swf"; } if(not IsDefined("wimpyHTMLpageTitle")){ wimpyHTMLpageTitle = "Wimpy Player"; } if(not IsDefined("getMyid3info")){ getMyid3info = "no"; } if(not IsDefined("displayWidth")){ displayWidth = 0; } if(not IsDefined("displayHeight")){ displayHeight = 0; } // BEGIN WIMPY AV EXCLUDE if(not IsDefined("wimpySkin")){ wimpySkin = ""; } if(not IsDefined("defaultVisualExt")){ defaultVisualExt = "jpg"; } if(not IsDefined("defaultVisual")){ defaultVisualBaseName = "coverart"; defaultVisualExt = "jpg"; } else { AdefaultVisual = split(".", defaultVisual); defaultVisualBaseName = AdefaultVisual(0); defaultVisualExt = AdefaultVisual(1); } if(not IsDefined("limitPlaytime")){ limitPlaytime = "no"; } if(not IsDefined("limitPlaytimeSeconds")){ limitPlaytimeSeconds = "0"; } // set default skin vars useSkin = false; readskin = false; displayWidth = "250"; displayHeight = "290"; if(url.action EQ "serveplayer"){ readskin = true; } // Only get Skin Info if needed if(useSkin EQ true){ myXmlFile = XmlParse(CFHTTP.FileContent); displayWidth = myXmlFile.skin.bkgd_main.xmlAttributes.width; displayHeight = myXmlFile.skin.bkgd_main.xmlAttributes.height; } // Startdir must be processed after looking for skin file useStartDir = false; if(not startDir EQ ""){ PATH_PHYSICAL = startDir; wimpyDirectory = PATH_PHYSICAL&slash; //WIMPY_BASE['path']['www'] = ""; serveMP3 = "yes"; useStartDir = true; } if (getMyid3info EQ "yes"){ try { id3Reader = CreateObject("java", "org.farng.mp3.MP3File"); } catch(Any excpt) { getMyid3info = "no"; /* WriteOutput('

ERROR

You have requested that Wimpy read ID3 tags, however, the ID3 tag reader program "Helliker" has not been installed properly.
Please see the helliker readme.txt file for how to install the Helliker. - OR - Set the "getMyid3info" (Extract embedded ID3 info) option to "no"

 

'); */ } }
SELECT name FROM classDir WHERE name like '%wimpy%' rootNodeName = ""; try { myXmlFile = XmlParse(CFHTTP.FileContent); rootNodeName = trim(myXmlFile.xmlRoot.XmlName); } catch(Any excpt) { // WriteOutput('
FAILED: ' & theFile & "
" & excpt); }
baseDir = wimpyDirectory; if(right(baseDir, 1) EQ slash){ baseDir = left(baseDir, len(baseDir)-1); } Axmls = directoryList(baseDir, "", "", true); retval = "" & chr(13) & chr(10); filekind = right(name,3); if(NOT filekind EQ ""){ if(filekind EQ "xml"){ fileURL = filepath2url(directory & slash & name); XMLtype = XMLkind(fileURL); if(theKind EQ XMLtype){ retval = retval & "" & fileURL & "" & chr(13) & chr(10); } } } retval = retval & ""; setHeaderContent("text/xml"); WriteOutput(retval); clearCFcache(); row = 0; if (not compare(url.action,'getstartupdirlist')){ wimpyDirectory = wimpyDirectory; } else if (not compare(url.action,'dir')){ wimpyDirectory = url2filepath(url.dir) & slash; } retval = ""; getMP3s = directoryList(wimpyDirectory); showRow = false; tempTime = ParseDateTime(datelastmodified); last_mod = DateFormat(tempTime, 'yyyy-mm-dd ') & TimeFormat(tempTime, 'HH:mm:ss'); filekind = right(name,3); filename = filepath2url(wimpyDirectory & name); title = replaceNoCase(name, '.' & filekind, '', "one"); artist = title; album = ''; track = ''; comments = ''; genre = ''; seconds = ''; bitrate = ''; date = last_mod; image = ''; if (not compare(type,'Dir')){ if (not listFindNoCase(hide_folders,name)){ filekind = 'dir'; date = last_mod; check4visual = wimpyDirectory & name & slash & defaultVisualBaseName & "." & defaultVisualExt; if (FileExists(check4visual)){ image = filepath2url(check4visual); } showRow = true; } } else { if (ListContainsNoCase(media_types,right(name,3))){ showRow = true; } if (showRow EQ true){ if (listFindNoCase(hide_files,name)){ showRow = false; } } if (showRow EQ true){ if (findNoCase('config',name)){ showRow = false; } } if (showRow EQ true){ if (findNoCase('skin',name)){ showRow = false; } } if (showRow EQ true){ filekind = right(name,3); check4visual = wimpyDirectory & replaceNoCase(name, filekind, '.jpg', "one"); if (FileExists(check4visual)){ if(useStartDir eq true){ image = wimpyApp & "?action=getCoverart&theFile=" & filepath2url(check4visual); } else { image = filepath2url(check4visual); } } if (not compareNoCase('.mp3',right(name,4))){ if (getMyid3info EQ "yes"){ try { id3Reader.init(wimpyDirectory & name); useID3 = false; if(id3Reader.hasID3v2Tag() EQ "YES"){ tag = id3Reader.getID3v2Tag(); useID3 = true; } else if(id3Reader.hasID3v1Tag() EQ "YES"){ tag = id3Reader.getID3v1Tag(); useID3 = true; } if(useID3 EQ true){ album = tag.getAlbumTitle(); //artist = tag.getAuthorComposer(); artist = tag.getLeadArtist(); comment = tag.getSongComment(); genre = tag.getSongGenre(); //lyric = tag.getSongLyric(); checkTitle = tag.getSongTitle(); track = tag.getTrackNumberOnAlbum(); year = tag.getYearReleased(); if(NOT checkTitle EQ ""){ title = checkTitle; } } } catch(Any excpt) { // WriteOutput('
FAILED: ' & myPath & "
" & excpt); } } } } } if (showRow is true){ retval = retval & chr(9) & "" & chr(13) & chr(10); retval = retval & chr(9) & chr(9) & "" & filename & "" & chr(13) & chr(10); retval = retval & chr(9) & chr(9) & "" & artist & "" & chr(13) & chr(10); retval = retval & chr(9) & chr(9) & "" & album & "" & chr(13) & chr(10); retval = retval & chr(9) & chr(9) & "" & title & "" & chr(13) & chr(10); retval = retval & chr(9) & chr(9) & "" & comments & "" & chr(13) & chr(10); retval = retval & chr(9) & chr(9) & "" & genre & "" & chr(13) & chr(10); retval = retval & chr(9) & chr(9) & "" & seconds & "" & chr(13) & chr(10); if (not compare(Type,'File')){ retval = retval & chr(9) & chr(9) & "" & FileSize(wimpyDirectory & name) & "" & chr(13) & chr(10); } else { retval = retval & chr(9) & chr(9) & "" & chr(13) & chr(10); } retval = retval & chr(9) & chr(9) & "" & bitrate & "" & chr(13) & chr(10); retval = retval & chr(9) & chr(9) & "" & filekind & "" & chr(13) & chr(10); retval = retval & chr(9) & chr(9) & "" & date & "" & chr(13) & chr(10); retval = retval & chr(9) & chr(9) & "" & image & "" & chr(13) & chr(10); retval = retval & chr(9) & "" & chr(13) & chr(10); row = row + 1; }
check4visual = wimpyDirectory & defaultVisualBaseName & "." & defaultVisualExt; visualURL = ""; if (FileExists(check4visual)){ if(useStartDir eq true){ visualURL = wimpyApp & "?action=getCoverart&theFile=" & filepath2url(check4visual); } else { visualURL = filepath2url(check4visual); } } if(NOT visualURL EQ ""){ visualURL = ' image="' & visualURL & '"'; } retval = '' & chr(13) & chr(10) & retval & "" & chr(13) & chr(10); setHeaderContent("text/xml"); WriteOutput(retval);
#wimpyVersion# writeCode = ""; if(useConfigFile EQ true){ writeCode = writeCode & chr(13) & chr(10) & 'so.addVariable("wimpyConfigs", "' & PATH_WWW & "/" & wimpyConfigFile & '");'; } if(useSkin EQ true){ writeCode = writeCode & chr(13) & chr(10) & 'so.addVariable("wimpySkin", "' & wimpySkin & '");'; } #wimpyHTMLpageTitle#
You need to upgrade your Flash Player