if (!is_array($arrXml)) {
     $xmlStr = cu3er__our_fopen($testXmlFile);
     if ($xmlStr == false) {
         echo $cu3er_messages['missingXML'];
     } else {
         $xmlStr = preg_replace('/\\<transition(.*?)\\>/', '<transition empty="true"$1>', $xmlStr);
         $arrXml = $xml_debugger->parse($xmlStr);
     }
 }
 if (!is_array($arrXml)) {
     echo $cu3er_messages['notXML'];
 } else {
     $xml_parse = simplexml_load_string($xmlStr);
     /*@chmod($testXmlFile, 0777);
     		@chmod($cu3er_pathDir . '/CU3ER.swf', 0777);*/
     cu3er__chmodDir($dir, 0777, 0777);
     $arrXml = cu3er__array_remove_empty($arrXml['data']);
     // everything is ok //
     if ($arrXml['project_settings']['width'] == '') {
         if ($zipFileType) {
             $newStr = file_get_contents($dir . '/' . 'embed_example.html');
             preg_match_all('/swfobject\\.embedSWF\\((.*?)\\)/', $newStr, $values);
             $dimensions = explode(",", $values[1][0]);
         } else {
             $dimensions[2] = $arrXml['slides']['attr']['width'];
             $dimensions[3] = $arrXml['slides']['attr']['height'];
         }
     }
     $xml['Settings'] = array('cu3er_location' => $zipFileType ? $cu3er_pathDir . '/CU3ER.swf' : '', 'js_location' => $zipFileType ? $cu3er_pathDir . '/js/jquery.cu3er.js' : '', 'js_player_location' => $zipFileType ? $cu3er_pathDir . '/js/jquery.cu3er.player.js' : '', 'licence' => urlencode($licence));
     if (cu3er__isHttpPath($arrXml['settings']['folder_images']['value'])) {
         $urlFolderPath = true;
function cu3er__chmodDir($path = '.', $dirMod = '0755', $fileMod = '0644')
{
    $ignore = array("cgi-bin", ".", "..");
    $extensionAllow = array('xml', 'jpg', 'jpeg', 'gif', 'png', 'swf');
    $dh = @opendir($path);
    while (false !== ($file = readdir($dh))) {
        if (in_array(end(explode(".", $file)), $extensionAllow) || is_dir($path . '/' . $file)) {
            if (!in_array($file, $ignore)) {
                if (is_dir($path . "/" . $file)) {
                    chmod($path . "/" . $file, $dirMod);
                    cu3er__chmodDir($path . "/" . $file, $dirMod, $fileMod);
                } else {
                    chmod($path . "/" . $file, $fileMod);
                }
            }
        }
    }
    closedir($dh);
}