if($_POST) {
require_once("dompdf-0.5.1/dompdf_config.inc.php");
if ( isset( $_POST["abs_text"] ) ) {
if ( get_magic_quotes_gpc() )
$_POST["abs_text"] = stripslashes($_POST["abs_text"]);
//$old_limit = ini_set("memory_limit", "16M");
$abs_title = ucfirst($_POST["abs_title"]);
if(count($_POST["abs_author_lastname"])>1) {
foreach($_POST["abs_author_lastname"] as $key=>$author) {
$author = ucfirst($_POST["abs_author_firstname"][$key])." ".ucfirst($_POST["abs_author_lastname"][$key]);
if($_POST["abs_presenter"][$key]==1) {
$abs_authors[] = "".$author." (".($key+1).")";
} else {
$abs_authors[] = $author." (".($key+1).")";
}
}
$abs_authors = implode(', ',$abs_authors);
} else {
$author = ucfirst($_POST["abs_author_firstname"][0])." ".ucfirst($_POST["abs_author_lastname"][0]);
if($_POST["abs_presenter"][0]==1) {
$abs_authors = "".$author."";
} else {
$abs_authors = $author;
}
}
if(count($_POST["abs_author_lastname"])>1) {
foreach($_POST["abs_author_lastname"] as $key=>$author) {
$abs_affiliations[] = "(".($key+1).") ".ucfirst($_POST["abs_affiliation"][$key]);
}
$abs_affiliations = implode(', ',$abs_affiliations);
} else {
$abs_affiliations = ucfirst($_POST["abs_affiliation"][0]);
}
$html = '
'.stripslashes(get_option('abstracts_html_header')).'
'.$abs_title.'
'.$abs_authors.'
'.$abs_affiliations.'
'.nl2br($_POST["abs_text"]).'
';
$wpdb->show_errors();
$wpdb->query($wpdb->prepare("INSERT INTO ".$wpdb->prefix."submitted_abstracts (title,authors,author_affiliation,text,html,name,email,presentation_mode,data) VALUES (%s,%s,%s,%s,%s,%s,%s,%s,NOW())",$abs_title,$abs_authors,$abs_affiliations,$_POST["abs_text"],$html,$_POST["your_firstname"].' '.$_POST["your_lastname"],$_POST["your_email"],$_POST["your_preference"]));
$abstract_id = $wpdb->insert_id;
if($_FILES) {
foreach($_FILES['attachments']['error'] as $key=>$error) {
if($error==0) {
$fileName = $_FILES['attachments']['name'][$key];
$tmpName = $_FILES['attachments']['tmp_name'][$key];
$fileSize = $_FILES['attachments']['size'][$key];
$fileType = $_FILES['attachments']['type'][$key];
$fileExtension = explode('.',$fileName);
$fileExtension = strtolower($fileExtension[count($fileExtension)-1]);
if(in_array($fileExtension,explode(' ',get_option('abstracts_permitted_attachments'))) and $fileSize<=get_option('abstracts_maximum_attach_size')) {
$fp = fopen($tmpName, 'r');
$fileContent = rawurlencode(fread($fp, $fileSize));
fclose($fp);
$wpdb->query($wpdb->prepare("INSERT INTO ".$wpdb->prefix."abstracts_attachments (abstracts_id,filecontent,filename,filemeta,filetype,filesize) VALUES (%d,%s,%s,%s,%s,%s)",$abstract_id,$fileContent,$fileName,$fileType,'',$fileSize));
$uploads[] = array('id'=>$wpdb->insert_id,'filename'=>$fileName,'filesize'=>$fileSize);
} elseif($fileSize0,'filename'=>$fileName,'filesize'=>$fileSize,'error'=>'File not supported');
} else {
$uploads[] = array('id'=>0,'filename'=>$fileName,'filesize'=>$fileSize,'error'=>'File too big');
}
}
}
}
}
?>
Review Your Abstract
=$html?>
Attachments
Here you can download a pdf version of your submitted abstract and verify your attachments.
foreach($uploads as $attachment) { ?>
if($attachment['id']!=0) { ?>
} else { ?>
=$attachment['filename']?> [=$attachment['error']?>]
} ?>
} ?>
Click the above link to complete the abstract submission process.
} else { ?>
} ?>