140) { $error = "The maximum length for your title is 140 characters."; $success = false; } if($success && empty($post)) { $error = "You need to submit an actual description for the podcast."; $success = false; } if($success && empty($file)) { $error = "You need to upload a file for the podcast."; $success = false; } if($success && !$user->admin) { $error = "You are not allowed to post to this podcast."; $success = false; } if($success) { mkdir($_CONF['podcast_dir'].$title, 0777, true); $files = explode(',', $file); foreach ($files as $single) { rename($_CONF['podcast_dir'].$single, $_CONF['podcast_dir'].$title.'/'.$single); } $data = array( "title" => $title, "tags" => "", "description" => $post, "file_name" => $file, "date_posted" => date("Y-m-d H:i:s",time()) ); $post_id = $db->insert($data, 'podcast'); unset($_POST); echo "true"; } else { unset($_POST); echo $error; } } else { echo "$_POST is not set."; } ?>