Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27464
Modified Files:
Tag: branch-smarty
NEWS serendipity_admin_comments.inc.php
serendipity_functions.inc.php
Log Message:
MFH
Index: NEWS
===================================================================
RCS file: /cvsroot/php-blog/serendipity/NEWS,v
retrieving revision 1.214.2.2
retrieving revision 1.214.2.3
diff -u -d -r1.214.2.2 -r1.214.2.3
--- NEWS 14 Sep 2004 10:30:07 -0000 1.214.2.2
+++ NEWS 14 Sep 2004 10:46:10 -0000 1.214.2.3
@@ -8,9 +8,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.419.2.12
retrieving revision 1.419.2.13
diff -u -d -r1.419.2.12 -r1.419.2.13
--- serendipity_functions.inc.php 14 Sep 2004 10:30:07 -0000 1.419.2.12
+++ serendipity_functions.inc.php 14 Sep 2004 10:46:10 -0000 1.419.2.13
@@ -870,12 +870,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
@@ -898,7 +901,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
@@ -1126,7 +1129,7 @@
$entry['rdf_ident'] = serendipity_archiveURL($entry['id'], $entry['title'], 'baseURL');
$entry['title'] = htmlspecialchars($entry['title']);
$entry['commURL'] = serendipity_archiveURL($entry['id'], $entry['title'], 'baseURL', false);
-
+
if (strlen($entry['extended'])) {
$entry['has_extended'] = true;
}
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.17.2.1
diff -u -d -r1.17 -r1.17.2.1
--- serendipity_admin_comments.inc.php 9 Sep 2004 11:17:27 -0000 1.17
+++ serendipity_admin_comments.inc.php 14 Sep 2004 10:46:10 -0000 1.17.2.1
@@ -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);
|