if (substr($podcast_folder, 0, 1) != "/") { $dir = str_replace("\\", "/", getcwd()) . "/" . $podcast_folder . "/" . $title; } else { $dir = $podcast_folder . "/" . $title; } // Now let's create the directory we need makedir($dir); $imgFile = $dir . "/" . $title . ".jpg"; $iData = file_get_contents($image); $handle = fopen($imgFile, "w"); fwrite($handle, $iData); fclose($handle); } // Now let's create the node in the backend and assign it some values $newNode = new jzMediaNode($node->getPath("string") . "/" . $_POST['edit_podcast_path']); $newNode->addDescription($desc); $newNode->addMainArt($imgFile); // Now let's loop and look at each enclosure $i = 1; foreach ($retArray as $item) { // Let's grab it $track = getPodcastData($item, $title); if (stristr($track, ".mp3")) { // Now that we've got the link we need to add it to the backend $ext = substr($item['file'], strlen($item['file']) - 3, 3); $nTrack = trim(cleanFileName($item['title'] . "." . $ext)); $pArr = explode("/", $_POST['edit_podcast_path']); $path = array(); foreach ($pArr as $p) { $path[] = $p; }