One Hat Cyber Team
Your IP:
216.73.216.75
Server IP:
213.186.33.17
Server:
Linux webm007.cluster106.gra.hosting.ovh.net 6.18.39-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Tue Jul 21 12:03:15 CEST 2026 x86_64
Server Software:
Apache
PHP Version:
7.4.33
Create File
|
Create Folder
Execute
Dir :
~
/
home
/
tcherkas
/
balalaika.eu
/
plugins
/
content
/
nmapp
/
Edit File:
nmapp.php
<?php /** * Pro Magic Audio Player *This program is free software: you can redistribute it and/or modify it under the terms *of the GNU General Public License as published by the Free Software Foundation, *either version 3 of the License, or (at your option) any later version. * *This program is distributed in the hope that it will be useful, *but WITHOUT ANY WARRANTY; without even the implied warranty of *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *GNU General Public License for more details. * *You should have received a copy of the GNU General Public License *along with this program. If not, see <http://www.gnu.org/licenses/>. * *@author ProJoom *@copyright (C) 2008 - 2015 ProJoom *@link http://www.projoom.com/extensions/pro-magic-audio-player.html Official website **/ defined('_JEXEC') or die('Restricted access'); error_reporting(0); jimport('joomla.event.plugin'); jimport( 'joomla.access.access' ); class plgContentNmapp extends JPlugin { function onContentPrepare($context, &$row, &$params, $page = 0) { $regex = "#{nmap}(.*?){/nmap}#s"; if (JPluginHelper::isEnabled('content', 'nmapp') != '1') { $row->text = preg_replace($regex, '', $row->text); return true; } $row->text = preg_replace_callback($regex, array($this, 'nmapopup_replacer'), $row->text); return true; } public function nmapopup_replacer(&$matches) { if (is_file(JPATH_ROOT . "/modules/mod_nmap/helper.php")) { require_once (JPATH_ROOT . "/modules/mod_nmap/helper.php"); $pj_hlp = new pj_pmap_hlp(); } else { $err_m = '<div style="background-color: red;"> <center><span style="font-size: small; color: white;"><strong>Please install <span STYLE="color: yellow">Pro Magic Audio Player</span> module first before using this plugin.</strong></span></center></div>'; return $err_m; } $document = JFactory::getDocument(); $pluginParams = $this->params; $objalign = $pluginParams->get('objalign', ''); $nmaptyp = $pluginParams->get('nmaptyp', ''); $nmapstyle = $pluginParams->get('nmapstyle', ''); $nmaptrim = $pluginParams->get('nmaptrim', ''); $nmaplay = $pluginParams->get('nmaplay', ''); $nmaprepeat = $pluginParams->get('nmaprepeat', ''); $nmapshuffle = $pluginParams->get('nmapshuffle', ''); $nmacomp = $pluginParams->get('nmacomp', ''); $nmascrltit = $pluginParams->get('nmascrltit', ''); $nmapvolhgt = $pluginParams->get('nmapvolhgt', ''); $nmapplbwdt = $pluginParams->get('nmapplbwidth', ''); $nmapflyout = $pluginParams->get('nmapflyout', ''); $nmapdisptime = $pluginParams->get('nmapdisptime', ''); $nmapint = $pluginParams->get('nmapint'); $nmaprfile = $pluginParams->get('nmaprfile'); $nmapvol = $pluginParams->get('nmapvol'); $nmapformat = $pluginParams->get('nmapformat'); $nmaprecurse = $pluginParams->get('nmaprecurse'); $nmapreclimit = $pluginParams->get('nmapreclimit'); $nmapsetperms = $pluginParams->get('nmapsetperms'); $nmapid3 = $pluginParams->get('nmapid3'); $nmapfenugrp = $pluginParams->get('nmapfenugrp'); $nmapfenugrp2 = $pluginParams->get('nmapfenugrp2'); $nmapfenugrp3 = $pluginParams->get('nmapfenugrp3'); $nmapsonginfo = $pluginParams->get('nmapsonginfo'); $nmapfenup = $pluginParams->get('nmapfenup'); $nmapfenupdf = $pluginParams->get('nmapfenupdf'); $nmapfenupsf = $pluginParams->get('nmapfenupsf'); $nmapfenufo = $pluginParams->get('nmapfenufo'); $nmapfenufau = $pluginParams->get('nmapfenufau'); $nmapfenufl = $pluginParams->get('nmapfenufl'); $nmapopt = $pluginParams->get('nmapopt'); $nmapesc = $pluginParams->get('nmapes'); $nmapestype = $pluginParams->get('nmapestype'); $pjurl = $pluginParams->get('pjurl'); if ($pjurl == '1') { $RURL = JURI::base(); } else { $RURL = JURI::base(true) . '/'; } $pj_hlp->init($RURL); if (!empty($nmaprfile)) { $nmaprfile = $RURL . $nmaprfile; } else { $nmaprfile = ""; } $debug_key = ""; $debug_key = JRequest::getVar('pj', '', 'get'); $pbgc1 = $pluginParams->get('pbgc1'); $pbgc2 = $pluginParams->get('pbgc2'); $pbga = $pluginParams->get('pbga'); $pbgc3 = $pluginParams->get('pbgc3'); $pbgsc1 = $pluginParams->get('pbgsc1'); $pbgsc2 = $pluginParams->get('pbgsc2'); $pbgsa = $pluginParams->get('pbgsa'); $pbgsc3 = $pluginParams->get('pbgsc3'); $bbgc1 = $pluginParams->get('bbgc1'); $bbgc2 = $pluginParams->get('bbgc2'); $bbga = $pluginParams->get('bbga'); $bbgc3 = $pluginParams->get('bbgc3'); $bisc1 = $pluginParams->get('bisc1'); $bisc2 = $pluginParams->get('bisc2'); $bisa = $pluginParams->get('bisa'); $bisc3 = $pluginParams->get('bisc3'); $bbghc1 = $pluginParams->get('bbghc1'); $bbghc2 = $pluginParams->get('bbghc2'); $bbgha = $pluginParams->get('bbgha'); $bbghc3 = $pluginParams->get('bbghc3'); $bic1 = $pluginParams->get('bic1'); $bia = $pluginParams->get('bia'); $bich = $pluginParams->get('bich'); $bicha = $pluginParams->get('bicha'); $globaltextc = $pluginParams->get('globaltextc'); $sbgc1 = $pluginParams->get('sbgc1'); $sbgc2 = $pluginParams->get('sbgc2'); $sbga = $pluginParams->get('sbga'); $sfc1 = $pluginParams->get('sfc1'); $svc2 = $pluginParams->get('svc2'); $sfa = $pluginParams->get('sfa'); $sspc1 = $pluginParams->get('sspc1'); $sspc2 = $pluginParams->get('sspc2'); $sspa = $pluginParams->get('sspa'); $sbc1 = $pluginParams->get('sbc1'); $sbc2 = ""; $sbc3 = ""; $vbgc1 = $pluginParams->get('vbgc1'); $vbgc2 = $pluginParams->get('vbgc2'); $vbga = $pluginParams->get('vbga'); $vbgc3 = $pluginParams->get('vbgc3'); $vsbgc1 = $pluginParams->get('vsbgc1'); $vsbgc2 = $pluginParams->get('vsbgc2'); $vsfc1 = $pluginParams->get('vsfc1'); $vsfc2 = $pluginParams->get('vsfc2'); $vsbc1 = ""; $vsbc2 = ""; $lbgc1 = $pluginParams->get('lbgc1'); $lbgc2 = $pluginParams->get('lbgc2'); $lbga = $pluginParams->get('lbga'); $lbgc3 = $pluginParams->get('lbgc3'); $lsbc1 = $pluginParams->get('lsbc1'); $lsba = $pluginParams->get('lsba'); $lsbgc1 = $pluginParams->get('lsbgc1'); $lsbga = $pluginParams->get('lsbga'); $libg = $pluginParams->get('libg'); $libga = $pluginParams->get('libga'); $libgac = $pluginParams->get('libgac'); $libgaa = $pluginParams->get('libgaa'); $roundness = $pluginParams->get('roundness'); $nmapwcor = $pluginParams->get('nmapwcor'); $nmapfilter = base64_encode($pluginParams->get('nmapfilter')); $pmapjspbg = $pluginParams->get('pmapjspbg'); $pmapjstbg = $pluginParams->get('pmapjstbg'); $pmapjq = $pluginParams->get('pmapjq'); $pmapjqv = $pluginParams->get('pmapjqv'); $loadscript = $pluginParams->get('loadscript'); $nmapamzs = $pluginParams->get('nmapamzs'); $nmapamzk = $pluginParams->get('nmapamzk'); $nmapamzsk = $pluginParams->get('nmapamzsk'); $nmapamzbck = $pluginParams->get('nmapamzbuck'); $nmapamzbcke = $pluginParams->get('nmapamzbuckend'); $nmapamzsmpo = $pluginParams->get('nmapamzsmpo'); $pmapedl = $pluginParams->get('pmapedl'); if ($nmapsetperms == 1) { $pj_hlp->setperms(JPATH_ROOT . "/plugins/content/nmapp/popup.php"); } if ($debug_key == "pmapp") { echo $pj_hlp->debug('Pro Magic Audio Player', 'mod_nmap', 'no', $document); return; } // if (!preg_match('/\|/', $matches[1])) { preg_match_all('/((?P<params>[A-z0-9]*)(=(\'|\")+)(?P<values>[A-z\0-9]*)(\'|\"))/', $matches[1], $result); if (empty($result)) { return "<center>No parameters detected! <br/> Please check your plugin execution code and make sure there are at least X params inserted</center>"; } else { $all_match = array_combine($result['params'], $result['values']); } if (!isset($all_match['plugin_type'], $all_match['width'], $all_match['height'], $all_match['source'])) { return "<center>One or more necessary parameters not detected! <br/> Please check your plugin execution code that it has the 'plugin_type', 'width', 'height' and 'source' parameters</center>"; } $nmapptype = str_replace(' ', '', $all_match['plugin_type']); $nmapwidth = str_replace(' ', '', $all_match['width']); $nmapheight = str_replace(' ', '', $all_match['height']); $nmapdir = $all_match['source']; $nmapbut = str_replace(' ', '', $all_match['button_image']); $nmaptitle = $all_match['title']; $nmappstyle = str_replace(' ', '', $all_match['style']); $nmappsort = str_replace(' ', '', $all_match['sort']); $nmappid3 = str_replace(' ', '', $all_match['id3']); if (!empty($nmappstyle)) { $nmapstyle = $nmappstyle; } $bgcol = str_replace(' ', '', $all_match['background_color']); if (!empty($bgcol)) { $defbg = str_replace('#', '', $bgcol); } $nmalsthgt = $nmapheight - 40; $nmapas = str_replace(' ', '', $all_match['auto_start']); if (!empty($nmapas)) { $nmaplay = $nmapas; } if (!empty($all_match['player_type'])) { $nmaptyp = str_replace(' ', '', $all_match['player_type']); } if (!empty($all_match['html5_width'])) { $pmap5w = str_replace(' ', '', $all_match['html5_width']); } else { $pmap5w = '325px'; } if (!empty($all_match['html5_height'])) { $pmap5h = str_replace(' ', '', $all_match['html5_height']); } else { $pmap5h = $nmapheight . 'px'; } if (!empty($all_match['wrap_width'])) { $pmap5ww = str_replace(' ', '', $all_match['wrap_width']); } else { $pmap5ww = '174px'; } if (!empty($nmappsort)) { if (is_numeric($nmappsort)) { $nmapshuffle = $nmappsort; } } if (!empty($nmappid3)) { if (is_numeric($nmappid3)) { $nmapid3 = $nmappid3; } } } else { $thisParams = explode("|", $matches[1]); if (sizeof($thisParams) < 5) return "<center>Not enough parameters! <br />Please use this code : {nmap}mode|width|height|directory(or single file)|button|title|style|bgcol|autoplay|type|sorting|id3tag{/nmap} <br />Note : The title is optional</center>"; $nmapptype = str_replace(' ', '', $thisParams[0]); $nmapwidth = str_replace(' ', '', $thisParams[1]); $nmapheight = str_replace(' ', '', $thisParams[2]); $nmapdir = $thisParams[3]; $nmapbut = str_replace(' ', '', $thisParams[4]); $nmaptitle = $thisParams[5]; $nmappstyle = str_replace(' ', '', $thisParams[6]); $nmappsort = str_replace(' ', '', $thisParams[10]); $nmappid3 = str_replace(' ', '', $thisParams[11]); if (!empty($nmappstyle)) { $nmapstyle = $nmappstyle; } $bgcol = str_replace(' ', '', $thisParams[7]); if (!empty($bgcol)) { $defbg = str_replace('#', '', $bgcol); } $nmalsthgt = $nmapheight - 40; $nmapas = str_replace(' ', '', $thisParams[8]); if (!empty($nmapas)) { $nmaplay = $nmapas; } if (!empty($thisParams[9])) { $nmaptyp = str_replace(' ', '', $thisParams[9]); } if (!empty($thisParams[12])) { $pmap5w = str_replace(' ', '', $thisParams[12]); } else { $pmap5w = '325px'; } if (!empty($thisParams[13])) { $pmap5h = str_replace(' ', '', $thisParams[13]); } else { $pmap5h = $nmapheight . 'px'; } if (!empty($thisParams[14])) { $pmap5ww = str_replace(' ', '', $thisParams[14]); } else { $pmap5ww = '174px'; } if (!empty($nmappsort)) { if (is_numeric($nmappsort)) { $nmapshuffle = $nmappsort; } } if (!empty($nmappid3)) { if (is_numeric($nmappid3)) { $nmapid3 = $nmappid3; } } } $key = "xCv"; $nmapid = rand(1, 99); $plgid = sprintf('%u', crc32(trim($nmapdir))); if ($nmapesc == '1') { if ($nmapestype == '1') { $nmapdira = $nmapdir; for ($x = 1; $x < 5; $x++) { $c_folder = $pluginParams->get('nmapfo' . $x); $c_st = $pluginParams->get('nmapsc' . $x); preg_match_all('/(?P<year>[0-9]{4})-(?P<month>[0-9]{1,2})-(?P<day>[0-9]{1,2})(\s(?P<hour>[0-9]{1,2})(\:(?P<minute>[0-9]{1,2}))?)?/i', $c_st, $c_starttime); $c_startstamp = mktime($c_starttime["hour"][0], $c_starttime["minute"][0], 0, $c_starttime["month"][0], $c_starttime["day"][0], $c_starttime["year"][0]); if ($c_folder != "") { $stof[$c_startstamp] = $c_folder; } } if (!empty($stof)) { ksort($stof); foreach ($stof as $ts => $fo) { if (time() > $ts && !empty($fo)) { $nmapdira = $fo; } } } } elseif ($nmapestype == '0') { $nmapdira = $nmapdir; for ($x = 1; $x < 5; $x++) { $c_folder = $pluginParams->get('nmapfo' . $x); $c_st = $pluginParams->get('nmapsc' . $x); preg_match_all('/(?P<year>[0-9]{4})-(?P<month>[0-9]{1,2})-(?P<day>[0-9]{1,2})(\s(?P<hour>[0-9]{1,2})(\:(?P<minute>[0-9]{1,2}))?)?/i', $c_st, $c_starttime); $c_startstamp = mktime($c_starttime["hour"][0], $c_starttime["minute"][0], 0, $c_starttime["month"][0], $c_starttime["day"][0], $c_starttime["year"][0]); if ($c_folder != "") { $stof[$c_startstamp] = $c_folder; } } if (!empty($stof)) { ksort($stof); foreach ($stof as $ts => $fo) { if (time() < $ts && !empty($fo)) { $nmapdira = $fo; break; } } } } } else { $nmapdira = $nmapdir; } $nmapdira = trim($nmapdira, '\\/'); $nmapdirb = '0'; $combined = $nmaptyp . "*" . $nmapamzs . "*" . $nmapamzk . "*" . $nmapamzsk . "*" . $nmapamzbck . "*" . $nmapamzbcke . "|" . $nmapwidth . "|" . $nmaplay . "|" . $nmapstyle . "|" . $nmapdira . "|" . $nmaprfile . "*" . $nmapint . "*" . $nmapvol . "*" . $nmapformat . "*" . $nmaprecurse . "*" . $nmapid3 . "*" . $nmapreclimit . "*" . $nmapsonginfo . "|" . $nmaptrim . "|" . $nmaprepeat . "|" . $nmapshuffle . "|" . $nmacomp . "|" . $nmalsthgt . "|" . $nmascrltit . "|" . $nmapvolhgt . "|" . $nmapplbwdt . "|" . $nmapflyout . "|" . $nmapdisptime . "|" . $nmapheight; if ($nmapstyle == "x") { $combined = $combined . "|" . $pbgc1 . "|" . $pbgc2 . "|" . $pbga . "|" . $pbgc3 . "|" . $pbgsc1 . "|" . $pbgsc2 . "|" . $pbgsa . "|" . $pbgsc3 . "|" . $bbgc1 . "|" . $bbgc2 . "|" . $bbga . "|" . $bbgc3 . "|" . $bisc1 . "|" . $bisc2 . "|" . $bisa . "|" . $bisc3 . "|" . $bbghc1 . "|" . $bbghc2 . "|" . $bbgha . "|" . $bbghc3 . "|" . $bic1 . "|" . $bia . "|" . $bich . "|" . $bicha . "|" . $globaltextc . "|" . $sbgc1 . "|" . $sbgc2 . "|" . $sbga . "|" . $sfc1 . "|" . $svc2 . "|" . $sfa . "|" . $sspc1 . "|" . $sspc2 . "|" . $sspa . "|" . $sbc1 . "|" . $sbc2 . "|" . $sbc3 . "|" . $vbgc1 . "|" . $vbgc2 . "|" . $vbga . "|" . $vbgc3 . "|" . $vsbgc1 . "|" . $vsbgc2 . "|" . $vsfc1 . "|" . $vsfc2 . "|" . $vsbc1 . "|" . $vsbc2 . "|" . $lbgc1 . "|" . $lbgc2 . "|" . $lbga . "|" . $lbgc3 . "|" . $lsbc1 . "|" . $lsba . "|" . $lsbgc1 . "|" . $lsbga . "|" . $libg . "|" . $libga . "|" . $libgac . "|" . $libgaa . "|" . $roundness . "|" . $nmapid; } else { $combined = $combined . "|" . $nmapid; } $combined = str_replace('#', '', $combined); $send = $this->nmapp_encode($combined, $key); // $plyid = 'pmapp_' . $nmapid . '_' . rand(1, 999); $divid = 'al' . $plyid; if (preg_match('/(iphone|ipad|ipod|android)/i', $_SERVER['HTTP_USER_AGENT']) || $pluginParams->get('html5') == '1') { if ($nmapptype == 'popup' || $nmapptype == 'html5pop') { $nmapptype = 'html5pop'; } else { $nmapptype = 'html5'; } } if ($nmapptype == 'popup' || $nmapptype == 'normalmixed') { if (empty($nmapptitle)) { $nmapptitle = 'Pro Magic Audio Player'; } $pmap_pop = 'nmapopup'; if ($nmapopt == '1') { $pmap_pop = 'nmapopup_' . rand(100, 999); } $url = strtr(base64_encode(addslashes(gzcompress(serialize($RURL), 9))), '+/=', '-_,'); $popurl = $RURL . "plugins/content/nmapp/popup.php?cfg=" . $send . "&url=" . $url . "&plw=" . $nmapwidth . "&plh=" . $nmapheight . "&bgc=" . $defbg . "&tit=" . $nmaptitle; $buturl = $RURL . "plugins/content/nmapp/" . $nmapbut . ".png"; $popwidth = $nmapwidth + $nmapwcor; $popheight = $nmapheight + $nmapwcor; $nmapsound .= "<div style=\"text-align:center\"><a href=\"javascript:void(0);\" onclick=\"nmapopup=window.open('$popurl','$pmap_pop','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=$popwidth,height=$popheight,left=50,top=50'); return false;\"><img style=\"outline:none;\" src=\"$buturl\" border=\"0\" alt=\"Click\"/></a></div>"; } if ($nmapptype == "html5" || $nmapptype == 'html5pop' || $nmapptype == 'html5mixed') { $onthefly = '#' . $divid . '{ text-align: ' . $objalign . '; }'; $document->addStyleDeclaration($onthefly); require_once (JPATH_ROOT . '/modules/mod_nmap/audio/nmapl.php'); $getID3 = new getID3; if ($nmaprecurse == 1) { $recursivity = true; if ($nmapreclimit != 0) { $recursivity = $nmapreclimit; } } if ($nmapamzs == 1) { $mode = 'amazon'; } elseif (preg_match('/(https|http):\/\/www\.dropbox\.com/i', $nmapdira)) { $mode = 'dropbox'; } elseif (preg_match('/http:/i', $nmapdira)) { $allfilesnopath = file_get_contents($nmapdira . "?rec=" . (int)$nmaprecurse . "&reclim=" . $nmapreclimit . "&nform=" . $nmapformat . "&nsinfo=" . $nmapsonginfo . "&nshuffle=" . $nmapshuffle . "&nh5=1"); $allfilesnopath = unserialize($allfilesnopath); $mode = 'remote'; } elseif (is_dir($nmapdira)) { $oggfilesnopath = JFolder::files($nmapdira, 'ogg', $recursivity, true); $mp3filesnopath = JFolder::files($nmapdira, 'mp3', $recursivity, true); $sfmode = false; $mode = 'local'; } elseif (preg_match('/\.mp3$/i', $nmapdira) && file_exists($nmapdira)) { $nmapdirovr = dirname($nmapdira); $oggfilesnopath = JFolder::files($nmapdirovr, 'ogg', $recursivity, true); $mp3filesnopath = array($nmapdira); $sfmode = true; $mode = 'local'; } $user = JFactory::getUser(); $user_id = $user->get('id'); if ($mode == 'local' && $pmapedl == '1') { $ext_jsp = 'downLoader: "' . $RURL . 'modules/mod_nmap/audio/html5/downloader.php",'; $popextjsp = true; } elseif ($mode == 'local' && $pmapedl == '2' && $user_id !== 0) { $ext_jsp = 'downLoader: "' . $RURL . 'modules/mod_nmap/audio/html5/downloader.php",'; $popextjsp = true; } elseif ($mode == 'dropbox' && $pmapedl == '1') { $ext_jsp = 'fstype: "dropx",'; $popextjsp = true; } elseif ($mode == 'dropbox' && $pmapedl == '2' && $user_id !== 0) { $ext_jsp = 'fstype: "dropx",'; $popextjsp = true; } else { $popextjsp = false; } if ($nmapptype != 'html5pop') { if ($pmapjq == 'yes') { if ($GLOBALS['iosjq'] != "active") { $document->addScript("https://ajax.googleapis.com/ajax/libs/jquery/" . $pmapjqv . "/jquery.min.js"); $GLOBALS['iosjq'] = "active"; } } if ($GLOBALS['nmapiosjs'] != "active") { $document->addStyleSheet($RURL . "modules/mod_nmap/audio/html5/css/pmap.css"); if ($loadscript == '0') { $document->addScript("https://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.js"); $document->addScript($RURL . "modules/mod_nmap/audio/html5/jsengine.js"); } else { $nmapsound .= '<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.js"></script>'; $nmapsound .= '<script type="text/javascript" src="' . $RURL . 'modules/mod_nmap/audio/html5/jsengine.js"></script>' . "\n"; } $GLOBALS['nmapiosjs'] = "active"; } elseif ($loadscript == '2') { $nmapsound .= '<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.js"></script>'; $nmapsound .= '<script type="text/javascript" src="' . $RURL . 'modules/mod_nmap/audio/html5/jsengine.js"></script>' . "\n"; } if ($loadscript == '0') { $document->addScriptDeclaration(' var $PMAPJSE = jQuery.noConflict(); $PMAPJSE(document).ready(function() { $PMAPJSE(\'#' . $divid . '\').pjpmap(myPlaylist_' . $nmapid . ', { autoPlay:' . $nmaplay . ', repeatPlay:' . (($nmaprepeat == 1) ? 'true' : 'false') . ', ' . $ext_jsp . ' jPlayer:{ swfPath:\'' . JURI::base() . 'modules/mod_nmap/audio/html5/\' } }, "pmapp_' . $nmapid . '"); $PMAPJSE(\'#playlist-pmapp_' . $nmapid . '\').slimScroll({ height: \'' . $pmap5h . '\', color: \'#fff\', size: \'' . $nmapplbwdt . 'px\' }); });'); } else { $nmapsound .= ' <script type="text/javascript"> var $PMAPJSE = jQuery.noConflict(); $PMAPJSE(document).ready(function() { $PMAPJSE(\'#' . $divid . '\').pjpmap(myPlaylist_' . $nmapid . ', { autoPlay:' . $nmaplay . ', repeatPlay:' . (($nmaprepeat == 1) ? 'true' : 'false') . ', ' . $ext_jsp . ' jPlayer:{ swfPath:\'' . JURI::base() . 'modules/mod_nmap/audio/html5/\' } }, "pmapp_' . $nmapid . '"); $PMAPJSE(\'#playlist-pmapp_' . $nmapid . '\').slimScroll({ height: \'' . $pmap5h . '\', color: \'#fff\', size: \'' . $nmapplbwdt . 'px\' }); }); </script>'; } $jseplbg = '.pjpmap-pmapp_' . $nmapid . '{width:' . $pmap5w . '; background: none repeat scroll 0 0 ' . $pmapjspbg . ';} .tracks-pmapp_' . $nmapid . ' { color:' . $pmapjstbg . '} .pjpmap .progress-wrapper{width:' . $pmap5ww . ';}'; $document->addStyleDeclaration($jseplbg); $nmapsound .= '<div id="' . $divid . '"></div>'; } if ($mode == 'local') { foreach ($oggfilesnopath as $oggfilenp) { $oggfiles[] = str_replace('\\', '/', JURI::base() . $oggfilenp); } foreach ($mp3filesnopath as $mp3filenp) { $mp3files[] = str_replace('\\', '/', JURI::base() . $mp3filenp); } $mpjs = "var myPlaylist_$nmapid = ["; if (!empty($mp3files)) { foreach ($mp3files as $mp3file) { $file = $mp3file; $oggctpt = str_replace('.mp3', '.ogg', $file); $ThisFileInfo = $getID3->analyze(str_replace(JURI::base(), JPATH_ROOT . '/', $file)); getid3_lib::CopyTagsToComments($ThisFileInfo); $minutes = (@$ThisFileInfo['playtime_seconds'] < 60) ? '0' : floor(@$ThisFileInfo['playtime_seconds'] / 60); $seconds = round(@$ThisFileInfo['playtime_seconds'] % 60); $seconds = ($seconds < 10) ? '0' . $seconds : $seconds; $time = $minutes . ':' . $seconds; $filearray = titlebuild($nmapid3, $nmapsonginfo, str_replace(JURI::base(), JPATH_ROOT . '/', $file), $nmaptrim); $artists[] = $filearray['artists']; $titles[] = $filearray['titles']; $albums[] = $filearray['albums']; $sortarray[] = str_replace(JURI::base(), JPATH_ROOT . '/', $file); if (preg_match('/ - /', $filearray['filetitle'])) { $titleparts = explode(" - ", $filearray['filetitle']); $artist = $titleparts[0]; $title = $titleparts[1]; } else { $title = $filearray['filetitle']; $artist = ""; } if (is_file(str_replace(JURI::base(), JPATH_ROOT . '/', $oggctpt))) { $oggctpt = str_replace('\\', '/', $oggctpt); $ridx = array_search($oggctpt, $oggfiles); if ($ridx !== false) { unset($oggfiles[$ridx]); unset($ridx); } $mpar[] = "{ mp3:'" . utf8_encode(addslashes($file)) . "', oga:'" . utf8_encode(addslashes($oggctpt)) . "', title:'" . $pj_hlp->strenc($title) . "', artist:'" . $pj_hlp->strenc($artist) . "', duration:'" . $time . "' }"; } else { $mpar[] = "{ mp3:'" . utf8_encode(addslashes($file)) . "', title:'" . $pj_hlp->strenc($title) . "', artist:'" . $pj_hlp->strenc($artist) . "', duration:'" . $time . "' }"; } } } if (!$sfmode) { if (!empty($oggfiles)) { foreach ($oggfiles as $oggfile) { $ThisFileInfo = $getID3->analyze(str_replace(JURI::base(), JPATH_ROOT . '/', $oggfile)); getid3_lib::CopyTagsToComments($ThisFileInfo); $minutes = (@$ThisFileInfo['playtime_seconds'] < 60) ? '0' : round(@$ThisFileInfo['playtime_seconds'] / 60); $seconds = round(@$ThisFileInfo['playtime_seconds'] % 60); $seconds = ($seconds < 10) ? '0' . $seconds : $seconds; $time = $minutes . ':' . $seconds; $filearray = titlebuild($nmapid3, $nmapsonginfo, str_replace(JURI::base(), JPATH_ROOT . '/', $oggfile), $nmaptrim); $artists[] = $filearray['artists']; $titles[] = $filearray['titles']; $albums[] = $filearray['albums']; $sortarray[] = str_replace(JURI::base(), JPATH_ROOT . '/', $oggfile); if (preg_match('/ - /', $filearray['filetitle'])) { $titleparts = explode(" - ", $filearray['filetitle']); $artist = $titleparts[0]; $title = $titleparts[1]; } else { $title = $filearray['filetitle']; $artist = ""; } $mpar[] = "{ oga:'" . utf8_encode(addslashes($oggfile)) . "', title:'" . $pj_hlp->strenc($title) . "', artist:'" . $pj_hlp->strenc($artist) . "', duration:'" . $time . "' }"; } } } if (!empty($mpar)) { $mpar = nsort($nmapshuffle, $mpar, $sortarray, $artists, $titles, $albums); if (!empty($nmapint) && !empty($nmaprfile)) { $ThisFileInfo = $getID3->analyze(str_replace($RURL, JPATH_ROOT . '/', $nmaprfile)); getid3_lib::CopyTagsToComments($ThisFileInfo); $minutes = (@$ThisFileInfo['playtime_seconds'] < 60) ? '0' : floor(@$ThisFileInfo['playtime_seconds'] / 60); $seconds = round(@$ThisFileInfo['playtime_seconds'] % 60); $seconds = ($seconds < 10) ? '0' . $seconds : $seconds; $time = $minutes . ':' . $seconds; if (isset($ThisFileInfo['comments']['title'][0])) { $title = $ThisFileInfo['comments']['title'][0]; } if (isset($ThisFileInfo['comments']['artist'][0])) { $artist = $ThisFileInfo['comments']['artist'][0]; } if (empty($title) || empty($artist)) { $title = basename($nmaprfile, '.mp3'); $title = basename($title, '.MP3'); $artist = ""; } $i = 0; } foreach ($mpar as $mparkey => $mparentry) { if (!empty($nmapint) && !empty($nmaprfile)) { if (($i % $nmapint) == 0 && $i != 0) { $mparf[basename($nmaprfile) . $i] = "{ mp3:'" . utf8_encode(addslashes($nmaprfile)) . "', title:'" . $pj_hlp->strenc($title) . "', artist:'" . $pj_hlp->strenc($artist) . "', duration:'" . $time . "' }"; } $i++; } $mparf[$mparkey] = $mparentry; } $mpjs .= implode(', ', $mparf); } $mpjs .= "];"; } elseif ($mode == 'amazon') { if (!empty($nmapamzk) && !empty($nmapamzsk)) { require_once (JPATH_ROOT . '/modules/mod_nmap/elements/S3.php'); if ($nmapamzbcke == "s3.amazonaws.com") { $nmaps3 = new S3APJ(trim($nmapamzk), trim($nmapamzsk)); } else { $nmaps3 = new S3APJ(trim($nmapamzk), trim($nmapamzsk), true, $nmapamzbcke); } if (preg_match('/\.mp3$/i', $nmapdira)) { $amz_sf_f = "https://$nmapamzbck.$nmapamzbcke/" . $nmapdira; $title = basename($amz_sf_f, '.mp3'); $title = basename($amz_sf_f, '.MP3'); $artist = ""; $mpar[] = "{ mp3:'" . utf8_encode(addslashes($amz_sf_f)) . "', title:'" . htmlentities(urldecode($title), ENT_QUOTES) . "', artist:'" . htmlentities(urldecode($artist), ENT_QUOTES) . "', duration:'N/A' }"; } else { if (preg_match('/(\.mp3|\.ogg)$/i', $nmapdira)) { $nmapdira = str_replace('\\', '/', dirname($nmapdira)); } $buckcontents = $nmaps3->getBucket($nmapamzbck, $nmapdira); if (!empty($buckcontents)) { foreach ($buckcontents as $amzfile) { $amzfname = $amzfile['name']; $furl = "https://$nmapamzbck.$nmapamzbcke/" . $amzfname; if (preg_match("/\.mp3$/i", $furl)) { $buckmp3[] = $furl; } elseif (preg_match("/\.ogg$/i", $furl)) { $buckogg[] = $furl; } } if ((!empty($buckmp3) && !empty($buckogg)) || (!empty($buckmp3) && $nmapamzsmpo == 1)) { foreach ($buckmp3 as $bmp3) { $bogg = str_replace('.mp3', '.ogg', $bmp3); $bogg = str_replace('.MP3', '.OGG', $bogg); if (array_search($bogg, $buckogg) !== false) { $title = basename($bmp3, '.mp3'); $title = basename($title, '.MP3'); $artist = ""; $mpar[basename($bmp3)] = "{ mp3:'" . utf8_encode(addslashes($bmp3)) . "', oga:'" . utf8_encode(addslashes($bogg)) . "', title:'" . htmlentities(urldecode($title), ENT_QUOTES) . "', artist:'" . htmlentities(urldecode($artist), ENT_QUOTES) . "', duration:'N/A' }"; } elseif ($nmapamzsmpo == 1) { $title = basename($bmp3, '.mp3'); $title = basename($title, '.MP3'); $artist = ""; $mpar[basename($bmp3)] = "{ mp3:'" . utf8_encode(addslashes($bmp3)) . "', title:'" . htmlentities(urldecode($title), ENT_QUOTES) . "', artist:'" . htmlentities(urldecode($artist), ENT_QUOTES) . "', duration:'N/A' }"; } } } } } $mpjs = "var myPlaylist_$nmapid = ["; if (!empty($mpar)) { switch ($nmapshuffle) { case '0': { uksort($mpar, array($pj_hlp, 'scbk')); break; } case '1': { shuffle($mpar); break; } case '2': { uksort($mpar, array($pj_hlp, 'rscbk')); break; } } if (!empty($nmapint) && !empty($nmaprfile)) { $ThisFileInfo = $getID3->analyze(str_replace($RURL, JPATH_ROOT . '/', $nmaprfile)); getid3_lib::CopyTagsToComments($ThisFileInfo); $minutes = (@$ThisFileInfo['playtime_seconds'] < 60) ? '0' : floor(@$ThisFileInfo['playtime_seconds'] / 60); $seconds = round(@$ThisFileInfo['playtime_seconds'] % 60); $seconds = ($seconds < 10) ? '0' . $seconds : $seconds; $time = $minutes . ':' . $seconds; if (isset($ThisFileInfo['comments']['title'][0])) { $title = $ThisFileInfo['comments']['title'][0]; } if (isset($ThisFileInfo['comments']['artist'][0])) { $artist = $ThisFileInfo['comments']['artist'][0]; } if (empty($title) || empty($artist)) { $title = basename($nmaprfile, '.mp3'); $title = basename($title, '.MP3'); $artist = ""; } $i = 0; } foreach ($mpar as $mparkey => $mparentry) { if (!empty($nmapint) && !empty($nmaprfile)) { if (($i % $nmapint) == 0 && $i != 0) { $mparf[basename($nmaprfile) . $i] = "{ mp3:'" . utf8_encode(addslashes($nmaprfile)) . "', title:'" . htmlentities(urldecode($title), ENT_QUOTES) . "', artist:'" . htmlentities(urldecode($artist), ENT_QUOTES) . "', duration:'" . $time . "' }"; } $i++; } $mparf[$mparkey] = $mparentry; } $mpjs .= implode(', ', $mparf); } $mpjs .= "];"; } } elseif ($mode == 'dropbox') { $nmapdira = str_replace('?dl=0', '', $nmapdira); if (preg_match('/\.mp3$/i', $nmapdira)) { $mpar[] = "{ mp3 : '" . utf8_encode(addslashes($nmapdira . "?dl=1")) . "', title : '" . htmlentities(urldecode(basename($nmapdira)), ENT_QUOTES) . "', artist : '', duration : 'N/A' }"; } else { if (function_exists('curl_version')) { $ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_URL, $nmapdira); curl_setopt($ch, CURLOPT_REFERER, $nmapdira); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $dbpage_dump = curl_exec($ch); curl_close($ch); } else { $dbpage_dump = @file_get_contents($nmapdira); } if (!empty($dbpage_dump)) { $dbmp3s = array(); $dboggs = array(); preg_match_all('/<a data-media-index=".*?" href="(?P<files>.*)\?dl=0"/U', $dbpage_dump, $files); foreach ($files['files'] as $file) { if (preg_match('/\.mp3/i', $file)) { $dbmp3s[] = $file; } elseif (preg_match('/\.ogg/i', $file)) { $dboggs[] = $file; } } if ((!empty($dbmp3s) && !empty($dboggs)) || (!empty($dbmp3s) && $nmapamzsmpo == 1)) { foreach ($dbmp3s as $dbmp3) { $dbmp3 = str_replace('?dl=0', '', $dbmp3); $dbogg = str_replace('.mp3', '.ogg', $dbmp3); $dbogg = str_replace('.MP3', '.OGG', $dbogg); if (array_search($dbogg, $dboggs) !== false) { $title = basename($dbmp3, '.mp3'); $title = basename($title, '.MP3'); $artist = ""; $mpar[basename($dbmp3)] = "{ mp3:'" . utf8_encode(addslashes($dbmp3 . "?dl=1")) . "', oga:'" . utf8_encode(addslashes($dbogg . "?dl=1")) . "', title:'" . htmlentities(urldecode($title), ENT_QUOTES) . "', artist:'" . htmlentities(urldecode($artist), ENT_QUOTES) . "', duration:'N/A' }"; } elseif ($nmapamzsmpo == 1) { $title = basename($dbmp3, '.mp3'); $title = basename($title, '.MP3'); $artist = ""; $mpar[basename($dbmp3)] = "{ mp3:'" . utf8_encode(addslashes($dbmp3 . "?dl=1")) . "', title:'" . htmlentities(urldecode($title), ENT_QUOTES) . "', artist:'" . htmlentities(urldecode($artist), ENT_QUOTES) . "', duration:'N/A' }"; } } } } else { $mpar[] = "{ mp3:'" . addslashes("ERROR.mp3") . "', title:'cURL or OpenSSL libraries must be installed!', artist:'Error!', duration:'N/A' }"; } } $mpjs = "var myPlaylist_$nmapid = ["; if (!empty($mpar)) { switch ($nmapshuffle) { case '0': { uksort($mpar, array($pj_hlp, 'scbk')); break; } case '1': { shuffle($mpar); break; } case '2': { uksort($mpar, array($pj_hlp, 'rscbk')); break; } } if (!empty($nmapint) && !empty($nmaprfile)) { $ThisFileInfo = $getID3->analyze(str_replace($RURL, JPATH_ROOT . '/', $nmaprfile)); getid3_lib::CopyTagsToComments($ThisFileInfo); $minutes = (@$ThisFileInfo['playtime_seconds'] < 60) ? '0' : floor(@$ThisFileInfo['playtime_seconds'] / 60); $seconds = round(@$ThisFileInfo['playtime_seconds'] % 60); $seconds = ($seconds < 10) ? '0' . $seconds : $seconds; $time = $minutes . ':' . $seconds; if (isset($ThisFileInfo['comments']['title'][0])) { $title = $ThisFileInfo['comments']['title'][0]; } if (isset($ThisFileInfo['comments']['artist'][0])) { $artist = $ThisFileInfo['comments']['artist'][0]; } if (empty($title) || empty($artist)) { $title = basename($nmaprfile, '.mp3'); $title = basename($title, '.MP3'); $artist = ""; } $i = 0; } foreach ($mpar as $mparkey => $mparentry) { if (!empty($nmapint) && !empty($nmaprfile)) { if (($i % $nmapint) == 0 && $i != 0) { $mparf[basename($nmaprfile) . $i] = "{ mp3:'" . utf8_encode(addslashes($nmaprfile)) . "', title:'" . htmlentities(urldecode($title), ENT_QUOTES) . "', artist:'" . htmlentities(urldecode($artist), ENT_QUOTES) . "', duration:'" . $time . "' }"; } $i++; } $mparf[$mparkey] = $mparentry; } $mpjs .= implode(', ', $mparf); } $mpjs .= "];"; } elseif ($mode == 'remote') { foreach ($allfilesnopath as $afnp) { if (preg_match('/ - /', $afnp['title'])) { $titleparts = explode(" - ", $afnp['title']); $artist = $titleparts[0]; $title = $titleparts[1]; } else { $title = $afnp['title']; $artist = ""; } $oggrfile = str_replace('.mp3', '.ogg', $afnp['file']); $oggrfile = str_replace('.MP3', '.MP3', $oggrfile); $mpar[basename($afnp['file'])] = "{ mp3:'" . utf8_encode(addslashes($afnp['file'])) . "', oga:'" . utf8_encode(addslashes($oggrfile)) . "', title:'" . htmlentities(urldecode($title), ENT_QUOTES) . "', artist:'" . htmlentities(urldecode($artist), ENT_QUOTES) . "', duration:'" . $afnp['time'] . "' }"; } $mpjs = "var myPlaylist_$nmapid = ["; if (!empty($mpar)) { switch ($nmapshuffle) { case '0': { uksort($mpar, array($pj_hlp, 'scbk')); break; } case '1': { shuffle($mpar); break; } case '2': { uksort($mpar, array($pj_hlp, 'rscbk')); break; } } if (!empty($nmapint) && !empty($nmaprfile)) { $ThisFileInfo = $getID3->analyze(str_replace($RURL, JPATH_ROOT . '/', $nmaprfile)); getid3_lib::CopyTagsToComments($ThisFileInfo); $minutes = (@$ThisFileInfo['playtime_seconds'] < 60) ? '0' : floor(@$ThisFileInfo['playtime_seconds'] / 60); $seconds = round(@$ThisFileInfo['playtime_seconds'] % 60); $seconds = ($seconds < 10) ? '0' . $seconds : $seconds; $time = $minutes . ':' . $seconds; if (isset($ThisFileInfo['comments']['title'][0])) { $title = $ThisFileInfo['comments']['title'][0]; } if (isset($ThisFileInfo['comments']['artist'][0])) { $artist = $ThisFileInfo['comments']['artist'][0]; } if (empty($title) || empty($artist)) { $title = basename($nmaprfile, '.mp3'); $title = basename($title, '.MP3'); $artist = ""; } $i = 0; } foreach ($mpar as $mparkey => $mparentry) { if (!empty($nmapint) && !empty($nmaprfile)) { if (($i % $nmapint) == 0 && $i != 0) { $mparf[basename($nmaprfile) . $i] = "{ mp3:'" . utf8_encode(addslashes($nmaprfile)) . "', title:'" . htmlentities(urldecode($title), ENT_QUOTES) . "', artist:'" . htmlentities(urldecode($artist), ENT_QUOTES) . "', duration:'" . $time . "' }"; } $i++; } $mparf[$mparkey] = $mparentry; } $mpjs .= implode(', ', $mparf); } $mpjs .= "];"; } if ($nmapptype != 'html5pop') { $document->addScriptDeclaration($mpjs); } if ($nmapptype == 'html5pop' || $nmapptype == 'html5mixed') { $pmap_pop = 'nmapopup'; if (empty($nmapptitle)) { $nmapptitle = 'Pro Magic Audio Player'; } if ($nmapopt == '1') { $pmap_pop = 'nmapopup_' . rand(100, 999); } $buturl = $RURL . "plugins/content/nmapp/" . $nmapbut . ".png"; $popwidth = $nmapwidth + $nmapwcor; $popheight = $nmapheight + $nmapwcor; $popbuff = '<!DOCTYPE html> <html> <head> <title>' . $nmaptitle . '</title> <base href="' . $RURL . '" /> <link rel="stylesheet" href="' . $RURL . 'modules/mod_nmap/audio/html5/css/pmap.css" type="text/css" /> <script type="text/javascript" src=" //code.jquery.com/jquery-1.8.1.min.js"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.js"></script> <script type="text/javascript" src="' . $RURL . 'modules/mod_nmap/audio/html5/jsengine.js"></script> <style type="text/css"> .pjpmap-pmapp_' . $nmapid . '{ width:' . $pmap5w . '; background: none repeat scroll 0 0 ' . $pmapjspbg . ' ; } .tracks-pmapp_' . $nmapid . '{ color:' . $pmapjstbg . '; } .pjpmap .progress-wrapper { width:' . $pmap5ww . '; } #' . $divid . '{ text-align:' . $objalign . '; } </style> <script type="text/javascript"> var $PMAPJSE = jQuery.noConflict(); $PMAPJSE(document).ready(function() { window.innerWidth = ' . $popwidth . '; window.innerHeight = ' . $popheight . '; $PMAPJSE("#' . $divid . '").pjpmap(myPlaylist_' . $nmapid . ', { autoPlay:' . $nmaplay . ', repeatPlay:' . (($nmaprepeat == 1) ? "true" : "false") . ', ' . $ext_jsp . ' jPlayer:{ swfPath:"' . JURI::base() . 'modules/mod_nmap/audio/html5/" } }, "pmapp_' . $nmapid . '"); $PMAPJSE("#playlist-pmapp_' . $nmapid . '").slimScroll({ height: "' . $pmap5h . '", color: "#fff", size: "' . $nmapplbwdt . 'px" }); }); ' . $mpjs . ' </script> </head> <body bgcolor="#' . $defbg . '"> <div id="' . $divid . '"></div> </body> </html> '; if (!@JFile::write(JPATH_ROOT . '/cache/mod_nmap/pmapp_' . $plgid . '.html', $popbuff)) { $scontent = array("RURL" => $RURL, "playlist" => $mpjs, "id" => $nmapid, "plugin" => true, "title" => $nmaptitle, "pmap5w" => $pmap5w, "pmapjspbg" => $pmapjspbg, "pmapjstbg" => $pmapjstbg, "pmap5ww" => $pmap5ww, "divid" => $divid, "objalign" => $objalign, "popwidth" => $popwidth, "popheight" => $popheight, "nmaplay" => $nmaplay, "nmaprepeat" => $nmaprepeat, "pmap5h" => $pmap5h, "nmapplbwdt" => $nmapplbwdt, "defbg" => $defbg, "popextjsp" => $popextjsp); $scontent = base64_encode(serialize($scontent)); $h5popjs = " function sendWindowContent_" . $nmapid . "(){ var form = document.createElement('form'); form.method = 'POST'; form.action = '" . $RURL . "modules/mod_nmap/audio/popuphtml5.php'; form.target = '$pmap_pop'; var body = document.getElementsByTagName('body')[0]; body.appendChild(form); var sconel = document.createElement('input'); sconel.type = 'hidden'; sconel.name = 'senddata'; sconel.value = '" . $scontent . "'; form.appendChild(sconel); window.open('','$pmap_pop','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=$popwidth,height=$popheight,left=50,top=50'); form.submit(); body.removeChild(form); } "; $document->addScriptDeclaration($h5popjs); $nmapsound .= "<div id=\"".$divid."_pop\"> <a href=\"JavaScript:void(0);\" onclick=\"sendWindowContent_" . $nmapid . "();\"><img style=\"outline:none;\" src=\"$buturl\" border=\"0\" alt=\"Click\"/></a> </div>"; } else { $nmapsound .= "<div id=\"".$divid."_pop\"><a href=\"JavaScript:void(0);\" onclick=\"nmapopup=window.open('" . $RURL . "cache/mod_nmap/pmapp_" . $plgid . ".html?cb=" . time() . "','$pmap_pop','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=$popwidth,height=$popheight,left=50,top=50'); return false;\"><img style=\"outline:none;\" src=\"$buturl\" border=\"0\" alt=\"Click\"/></a></div>"; } } } if ($nmapptype == 'normal' || $nmapptype == 'normalmixed') { $xmlurl = $send; $playerurl = $RURL . "modules/mod_nmap/audio/nmaplayer.swf?id=$nmapid"; $nmapsound .= "<div style=\"text-align:$objalign\"><object style=\"outline:none;\" type=\"application/x-shockwave-flash\" id=\"nmap_$nmapid\" data=\"$playerurl\" width=\"$nmapwidth\" height=\"$nmapheight\"> <param name=\"movie\" value=\"$playerurl\" /> <param name=\"base\" value=\"$RURL\" /> <param name=\"wmode\" value=\"transparent\" /> <param name=\"flashvars\" value=\"uid=$xmlurl\" /> </object></div>"; } if ($nmapptype != 'normal' && $nmapptype != 'normalmixed' && $nmapptype != 'popup' && $nmapptype != 'html5' && $nmapptype != 'html5pop' && $nmapptype != 'html5mixed') { return "Parameter 1 must be \"normal\" or \"popup\", $nmapptype is invalid! Please recheck your settings."; } $upurl = $RURL . "modules/mod_nmap/elements/fp.php?url=" . strtr(base64_encode(addslashes(gzcompress(serialize($RURL), 9))), '+/=', '-_,') . "&modid=" . $plgid; $upbut = $RURL . "modules/mod_nmap/elements/fenup.png"; $fenup = "<div style=\"text-align:center\"><a href=\"javascript:void(0);\" onclick=\"nmapopup=window.open('$upurl','nmapfenup','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=500,height=300,left=150,top=150'); return false;\"><img style=\"outline:none;\" src=\"$upbut\" border=\"0\" alt=\"Click\"/></a></div>"; if ($nmapfenup == '1') { $fenupxml = '<?xml version="1.0" encoding="utf-8"?>' . "\n"; if ($nmapfenupsf == '1') { $nmapfenupsf = 'true'; } else { $nmapfenupsf = 'false'; } if (empty($nmapfenupf)) { $nmapfenupf = '0'; } if ($nmapfenufo == '1') { $nmapfenupdf .= ':o'; } if ($nmapfenufau == '1') { $nmapfenupdf .= ':au'; } $nmapfenupf = str_replace(' ', '', $nmapfenupf); $fenupxml .= '<settings> <defaultFolder>' . $nmapfenupdf . '</defaultFolder> <mainColor>0x000000</mainColor> <browseColor>0x2E2E2E</browseColor> <uploadColor>0x2E2E2E</uploadColor> <itemColor>0xFF0000</itemColor> <userSetFolder>' . $nmapfenupsf . '</userSetFolder> <basePath>' . base64_encode(JPATH_ROOT) . '</basePath> <limitFolders>' . base64_encode($nmapfenupf) . '</limitFolders> <filetypes><label>Supported Audio (*.mp3, *.MP3, *.ogg, *.OGG)</label><type>*.mp3;*.MP3,*.ogg;*.OGG</type></filetypes></settings>'; JFile::write(JPATH_ROOT . "/modules/mod_nmap/elements/fenup_" . $plgid . ".xml", $fenupxml); $user = JFactory::getUser(); $user_grps = JAccess::getGroupsByUser($user_id, false); $ingroups = false; $canchange = false; if ($user_id !== 0 && in_array($nmapfenugrp, $user_grps)){ $canchange = true; $ingroups = true; } elseif ($user_id !== 0 && in_array($nmapfenugrp2, $user_grps)){ $ingroups = true; } elseif ($user_id !== 0 && in_array($nmapfenugrp2, $user_grps)){ $ingroups = true; } if ($ingroups) { $document->addScriptDeclaration(' function fensubmit' . $plgid . '(mode){ var fenform = document.forms["feform' . $plgid . '"]; var checkboxes = document.getElementsByName("mp3s' . $plgid . '[]"); var filled = false; for (var i=0, n=checkboxes.length;i<n;i++) { if (checkboxes[i].checked){ filled = true; break; } } if (mode != undefined && filled) { fenform.fentask' . $plgid . '.value = mode; fenform.submit(); } }'); if ((isset($_POST['fentask' . $plgid]) && !empty($_POST['fentask' . $plgid])) && isset($_POST['mp3s' . $plgid])) { $mp3sd = $_POST['mp3s' . $plgid]; foreach ($mp3sd as $mp3d) { if ($_POST['fentask' . $plgid] == 'delete') { JFile::delete($mp3d); } else { if (preg_match('/(ogg|ggo|mp3|3pm)$/i', $mp3d)) { $mp3dpath = pathinfo($mp3d); JFile::move($mp3d, $mp3dpath['dirname'] . '/' . $mp3dpath['filename'] . '.' . strrev($mp3dpath['extension'])); } } } unset($_POST['mp3s' . $plgid]); unset($_POST['fentask' . $plgid]); $site = JApplication::getInstance('site'); $site->redirect(JURI::current()); } if ($nmapfenufau == 1) { if ($canchange) { $ext_inp = '<input type="button" value="Delete Selected" onclick="fensubmit' . $plgid . '(\'delete\')"/><input type="button" value="Un/Authorize" onclick="fensubmit' . $plgid . '(\'uauth\')"/>'; } else { $ext_inp = ''; } } else { $ext_inp = '<input type="button" value="Delete Selected" onclick="fensubmit' . $plgid . '(\'delete\')"/>'; } $nmapsound = '<center><form action="' . JURI::current() . '" method="post" name="feform' . $plgid . '"> <table align="' . $objalign . '" border="0"> <tbody> <tr> <td>' . $nmapsound . '</td> <td align="left" valign="top">' . $fenup . '</td> </tr>'; if ($nmapfenufl) { $nmapfenupdf = str_replace(':o', '', $nmapfenupdf); $nmapfenupdf = str_replace(':au', '', $nmapfenupdf); $nmapsound .= ' <tr> <td><b>Showing files from: </b><font color="#ff0000">' . $nmapfenupdf . '</font></td> <td>' . $ext_inp . '</td> </tr>'; $mp3s = $pj_hlp->mp3_getfiles(JPATH_ROOT . '/' . $nmapfenupdf, true, true); if (!empty($mp3s)) { foreach ($mp3s as $mp3) { $nmapsound .= '<tr><td align="left" ' . ((preg_match('/(3pm|ggo)$/', $mp3)) ? 'bgcolor="#FF0B0B"' : '') . ' valign="top">' . str_replace(JPATH_ROOT . '/' . $nmapfenupdf . '/', "", $mp3) . '</td><td align="center" valign="top"><input type="checkbox" name="mp3s' . $plgid . '[]" value="' . $mp3 . '" /></td></tr>'; } } } $nmapsound .= '</tbody></table><input type="hidden" name="fentask' . $plgid . '" id="fentask' . $plgid . '" value=""/></form></center>'; } } return $nmapsound; } public function nmapp_encode($string, $key) { $j = null; $hash = null; $key = sha1($key); $strLen = strlen($string); $keyLen = strlen($key); for ($i = 0; $i < $strLen; $i++) { $ordStr = ord(substr($string, $i, 1)); if ($j == $keyLen) { $j = 0; } $ordKey = ord(substr($key, $j, 1)); $j++; $hash .= strrev(base_convert(dechex($ordStr + $ordKey), 16, 36)); } return $hash; } } ?>
Simpan