$sql"; print mysql_error(); exit; } // Handling Old and New pictures. // // Array for looping through pics $Pic_Array = array("","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p"); for ($z=1; $z <=10; ++$z){ if ( (isset($HTTP_POST_FILES['picture'.$z]['name']) && is_uploaded_file($HTTP_POST_FILES['picture'.$z]['tmp_name']))){ // Determine Picture Array Values ${PicInfo.$z} = @GetImageSize(${picture.$z}); if ( (${PicInfo.$z}[2] == 1) || (${PicInfo.$z}[2] == 2) || (${PicInfo.$z}[2] == 3) ){ // is image outside limits if so reset ${total_size.$z} = ${PicInfo.$z}[0] * ${PicInfo.$z}[1]; if ( ((${PicInfo.$z}[0] > 600) || (${PicInfo.$z}[1] > 600)) && (${total_size.$z} > 360000) ) { if (${PicInfo.$z}[0] > ${PicInfo.$z}[1]){ ${new_height_ratio.$z} = ${PicInfo.$z}[0] / 600; ${new_height.$z} = ${PicInfo.$z}[1] / ${new_height_ratio.$z}; ${new_width.$z} = 600; }else{ ${new_width_ratio.$z} = ${PicInfo.$z}[1] / 600; ${new_width.$z} = ${PicInfo.$z}[0] / ${new_width_ratio.$z}; ${new_height.$z} = 600; } }else{ ${new_width.$z} = ${PicInfo.$z}[0]; ${new_height.$z} = ${PicInfo.$z}[1]; } ${NewPic.$z} = imagecreatetruecolor(${new_width.$z}, ${new_height.$z}); // Create New Image platform if (${PicInfo.$z}[2] == 1){ ${New_Image.$z} = "pictures/$story$Pic_Array[$z].gif"; ${image.$z} = imagecreatefromgif(${picture.$z}); // Creating picture } if (${PicInfo.$z}[2] == 2){ ${New_Image.$z} = "pictures/$story$Pic_Array[$z].jpg"; ${image.$z} = imagecreatefromjpeg(${picture.$z}); // Creating picture } if (${PicInfo.$z}[2] == 3){ ${New_Image.$z} = "pictures/$story$Pic_Array[$z].png"; ${image.$z} = imagecreatefrompng(${picture.$z}); // Creating picture } imagecopyresized(${NewPic.$z}, ${image.$z}, 0, 0, 0, 0, ${new_width.$z}, ${new_height.$z}, ${PicInfo.$z}[0], ${PicInfo.$z}[1]); // Resample / Resize imagejpeg(${NewPic.$z}, ${New_Image.$z},80); // Write file to directory }else{ $New_ImageA= 'Invalid picture format. You tried to upload: '.$HTTP_POST_FILES['picture'.$z]['type']; } // Save to Database $sql = "update stories set picture".$Pic_Array[$z]." = '${New_Image.$z}' where id = '$story' "; $result = mysql_query($sql, $conn); if(isset($result)){ $saved_picture = "yes"; } } } // Audio file being uploaded and labeled within DB if ( (isset($HTTP_POST_FILES['audio1']['name']) && is_uploaded_file($HTTP_POST_FILES['audio1']['tmp_name']))) { if (!isset($story)) $story = mysql_insert_id(); // $Atype = basename($HTTP_POST_FILES['audio1']['type']); $Aname = $_FILES['audio1']['name']; $Asize = $_FILES['audio1']['size']; $Atype = $_FILES['audio1']['type']; $str = "$Aname"; $pat = "\."; $arr = split($pat, $str); $Audio_type = ("$arr[1]"); switch ($Audio_type) { case 'wma': case 'WMA': case 'wav': case 'WAV': case 'mp3': case 'MP3': case 'avi': case 'AVI': case 'rm': case 'RM': $Afilename = "audios/$story.$Audio_type"; move_uploaded_file($HTTP_POST_FILES['audio1']['tmp_name'], $Afilename); $sql = "update stories set audio = '$Afilename' where id = $story"; $result = mysql_query($sql, $conn); if(!isset($result)){ $state = "broke early"; break; }else{ $Aisfilename = "/home/tracyp/public_html/content_publisher/audios/$story.rpm"; $Adisplay_block = "http://www.peoplesdelawarehomes.com/content_publisher/$Afilename"; if (file_exists($Aisfilename)) { $fileexists = "yes"; } else { $newfile = fopen ($Aisfilename, "w+") or die ("Couldn't create file!"); fclose($newfile); $fileexists = "no"; $write = "yes"; } $myAfile = fopen($Aisfilename, "w+") or die ("Couldn't open file!"); fwrite($myAfile, $Adisplay_block) or die ("Couldn't write to file!"); fclose($myAfile); $rtname = "$story"; } break; default: $audio_error = 'Invalid audio format. You tried to upload: '.$HTTP_POST_FILES['audio1']['type'].'- with the extension: '.$Audio_type; $sql = "update stories set audio = '$audio_error' where id = $story"; $result = mysql_query($sql, $conn); if(!isset($result)){ } } } /// Creating XML files for MP3 Player $basedir="/home/tracyp/public_html/"; /// Who are we writing this file for $filename="playlist.xml"; /// Starting XML file data information $display_block = ' '; $display_block .= " \n"; $display_block .= " \n"; /// We are going to pull photos and then set the names of the images and thumbnails $i =1; $sql="select headline, story_description, audio from stories WHERE page = 'Audio Interview' and published != '' order by published asc"; $result = mysql_query($sql, $conn); while ($s = mysql_fetch_array($result)) { /// Variable for Flash XML File $line = '