[textpattern commit] r2945 - in development/4.0: . textpattern/include textpattern/lib

0 views
Skip to first unread message

codesite...@google.com

unread,
Jul 20, 2008, 5:17:32 AM7/20/08
to txp...@googlegroups.com
Author: r.wetzlmayr
Date: Sun Jul 20 02:17:16 2008
New Revision: 2945

Modified:
development/4.0/HISTORY.txt
development/4.0/textpattern/include/txp_list.php
development/4.0/textpattern/lib/txplib_misc.php

Log:
Add article images and keywords to the the article list's search criteria.

Modified: development/4.0/HISTORY.txt
==============================================================================
--- development/4.0/HISTORY.txt (original)
+++ development/4.0/HISTORY.txt Sun Jul 20 02:17:16 2008
@@ -14,6 +14,7 @@
* User-selectable plugin run order
* Concurrent article edit warning
* WYSIWYG preview for draft articles
+* Added article images and keywords to the the article list's search criteria.
* More verbose "First Post" article with basic instructions and
helpful links.
* Developer: getTree() receives an optional 'table' name, returned
array contains 'parent' field.
* Developer: New event 'pretext_set'.

Modified: development/4.0/textpattern/include/txp_list.php
==============================================================================
--- development/4.0/textpattern/include/txp_list.php (original)
+++ development/4.0/textpattern/include/txp_list.php Sun Jul 20
02:17:16 2008
@@ -97,14 +97,15 @@
if ($search_method and $crit)
{
$crit_escaped = doSlash($crit);
-
$critsql = array(
'id' => "ID in ('" .join("','", do_list($crit_escaped)). "')",
'title_body' => "Title rlike '$crit_escaped' or Body rlike '$crit_escaped'",
'section' => "Section rlike '$crit_escaped'",
+ 'keywords' => "Keywords rlike '".regexp_list($crit_escaped)."'",
'categories' => "Category1 rlike '$crit_escaped' or Category2 rlike '$crit_escaped'",
'status' => "Status = '".(@$sesutats[gTxt($crit_escaped)])."'",
'author' => "AuthorID rlike '$crit_escaped'",
+ 'article_image' => "Image in ('" .join("','", do_list($crit_escaped)). "')",
'posted' => "Posted like '$crit_escaped%'",
'lastmod' => "LastMod like '$crit_escaped%'"
);
@@ -153,7 +154,7 @@
echo n.list_search_form($crit, $search_method);

$rs = safe_rows_start('*, unix_timestamp(Posted) as posted,
unix_timestamp(LastMod) as lastmod', 'textpattern',
- "$criteria order by $sort_sql limit $offset, $limit"
+ "$criteria order by $sort_sql limit $offset, $limit" ,1 #TODO
);

if ($rs)
@@ -329,8 +330,10 @@
'title_body' => gTxt('title_body'),
'section' => gTxt('section'),
'categories' => gTxt('categories'),
+ 'keywords' => gTxt('keywords'),
'status' => gTxt('status'),
'author' => gTxt('author'),
+ 'article_image' => gTxt('article_image'),
'posted' => gTxt('posted'),
'lastmod' => gTxt('article_modified')
);

Modified: development/4.0/textpattern/lib/txplib_misc.php
==============================================================================
--- development/4.0/textpattern/lib/txplib_misc.php (original)
+++ development/4.0/textpattern/lib/txplib_misc.php Sun Jul 20 02:17:16 2008
@@ -1900,6 +1900,13 @@
}

// -------------------------------------------------------------
+
+ function regexp_list($list, $delim = ',')
+ {
+ return join('|', do_list(str_replace('|', '\\\\|', $list), $delim));
+ }
+
+// -------------------------------------------------------------
function trace_add($msg)
{
global $production_status;

Reply all
Reply to author
Forward
0 new messages