tablerender(NWSLAN_12, NWSLAN_11); require_once(FOOTERF); exit; } $author_name = $tp->toDB($_POST['author_name']); $author_email = $tp->toDB(check_email($_POST['author_email'])); if (isset($_POST['submit'])) { $user = (USER ? USERNAME : $author_name); $email = (USER ? USEREMAIL : $author_email); if ($user && $email) { $ip = $e107->getip(); $fp = new floodprotect; if ($fp->flood("submitnews", "submitnews_datestamp") == false) { header("location:" . e_BASE . "index.php"); exit; } $itemtitle = $tp->toDB($_POST['itemtitle']); $item = $tp->toDB($_POST['item']); $item = str_replace("src="e107_images", "src="" . SITEURL . "e107_images", $item); // Process File Upload ================================================= if ($_FILES['file_userfile'] && $pref['subnews_attach'] && $pref['upload_enabled'] && check_class($pref['upload_class']) && FILE_UPLOADS) { require_once(e_HANDLER . "upload_handler.php"); $uploaded = file_upload(e_IMAGE . "newspost_images/"); $file = $uploaded[0]['name']; $filetype = $uploaded[0]['type']; $filesize = $uploaded[0]['size']; $fileext = substr(strrchr($file, "."), 1); if (!$pref['upload_maxfilesize']) { $pref['upload_maxfilesize'] = ini_get('upload_max_filesize') * 1048576; } if ($uploaded && $fileext != "jpg" && $fileext != "gif" && $fileext != "png") { $message = SUBNEWSLAN_3; $error = true; } if ($filesize > $pref['upload_maxfilesize']) { $message = SUBNEWSLAN_4; $error = true; } if (!$error) { // $numberoffiles = count($uploaded); $today = getdate(); $newname = USERID . "_" . $today[0] . "_" . str_replace(" ", "_", substr($itemtitle, 0, 6)) . "." . $fileext; if ($file && $pref['subnews_resize']) { require_once(e_HANDLER . "resize_handler.php"); $rezwidth = $pref['subnews_resize']; if (!resize_image(e_IMAGE . "newspost_images/" . $file, e_IMAGE . "newspost_images/" . $newname, $rezwidth)) { rename(e_IMAGE . "newspost_images/" . $file, e_IMAGE . "newspost_images/" . $newname); } } elseif ($file) { rename(e_IMAGE . "newspost_images/" . $file, e_IMAGE . "newspost_images/" . $newname); } } } if ($error == false) { if (!file_exists(e_IMAGE . "newspost_images/" . $newname)) { $newname = ""; } $sql->db_Insert("submitnews", "0, '$user', '$email', '$itemtitle', '".intval($_POST['cat_id'])."','$item', '" . time() . "', '$ip', '0', '$newname' "); $edata_sn = array("user" => $user, "email" => $email, "itemtitle" => $itemtitle, "catid" => intval($_POST['cat_id']), "item" => $item, "ip" => $ip, "newname" => $newname); $e_event->trigger("subnews", $edata_sn); $ns->tablerender(LAN_133, "
" . LAN_134 . "
"); require_once(FOOTERF); exit; } else { require_once(e_HANDLER . "message_handler.php"); message_handler("P_ALERT", $message); } } } if (!defined("USER_WIDTH")){ define("USER_WIDTH","width:95%"); } $text = "
\n "; if (!USER) { $text .= "\n\n\n\n\n\n\n"; } if (!empty($pref['news_subheader'])) { $text .= " "; } $text .= " "; if ($pref['subnews_htmlarea']) { require_once(e_HANDLER . "tiny_mce/wysiwyg.php"); echo wysiwyg("item"); } else { require_once(e_HANDLER."ren_help.php"); } $insertjs = (!$pref['subnews_htmlarea']) ? "rows='15' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'" : "rows='25' "; $text .= " \n"; if ($pref['subnews_attach'] && $pref['upload_enabled'] && check_class($pref['upload_class']) && FILE_UPLOADS) { $text .= " \n"; } $text .= "
" . LAN_7 . "\n\n
" . LAN_112 . "\n\n
" . $tp->toHTML($pref['news_subheader'], TRUE,'TITLE') . "
" . NWSLAN_6 . ": "; if (!$sql->db_Select("news_category")) { $text .= NWSLAN_10; } else { $text .= " "; } $text .= "
" . LAN_62 . "
" . LAN_135 . "
"; if (!$pref['subnews_htmlarea']) { $text .= display_help("helpb","submitnews"); } $text .= "
" . SUBNEWSLAN_5 . "
" . SUBNEWSLAN_6 . "
"; $ns->tablerender(LAN_136, $text); require_once(FOOTERF); function headerjs() { $script = ""; return $script; } ?>