Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27659
Modified Files:
NEWS serendipity_admin_comments.inc.php
serendipity_functions.inc.php
Log Message:
* Updated english language file with propositions by Jason Levitt
* fixed pgsql issues with comments and quicksearch by Mauri Sahlberg
Index: NEWS
===================================================================
RCS file: /cvsroot/php-blog/serendipity/NEWS,v
retrieving revision 1.215
retrieving revision 1.216
diff -u -d -r1.215 -r1.216
--- NEWS 10 Sep 2004 15:13:10 -0000 1.215
+++ NEWS 14 Sep 2004 10:47:26 -0000 1.216
@@ -3,9 +3,11 @@
Version 0.7 ()
------------------------------------------------------------------------
+ * Fixed postgreSQL quicksearch, thanks to Mauri Sahlberg!
+
* Added Norwegian translations, thanks to Jo Christian
- * Fixed postgresql bug for viewing comment moderation panel
+ * Fixed postgreSQL bugs for viewing comment moderation panel
(garvinhicking)
* Fixed postgresql bug for fetching the last entry id. Will fix bug
Index: serendipity_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v
retrieving revision 1.422
retrieving revision 1.423
diff -u -d -r1.422 -r1.423
--- serendipity_functions.inc.php 13 Sep 2004 20:40:39 -0000 1.422
+++ serendipity_functions.inc.php 14 Sep 2004 10:47:26 -0000 1.423
@@ -912,12 +912,15 @@
function serendipity_searchEntries($term) {
global $serendipity;
+ $term = serendipity_db_escape_string($term);
if (strtolower($serendipity['dbType']) == 'postgres') {
- $group = '';
- $distinct = 'DISTINCT';
+ $group = '';
+ $distinct = 'DISTINCT';
+ $find_part = "(title~'$term' OR body~'$term' OR extended~'$term')";
} else {
- $group = 'GROUP BY e.id';
- $distinct = '';
+ $group = 'GROUP BY e.id';
+ $distinct = '';
+ $find_part = "MATCH(title,body,extended) AGAINST('$term')";
}
$querystring = "SELECT $distinct
@@ -940,7 +943,7 @@
WHERE
a.authorid = e.authorid
AND e.id = ec.entryid
- AND MATCH (title,body,extended) AGAINST ('" . serendipity_db_escape_string($term) . "')
+ AND $find_part
AND isdraft = 'false'
AND timestamp <= " . time() . "
$group
@@ -2498,8 +2501,8 @@
$locations[$i] = 'http' . (!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off' ? 's' : '') . '://' . $_SERVER['HTTP_HOST'] . $locations[$i];
}
- $query = "SELECT COUNT(id) FROM {$serendipity['dbPrefix']}references
- WHERE entry_id = '". (int)$tmpid ."'
+ $query = "SELECT COUNT(id) FROM {$serendipity['dbPrefix']}references
+ WHERE entry_id = '". (int)$tmpid ."'
AND link = '" . serendipity_db_escape_string($locations[$i]) . "'";
$row = serendipity_db_query($query, true, 'num');
Index: serendipity_admin_comments.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_comments.inc.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- serendipity_admin_comments.inc.php 9 Sep 2004 11:17:27 -0000 1.17
+++ serendipity_admin_comments.inc.php 14 Sep 2004 10:47:26 -0000 1.18
@@ -115,7 +115,7 @@
/* Paging */
-$sql = serendipity_db_query("SELECT COUNT(*) AS total FROM {$serendipity['dbPrefix']}comments c WHERE c.type = 'normal' ". $and, true);
+$sql = serendipity_db_query("SELECT COUNT(*) AS total FROM {$serendipity['dbPrefix']}comments c WHERE c.type = 'NORMAL' ". $and, true);
$totalComments = $sql['total'];
$pages = ceil($totalComments/$commentsPerPage);
|