Changeset 1622
- Timestamp:
- 12/22/2006 11:15:11 AM (2 years ago)
- Location:
- trunk
- Files:
-
- 5 modified
-
admin/comments.php (modified) (1 diff)
-
log.php (modified) (7 diffs)
-
scripts/comments.php (modified) (1 diff)
-
scripts/general.func.php (modified) (1 diff)
-
scripts/jlogPlugins.class.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/comments.php
r1595 r1622 101 101 email = '".$data['email']."', 102 102 homepage = '".$data['homepage']."', 103 content = '".$data['content']."',104 mail_by_comment = '".$data['mail_by_comment']."'103 content = '".$data['content']."', 104 mail_by_comment = '".$data['mail_by_comment']."' 105 105 WHERE id = '".$data['id']."' LIMIT 1;"; 106 106 -
trunk/log.php
r1617 r1622 64 64 65 65 $com_form = strip($_POST); 66 if(!isset($com_form['type'])) $com_form['type'] = ""; 66 67 $error = com_check_errors($com_form); 67 68 … … 110 111 111 112 ### Plugin Hook 112 $com_form = $plugins->callHook('newComment', $com_form );113 $com_form = $plugins->callHook('newComment', $com_form, $blogentry); 113 114 114 115 $com = escape_for_mysql($com_form); … … 124 125 reference, 125 126 mail_by_comment, 126 date 127 date, 128 type 127 129 ) 128 130 VALUES ( … … 135 137 '".$blogentry['id']."', 136 138 '".$com['mail_by_comment']."', 137 NOW() 139 NOW(), 140 '".$com['type']."' 138 141 )"; 139 142 … … 170 173 else { 171 174 172 if(JLOG_INFO_BY_COMMENT === true) { 175 $mail['topic'] = $l['admin']['comments_mailsubject']." - ".$blogentry['topic']; 173 176 $mail['headers'] = "From: "; 174 177 if(!empty($com_form['name'])) $mail['headers'] .= str_replace(array("\n", "\r"), "", $com_form['name']); … … 176 179 if(!empty($com_form['email'])) $mail['headers'] .= " <".str_replace(array("\n", "\r"), "", $com_form['email']).">"; 177 180 $mail['headers'] .= "\r\nX-Mailer: PHP/".phpversion(); 178 179 181 180 182 $mail['text'] = $l['admin']['comments_mail_txt']." »".$blogentry['topic']."«\n- -\n"; … … 187 189 $mail['text'] .= "\n\n".$l['admin']['kill_c_email']."\n".JLOG_PATH."/admin/comments.php?action=trash&id=".$cid; 188 190 189 @mail(JLOG_EMAIL, $l['admin']['comments_mailsubject']." - ".$blogentry['topic'], $mail['text'], $mail['headers']); 191 ### Plugin Hook 192 $mail = $plugins->callHook('adminMail', $mail, $blogentry); 193 194 if(empty($mail['nomail']) and JLOG_INFO_BY_COMMENT) @mail(JLOG_EMAIL, $mail['topic'], $mail['text'], $mail['headers']); 190 195 } 191 196 197 $mail['topic'] = $l['comments_mailsubject']." - ".$blogentry['topic']; 192 198 $mail['headers'] = "From: ".JLOG_WEBSITE." <".JLOG_EMAIL.">\r\n" 193 199 ."X-Mailer: PHP/".phpversion(); 194 200 195 $mail[' text'] = $l['comments_mail_txt']." »".$blogentry['topic']."«\n- -\n";196 if(!empty($com_form['name'])) $mail[' text'] .= $com_form['name'];197 else $mail[' text'] .= $l['comments_anonym'];198 if(!empty($com_form['city'])) $mail[' text'] .= " ".$l['comments_from']." ".$com_form['city'];199 $mail[' text'] .= " ".$l['comments_posted']." ".$date.":\n\n";200 $mail[' text'] .= html_entity_decode(strip_tags($bbcomments->parse($com_form['content'])));201 $mail[' text'] .= "\n\n".str_replace ( '&', '&', blog($blogentry['date'], $blogentry['url']))."#c".$cid."";202 $mail[' text'] .= "\n-- \n".$l['comments_stop_receiving']."\n";203 $mail[' text'] .= JLOG_PATH."/stop.php?id=".$blogentry['id']."&email=";201 $mail['all_text'] = $l['comments_mail_txt']." »".$blogentry['topic']."«\n- -\n"; 202 if(!empty($com_form['name'])) $mail['all_text'] .= $com_form['name']; 203 else $mail['all_text'] .= $l['comments_anonym']; 204 if(!empty($com_form['city'])) $mail['all_text'] .= " ".$l['comments_from']." ".$com_form['city']; 205 $mail['all_text'] .= " ".$l['comments_posted']." ".$date.":\n\n"; 206 $mail['all_text'] .= html_entity_decode(strip_tags($bbcomments->parse($com_form['content']))); 207 $mail['all_text'] .= "\n\n".str_replace ( '&', '&', blog($blogentry['date'], $blogentry['url']))."#c".$cid.""; 208 $mail['all_text'] .= "\n-- \n".$l['comments_stop_receiving']."\n"; 209 $mail['all_text'] .= JLOG_PATH."/stop.php?id=".$blogentry['id']."&email="; 204 210 205 211 while ($data = $comment_mail->fetch()) { 206 if($data['email'] != $com['email']) { 207 @mail($data['email'], $l['comments_mailsubject']." - ".$blogentry['topic'], $mail['text'].$data['email'], $mail['headers']); 208 } 209 } 210 } 211 $c['form_content'] .= "<p id='entryform'>".$l['comments_thx']."</p>".com_javascript_variables(); 212 } 212 if($data['email'] != $com_form['email']) { 213 214 $mail['mail_to'] = $data['email']; 215 $mail['text'] = $mail['all_text'].$data['email']; 216 217 ### Plugin Hook 218 $mail = $plugins->callHook('commentorMail', $mail, $blogentry); 219 220 if(empty($mail['nomail'])) @mail($mail['mail_to'], $mail['topic'], $mail['text'], $mail['headers']); 221 } 222 } 223 } 224 $c['form_content'] .= "<p id='entryform'>".$l['comments_thx']."</p>".com_javascript_variables(); 213 225 } 214 226 } -
trunk/scripts/comments.php
r1575 r1622 129 129 130 130 ### Plugin Hook 131 $comment = $plugins->callHook('showComment', $comment, $data, $nr);131 $comment = $plugins->callHook('showComment', $comment, $data, $nr); 132 132 133 133 return $comment; -
trunk/scripts/general.func.php
r1595 r1622 207 207 $com = array(); 208 208 while($c = $comments->fetch()) $com[$c['reference']] = $c['count']; 209 210 ### Plugin Hook 211 global $plugins; 212 $com = $plugins->callHook('countComments', $com); 213 209 214 return $com; 210 215 } -
trunk/scripts/jlogPlugins.class.php
r1541 r1622 22 22 function hook_permalink ($t) { return $t; } // string permalink + string date + string url + string section 23 23 function hook_xmlrpcPermalink ($t) { return $t; } // string url 24 function hook_countComments ($t) { return $t; } // array with id and count 25 function hook_adminMail ($t) { return $t; } // array with mail + array blogentry 26 function hook_commentorMail ($t) { return $t; } // array with mail + array blogentry 24 27 25 /* Parameters functions */26 /*27 function saveConfigData($name, $t) {28 echo get_class($this);29 return false;30 }31 32 function loadConfigData($name, $t) {33 return false;34 }35 */36 28 } 37 29
