00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00037 if (is_object($this)) {
00038 if (is_array($this->newData["tt_board"]["NEW"])) {
00039
00040 $this->execNEWinsert("tt_board", $this->newData["tt_board"]["NEW"]);
00041 $newId = $GLOBALS['TYPO3_DB']->sql_insert_id();
00042 $this->clear_cacheCmd(intval($this->newData["tt_board"]["NEW"]["pid"]));
00043
00044 $conf = $this->getConf("tt_board");
00045
00046 if ($conf["clearCacheForPids"]) {
00047 $ccPids=t3lib_div::intExplode(",",$conf["clearCacheForPids"]);
00048 reset($ccPids);
00049 while(list(,$pid)=each($ccPids)) {
00050 if ($pid > 0) {$this->clear_cacheCmd($pid);}
00051 }
00052 }
00053
00054
00055
00056
00057 if ($conf["sendToMailingList"] && $conf["sendToMailingList."]["email"]) {
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069 $mConf = $conf["sendToMailingList."];
00070 $maillist_data = $this->newData["tt_board"]["NEW"];
00071 $maillist_recip = $mConf["email"];
00072
00073 $maillist_header='From: '.$mConf["namePrefix"].$maillist_data["author"].' <'.$mConf["reply"].'>'.chr(10);
00074 $maillist_header.='Reply-To: '.$mConf["reply"];
00075
00076
00077
00078 if ($maillist_data["parent"]) {
00079 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tt_board', 'uid='.intval($maillist_data['parent']));
00080 $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
00081 $maillist_subject = "Re: ".$row["subject"]." [#".$maillist_data["parent"]."]";
00082 } else {
00083 $maillist_subject = (trim($maillist_data["subject"]) ? trim($maillist_data["subject"]) : $mConf["altSubject"])." [#".$newId."]";
00084 }
00085
00086
00087 $maillist_msg = $maillist_data["subject"].chr(10).chr(10).$maillist_data["message"]."
00088 --
00089 ".$maillist_data["author"];
00090
00091
00092 if ($conf["debug"]) {
00093 debug($maillist_recip,1);
00094 debug($maillist_subject,1);
00095 echo nl2br($maillist_msg.chr(10));
00096 debug($maillist_header,1);
00097 } else {
00098 mail ($maillist_recip, $maillist_subject, $maillist_msg, $maillist_header);
00099 }
00100 }
00101
00102
00103
00104 if (t3lib_div::_GP("notify_me") && $conf["notify"]) {
00105 $notifyMe = t3lib_div::uniqueList(str_replace(",".$maillist_data["email"].",", ",", ",".t3lib_div::_GP("notify_me").","));
00106
00107 $markersArray=array();
00108 $markersArray["###AUTHOR###"] = trim($this->newData["tt_board"]["NEW"][author]);
00109 $markersArray["###AUTHOR_EMAIL###"] = trim($this->newData["tt_board"]["NEW"][email]);
00110 $markersArray["###HOST###"] = t3lib_div::getIndpEnv("HTTP_HOST");
00111 $markersArray["###URL###"] = t3lib_div::getIndpEnv("TYPO3_REQUEST_SCRIPT").'?id='.$GLOBALS["TSFE"]->id.'&type='.$GLOBALS["TSFE"]->type.'&no_cache=1&tt_board_uid='.$newId;
00112
00113 if ($maillist_data["parent"]) {
00114 $msg = t3lib_div::getUrl($GLOBALS["TSFE"]->tmpl->getFileName($conf["newReply."]["msg"]));
00115 $markersArray["###DID_WHAT###"]= $conf["newReply."]["didWhat"];
00116 $markersArray["###SUBJECT_PREFIX###"]=$conf["newReply."]["subjectPrefix"];
00117 } else {
00118 $msg = t3lib_div::getUrl($GLOBALS["TSFE"]->tmpl->getFileName($conf["newThread."]["msg"]));
00119 $markersArray["###DID_WHAT###"]= $conf["newThread."]["didWhat"];
00120 $markersArray["###SUBJECT_PREFIX###"]=$conf["newThread."]["subjectPrefix"];
00121 }
00122 $markersArray["###SUBJECT###"] = strtoupper($this->newData["tt_board"]["NEW"][subject]);
00123 $markersArray["###BODY###"] = t3lib_div::fixed_lgd($this->newData["tt_board"]["NEW"][message],1000);
00124
00125 reset($markersArray);
00126 while(list($marker,$markContent)=each($markersArray)) {
00127 $msg=str_replace($marker,$markContent,$msg);
00128 }
00129
00130 $headers=array();
00131 if ($conf["notify_from"]) {$headers[]="FROM: ".$conf["notify_from"];}
00132
00133 $msgParts = split(chr(10),$msg,2);
00134 if ($conf["debug"]) {
00135 debug($notifyMe,1);
00136 debug($headers,1);
00137 debug($msgParts);
00138 } else {
00139 mail ($notifyMe, $msgParts[0], $msgParts[1], implode($headers,chr(10)));
00140 }
00141 }
00142 }
00143 }
00144
00145 ?>