/* Begin includes. */
ini_set('include_path', ini_get('include_path') .':'. FILE_ROOT .'/php:/home/ninepoin/php');
require_once("Mail.php");require_once("Mail/mime.php");
/* Fin includes. */
/* Begin functions. */
function random_string($len=8){$chars=sprintf("%s%s%s",join("",range("a","z")),join("",range("A", "Z")),join("",range("0","9")));$rand_str="";for ($i=0;$i<$len;$i++){$rand_str.=$chars{rand(0,strlen($chars))};}return $rand_str;}
function make_message($msg=""){$msg.="FIRST NAME: ".trim($_REQUEST['first_name'])."\n\n";$msg.="LAST NAME: ".trim($_REQUEST['last_name'])."\n\n";$msg.="EMAIL: ".trim($_REQUEST['email'])."\n\n";$msg.="ADDRESS: ".trim($_REQUEST['address_1'])."\n\n".(trim($_REQUEST['address_2'])!=""?trim($_REQUEST['address_2'])."\n\n":"");$msg.="CITY: ".trim($_REQUEST['city'])."\n\n";$msg.="STATE: ".trim($_REQUEST['state'])."\n\n";$msg.="ZIP: ".trim($_REQUEST['zip'])."\n\n";$msg.="BIO: ".trim($_REQUEST['bio'])."\n\n";return "Here's the info entered:\n\n".$msg;}
function init_directory($dir=""){if ($dir==""){return false;}if (!file_exists(FILE_ROOT."/".$dir)||file_exists(FILE_ROOT."/".$dir)&&!is_dir(FILE_ROOT."/".$dir)){mkdir(FILE_ROOT."/".$dir);chmod(FILE_ROOT."/".$dir,0755);}}
function handle_files($dir="",$msg=""){global $atts;if ($dir==""){return false;}if (!file_exists(FILE_ROOT."/".$dir)||file_exists(FILE_ROOT."/".$dir)&&!is_dir(FILE_ROOT."/".$dir)){return false;}$cnt=1;foreach (array_keys($_FILES) as $key){if (empty($_FILES[$key]['name'])==false){if (((filesize($_FILES[$key]['tmp_name'])/1024)/1024)<=MAX_MBS){move_uploaded_file($_FILES[$key]['tmp_name'],FILE_ROOT."/".$dir."/".$_FILES[$key]['name']);if (file_exists(FILE_ROOT."/".$dir."/".$_FILES[$key]['name'])){chmod(FILE_ROOT."/".$dir."/".$_FILES[$key]['name'],0755);$atts[]=FILE_ROOT."/".$dir."/".$_FILES[$key]['name'];$msg.="Upload #".$cnt++." (Link): ".HTTP_ROOT."/".$dir."/".preg_replace("/\+/","%20",urlencode($_FILES[$key]['name']))."\n\n";}}}}return $msg;}
function send_notification($msg="",$atts=array()){$text=$msg;$html="
".preg_replace("/\n/"," ",$msg)."";$to=TO_ADDR;$head=array("From"=>"Omphalos Submission Form ","Reply-to"=>"Omphalos Submission Form ","Cc"=>CC_ADDR,"Bcc"=>"","Subject"=>"Omphalos Form Submitted!");$mime=new Mail_mime("\n");if (count($atts)>0){for ($i=0;$iaddAttachment($atts[$i], 'application/octet-stream');}}}$mime->setTXTBody($text);$mime->setHTMLBody($html);$body=$mime->get();$head=$mime->headers($head);$mail=&Mail::factory("mail");$mail->send($to,$head,$body);return true;}
/* Fin functions. */
/* Begin processing. */
define(FILE_ROOT,$_SERVER['DOCUMENT_ROOT']."/omphalos");define(HTTP_ROOT,"http://ninepointpublishing.com/omphalos");define(MAX_MBS,1.25);define(TO_ADDR,"omphalos@ninepointpublishing.com");define(CC_ADDR,"geoff@ninepointpublishing.com");set_time_limit(360);$msg="";$atts=array();if (isset($_REQUEST['dowhat'])){if ($_REQUEST['dowhat']=="Send to Omphalos!"){$msg=make_message($msg);$dir="submissions/".random_string(32);init_directory($dir);$msg=handle_files($dir,$msg);send_notification($msg."Uploaded files are linked and they are attached to this message.\n\n",$atts);header("Location: thankyou.html");exit;}}$tabindex=1;
/* Fin processing. */
?>
Omphalos | Nine Point Publishing | ninepointpublishing.com
Submission Guidelines
no simultaneous submissions!
hard copies are welcomed but not preferred
text should be editable in any common word processing format
maximum seven poems (please contact us about long poems or use your best judgement)
maximum 5000 words of prose
artwork should be CMYK at 300dpi with a long edge of minimum 6 inches
all formats okay (jpeg, tiff, psd, pdf, eps, etc.) EXCEPT bmp and gif
Please email us if you have any further questions about submitting your work.
Submission by Mail
Omphalos Submissions
c/o Nine Point Publishing
PO Box 360
Bridgton, Maine - 04009