"; echo ""; echo "$l_callingerror"; echo ""; include_once('./includes/footer.inc'); exit; } if(bittst($proposereq,BIT_3) && !$input_heading) { $errors=1; $errmsg.=""; $errmsg.=""; $errmsg.="$l_noheading"; } if(!isset($entrytext) || !$entrytext) { $errors=1; $errmsg.=""; $errmsg.=""; $errmsg.="$l_notext"; } if($errors==0) { $sql="select * from ".$tableprefix."_tmpdata where postingid='".$postingid."'"; if(!$result = mysql_query($sql, $db)) die("Could not connect to the database.".mysql_error()); if($tmprow=mysql_fetch_array($result)) { $errors=1; $errmsg.=""; $errmsg.=""; $errmsg.="$l_noflooding"; } } if($errors==1) { include_once('./includes/head.inc'); ?> "; echo ""; echo "$l_back"; echo ""; include_once('./includes/footer.inc'); exit; } if(bittst($proposepermissions,BIT_4) || ($userdata["disablebbcode"]==1)) { unset($urlautoencode); unset($enablespcode); $disableemoticons=1; } $actdate = date("Y-m-d H:i:s"); $newstext = $entrytext; $newstext = do_htmlentities($newstext); $newstext = str_replace("\n", "
", $newstext); $newstext = str_replace("\r", "", $newstext); $newstext=addslashes($newstext); $tmpsql="select * from ".$tableprefix."_data where newsnr='$refnewsnr'"; if(!$result = mysql_query($tmpsql, $db)) die("Unable to connect to database.".mysql_error()); if(!$newsrow=mysql_fetch_array($result)) die("Unable to get data"); $posterip = get_userip(); $category=$newsrow["category"]; $language=$newsrow["lang"]; $sql = "insert into ".$tableprefix."_tmpdata (lang, date, text, heading, category, posterip, posterid, chgnews, postingid)"; $sql.= "values ('$language', '$actdate', '$newstext', '$input_heading', $category, '$posterip', ".$userdata["entrynr"].", $refnewsnr, '$postingid')"; if(!$result = mysql_query($sql, $db)) die("Unable to connect to database.".mysql_error()); $proposenr=mysql_insert_id($db); if($proposenotify==1) { if($category>0) { $tmpsql="select * from ".$tableprefix."_categories where catnr='$category'"; if(!$tmpresult = mysql_query($tmpsql, $db)) die("Could not connect to the database.".mysql_error()); if($tmprow=mysql_fetch_array($tmpresult)) { $catname=stripslashes($tmprow["catname"]); $tmpsql2="select * from ".$tableprefix."_catnames where catnr=".$tmprow["catnr"]." and lang='".$act_lang."'"; if(!$tmpresult2=mysql_query($tmpsql2,$db)) die("Unable to connect to database.".mysql_error()); if($tmprow2=mysql_fetch_array($tmpresult2)) { if(strlen($tmprow2["catname"])>0) $catname=stripslashes($tmprow2["catname"]); } } else $catname="???"; } else $catname=$l_general; if(($notifymode==0) || ($category==0)) $tmpsql="select u.* from ".$tableprefix."_notifylist nl, ".$tableprefix."_users u where u.usernr=nl.usernr"; else $tmpsql="select u.* from ".$tableprefix."_users u, ".$tableprefix."_cat_adm ca where u.usernr=ca.usernr and ca.catnr='$category'"; if(!$tmpresult = mysql_query($tmpsql, $db)) die("Could not connect to the database.".mysql_error()); while($tmprow=mysql_fetch_array($tmpresult)) { $linkurl=$simpnews_fullurl."admin/proposes.php?$langvar=".$tmprow["language"]."&mode=display&input_entrynr=$proposenr"; $tmpsql2="select * from ".$tableprefix."_texts where lang='".$tmprow["language"]."' and textid='notsubj'"; if(!$tmpresult2 = mysql_query($tmpsql2, $db)) die("Could not connect to the database.".mysql_error()); if(!$tmprow2=mysql_fetch_array($tmpresult2)) $subject=$l_notsubj; else $subject=undo_htmlspecialchars($tmprow2["text"]); $subject=str_replace("{sitename}",$simpnewssitename,$subject); $subject=str_replace("{ptype}","News",$subject); $subject=strip_tags($subject); $tmpsql2="select * from ".$tableprefix."_texts where lang='".$tmprow["language"]."' and textid='notmsg'"; if(!$tmpresult2 = mysql_query($tmpsql2, $db)) die("Could not connect to the database.".mysql_error()); if(!$tmprow2=mysql_fetch_array($tmpresult2)) $mailmsg=$l_notmsg; else $mailmsg=undo_htmlspecialchars($tmprow2["text"]); $mailmsg=str_replace("{sitename}",$simpnewssitename,$mailmsg); $mailmsg=str_replace("{ptype}","News",$mailmsg); $mailmsg=str_replace("{category}",$catname,$mailmsg); $mailmsg=str_replace("{linkurl}","$linkurl",$mailmsg); $mailmsg=str_replace("{postername}",$userdata["name"],$mailmsg); $mailmsg=str_replace("{postermail}",$userdata["email"],$mailmsg); $mailmsg_asc=str_replace("
","\r\n",$mailmsg); $mailmsg_asc=strip_tags($mailmsg_asc); $mail = new htmlMimeMail(); $mail->setCrlf($crlf); $mail->setTextWrap($mailmaxlinelength); $mail->setHTMLCharset($contentcharset); $mail->setTextCharset($contentcharset); $mail->setHTML($mailmsg,$mailmsg_asc); $mail->setSubject($subject); if($simpnewsmailname) $fromadr="\"$simpnewsmailname\" <$simpnewsmail>"; else $fromadr=$simpnewsmail; $mail->setFrom($fromadr); $receiver=array(); array_push($receiver,$tmprow["email"]); if(!$insafemode) @set_time_limit($msendlimit); if($use_smtpmail) { $mail->setSMTPParams($smtpserver,$smtpport,NULL,$smtpauth,$smtpuser,$smtppasswd); $sendresult=$mail->send($receiver, "smtp"); } else $sendresult=$mail->send($receiver, "mail"); do_emaillog($sendresult,$tmprow["email"],"new proposal (1c)"); } } include_once('./includes/head.inc'); ?> "; echo ""; echo "$l_entryupdated"; $linkurl="$act_script_url?$langvar=$act_lang&mode=edlst&layout=$layout"; if(isset($backurl)) $linkurl.="&backurl=".urlencode($backurl); echo ""; echo ""; echo ""; echo "$l_editownproposals"; } ?>