Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1:/tmp/cvs-serv3056
Modified Files:
serendipity_functions.inc.php
Log Message:
Don't send notification if user is an admin.
Will prevent mails getting sent when oneself submits a comment.
This needs to be removed once we go Multi-User?
Index: serendipity_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v
retrieving revision 1.121
retrieving revision 1.122
diff -u -d -r1.121 -r1.122
--- serendipity_functions.inc.php 9 Aug 2003 00:57:49 -0000 1.121
+++ serendipity_functions.inc.php 10 Aug 2003 16:56:25 -0000 1.122
@@ -776,7 +776,7 @@
AND e.authorid = a.authorid";
$row = serendipity_db_query($query, true);
- if($row['mail_comments']) {
+ if( $row['mail_comments'] ) {
serendipity_sendComment($row['email'], $name, $email, $url, $id, $row['title'], $comments, $type);
}
serendipity_purgeEntry($id, $t);
@@ -798,6 +798,10 @@
function serendipity_sendComment($to, $fromName, $fromEmail, $fromUrl, $id, $title, $comment, $type = 'NORMAL') {
global $serendipity;
+
+ if ( $_SESSION['serendipityAuthedUser'] && $type == 'NORMAL' ) {
+ return true;
+ }
$entryURI = serendipity_archiveURL($id, $title);
@@ -829,7 +833,7 @@
. "\n" . 'The best blog around, you can use it too.'
. "\n" . 'Check out <http://s9y.org> to find out how.';
- mail($to, $subject, $text.$signature, "From: $fromName <$fromEmail>\r\n");
+ return mail($to, $subject, $text.$signature, "From: $fromName <$fromEmail>\r\n");
}
function serendipity_fetchReferences($id)
@@ -1192,7 +1196,7 @@
if(!preg_match('@trackback:ping(\s*rdf:resource)?\s*=\s*"(http:[^"]+)"@i', $res, $matches)) {
return;
}
-
+
if (preg_match('@dc:identifier\s*=\s*"(http:[^"]+)"@i', $res, $test)) {
if ($loc != $test[1]) {
return;
@@ -1209,18 +1213,12 @@
}
function serendipity_reference_autodiscover($loc, $url, $author, $title, $text) {
- $fp = @fopen($loc, 'r');
- if(!$fp) {
- return;
- }
-
- while(!feof($fp)) {
- $res .= fgets($fp, 1024);
+ $res = @file_get_contents($loc);
+
+ if ( strlen($res) != 0 ) {
+ serendipity_trackback_autodiscover($res, $loc, $url, $author, $title, $text);
+ serendipity_pingback_autodiscover($loc, $res);
}
-
- fclose($fp);
- serendipity_trackback_autodiscover($res, $loc, $url, $author, $title, $text);
- serendipity_pingback_autodiscover($loc, $res);
}
/**
@@ -1343,6 +1341,7 @@
if (!preg_match_all('@<a[^>]+?href\s*=\s*["\']?([^\'" >]+?)[ \'"]?>([^<]*)</a>@i', $text, $matches)) {
return;
}
+
// remove full matches
array_shift($matches);
|