diff --git a/serendipity_event_commentsearch/ChangeLog b/serendipity_event_commentsearch/ChangeLog index a9f073f3..3d35159a 100644 --- a/serendipity_event_commentsearch/ChangeLog +++ b/serendipity_event_commentsearch/ChangeLog @@ -1,5 +1,23 @@ -Version 1.4: -* Not stripping comment html tags in code, so the template can decide, how to display comments -* Stripping tags before truncating comment in template, else tags will be truncated. +1.6: +---- + + * Set plugin consistencies + * Use load language API - extends required Serendipity version to v.1.6 + * Removed old Smarty2 security settings - extends required Serendipity version to v.1.7 + * Use native API method parseTemplate() + * Convert plugin template for Smarty3 usage + + +1.5: +---- + + * Fixed a remaining old htmlspecialchars usage + + +1.4: +---- + + * Not stripping comment html tags in code, so the template can decide, how to display comments + * Stripping tags before truncating comment in template, else tags will be truncated. latest: Smarty3 forward compatibility diff --git a/serendipity_event_commentsearch/UTF-8/lang_bg.inc.php b/serendipity_event_commentsearch/UTF-8/lang_bg.inc.php index 61a93823..682fb148 100644 --- a/serendipity_event_commentsearch/UTF-8/lang_bg.inc.php +++ b/serendipity_event_commentsearch/UTF-8/lang_bg.inc.php @@ -1,7 +1,7 @@ - * EN-Revision: 1.2 */ @@ -9,3 +9,4 @@ @define('COMMENTSEARCH_TITLE', 'Търси в коментарите при бързо търсене'); @define('COMMENTSEARCH_DESC', 'Ако тази приставка е инсталирана, бързото търсене ще се изпълнява и в коментарите'); @define('COMMENT_SEARCHRESULTS', 'Резултати от търсенето в коментарите'); + diff --git a/serendipity_event_commentsearch/UTF-8/lang_cs.inc.php b/serendipity_event_commentsearch/UTF-8/lang_cs.inc.php index 8a793544..c1928b40 100644 --- a/serendipity_event_commentsearch/UTF-8/lang_cs.inc.php +++ b/serendipity_event_commentsearch/UTF-8/lang_cs.inc.php @@ -7,4 +7,5 @@ @define('COMMENTSEARCH_TITLE', 'Hledání v komentářích'); @define('COMMENTSEARCH_DESC', 'Pokud je tento plugin nainstalovaný, rychlé vyhledávání bude prohledávat také komentáře'); -@define('COMMENT_SEARCHRESULTS', 'Výsledky hledání v komentářích'); \ No newline at end of file +@define('COMMENT_SEARCHRESULTS', 'Výsledky hledání v komentářích'); + diff --git a/serendipity_event_commentsearch/UTF-8/lang_cz.inc.php b/serendipity_event_commentsearch/UTF-8/lang_cz.inc.php index 8a793544..c1928b40 100644 --- a/serendipity_event_commentsearch/UTF-8/lang_cz.inc.php +++ b/serendipity_event_commentsearch/UTF-8/lang_cz.inc.php @@ -7,4 +7,5 @@ @define('COMMENTSEARCH_TITLE', 'Hledání v komentářích'); @define('COMMENTSEARCH_DESC', 'Pokud je tento plugin nainstalovaný, rychlé vyhledávání bude prohledávat také komentáře'); -@define('COMMENT_SEARCHRESULTS', 'Výsledky hledání v komentářích'); \ No newline at end of file +@define('COMMENT_SEARCHRESULTS', 'Výsledky hledání v komentářích'); + diff --git a/serendipity_event_commentsearch/UTF-8/lang_de.inc.php b/serendipity_event_commentsearch/UTF-8/lang_de.inc.php index e44ba1a2..440fd0bc 100644 --- a/serendipity_event_commentsearch/UTF-8/lang_de.inc.php +++ b/serendipity_event_commentsearch/UTF-8/lang_de.inc.php @@ -1,4 +1,4 @@ - - + + - Dokumentace: Hledn v komentch + Dokumentace: Hledn v komentch

Dokumentace k pluginu 'Hledn v komentch'
(serendipity_event_commentsearch)

-

Dokumentaci k tomuto pluginu peloil do etiny Vladimr Ajgl (vlada [zavinac] ajgl [tecka] cz) a naposledy zkontroloval dne 5.5.2013. Od t doby mohl bt plugin pozmnn nebo mohly bt rozen jeho funkce. Zkontrolujte pro jistotu i aktuln anglick ChangeLog. +

Dokumentaci k tomuto pluginu peloil do etiny Vladimr Ajgl (vlada [zavinac] ajgl [tecka] cz) a naposledy zkontroloval dne 5.5.2013. Od t doby mohl bt plugin pozmnn nebo mohly bt rozen jeho funkce. Zkontrolujte pro jistotu i aktuln anglick ChangeLog.

Popis pluginu

@@ -24,6 +24,6 @@ - + diff --git a/serendipity_event_commentsearch/documentation_cz.html b/serendipity_event_commentsearch/documentation_cz.html index 4320e170..42434bc1 100644 --- a/serendipity_event_commentsearch/documentation_cz.html +++ b/serendipity_event_commentsearch/documentation_cz.html @@ -1,12 +1,12 @@ - - + + - Dokumentace: Hledn v komentch + Dokumentace: Hledn v komentch

Dokumentace k pluginu 'Hledn v komentch'
(serendipity_event_commentsearch)

-

Dokumentaci k tomuto pluginu peloil do etiny Vladimr Ajgl (vlada [zavinac] ajgl [tecka] cz) a naposledy zkontroloval dne 5.5.2013. Od t doby mohl bt plugin pozmnn nebo mohly bt rozen jeho funkce. Zkontrolujte pro jistotu i aktuln anglick ChangeLog. +

Dokumentaci k tomuto pluginu peloil do etiny Vladimr Ajgl (vlada [zavinac] ajgl [tecka] cz) a naposledy zkontroloval dne 5.5.2013. Od t doby mohl bt plugin pozmnn nebo mohly bt rozen jeho funkce. Zkontrolujte pro jistotu i aktuln anglick ChangeLog.

Popis pluginu

@@ -24,6 +24,6 @@ - + diff --git a/serendipity_event_commentsearch/lang_bg.inc.php b/serendipity_event_commentsearch/lang_bg.inc.php index 3697e0fa..92b2c786 100644 --- a/serendipity_event_commentsearch/lang_bg.inc.php +++ b/serendipity_event_commentsearch/lang_bg.inc.php @@ -1,7 +1,7 @@ - * EN-Revision: 1.2 */ @@ -9,3 +9,4 @@ @define('COMMENTSEARCH_TITLE', ' '); @define('COMMENTSEARCH_DESC', ' , '); @define('COMMENT_SEARCHRESULTS', ' '); + diff --git a/serendipity_event_commentsearch/lang_cs.inc.php b/serendipity_event_commentsearch/lang_cs.inc.php index b8104b6c..bf8291ec 100644 --- a/serendipity_event_commentsearch/lang_cs.inc.php +++ b/serendipity_event_commentsearch/lang_cs.inc.php @@ -7,4 +7,5 @@ @define('COMMENTSEARCH_TITLE', 'Hledn v komentch'); @define('COMMENTSEARCH_DESC', 'Pokud je tento plugin nainstalovan, rychl vyhledvn bude prohledvat tak komente'); -@define('COMMENT_SEARCHRESULTS', 'Vsledky hledn v komentch'); \ No newline at end of file +@define('COMMENT_SEARCHRESULTS', 'Vsledky hledn v komentch'); + diff --git a/serendipity_event_commentsearch/lang_cz.inc.php b/serendipity_event_commentsearch/lang_cz.inc.php index b8104b6c..bf8291ec 100644 --- a/serendipity_event_commentsearch/lang_cz.inc.php +++ b/serendipity_event_commentsearch/lang_cz.inc.php @@ -7,4 +7,5 @@ @define('COMMENTSEARCH_TITLE', 'Hledn v komentch'); @define('COMMENTSEARCH_DESC', 'Pokud je tento plugin nainstalovan, rychl vyhledvn bude prohledvat tak komente'); -@define('COMMENT_SEARCHRESULTS', 'Vsledky hledn v komentch'); \ No newline at end of file +@define('COMMENT_SEARCHRESULTS', 'Vsledky hledn v komentch'); + diff --git a/serendipity_event_commentsearch/lang_de.inc.php b/serendipity_event_commentsearch/lang_de.inc.php index e44ba1a2..440fd0bc 100644 --- a/serendipity_event_commentsearch/lang_de.inc.php +++ b/serendipity_event_commentsearch/lang_de.inc.php @@ -1,4 +1,4 @@ - * EN-Revision: Revision of lang_en.inc.php */ @@ -9,3 +9,4 @@ @define('COMMENTSEARCH_TITLE', 'Searches comments on quicksearch'); @define('COMMENTSEARCH_DESC', 'If this plugin is installed, the quicksearch on your blog will also search through comments on your blog'); @define('COMMENT_SEARCHRESULTS', 'Search results for comments'); + diff --git a/serendipity_event_commentsearch/plugin_commentsearch_searchresults.tpl b/serendipity_event_commentsearch/plugin_commentsearch_searchresults.tpl index f7e7fd50..8866e570 100644 --- a/serendipity_event_commentsearch/plugin_commentsearch_searchresults.tpl +++ b/serendipity_event_commentsearch/plugin_commentsearch_searchresults.tpl @@ -2,15 +2,16 @@

{$CONST.COMMENT_SEARCHRESULTS|sprintf:$comment_searchresults}

+ diff --git a/serendipity_event_commentsearch/serendipity_event_commentsearch.php b/serendipity_event_commentsearch/serendipity_event_commentsearch.php index 3a42f21a..3c3ef1b9 100644 --- a/serendipity_event_commentsearch/serendipity_event_commentsearch.php +++ b/serendipity_event_commentsearch/serendipity_event_commentsearch.php @@ -1,21 +1,15 @@ -add('name', COMMENTSEARCH_TITLE); $propbag->add('description', COMMENTSEARCH_DESC); $propbag->add('event_hooks', array( - 'entries_footer' => true, - 'frontend_fetchentries' => true + 'entries_footer' => true, + 'frontend_fetchentries' => true )); $propbag->add('author', 'Garvin Hicking'); - $propbag->add('version', '1.5'); + $propbag->add('version', '1.6'); $propbag->add('requirements', array( - 'serendipity' => '0.8', - 'smarty' => '2.6.7', - 'php' => '4.1.0' + 'serendipity' => '1.7', + 'smarty' => '3.1.0', + 'php' => '5.1.0' )); $propbag->add('stackable', false); - $propbag->add('groups', array('FRONTEND_FEATURES')); + $propbag->add('groups', array('FRONTEND_FEATURES')); } - function setupDB() { + function setupDB() + { global $serendipity; $built = $this->get_config('db_built', null); @@ -49,7 +44,8 @@ class serendipity_event_commentsearch extends serendipity_event } } - function showSearch() { + function showSearch() + { global $serendipity; $this->setupDB(); @@ -59,12 +55,12 @@ class serendipity_event_commentsearch extends serendipity_event $group = ''; $distinct = 'DISTINCT'; $find_part = "(c.title ILIKE '%$term%' OR c.body ILIKE '%$term%')"; - } elseif ($serendipity['dbType'] == 'sqlite') { + } elseif (stristr($serendipity['dbType'], 'sqlite') !== FALSE) { $group = 'GROUP BY id'; $distinct = ''; $term = serendipity_mb('strtolower', $term); $find_part = "(lower(c.title) LIKE '%$term%' OR lower(c.body) LIKE '%$term%')"; - } else { + } else { // MYSQL $group = 'GROUP BY id'; $distinct = ''; $term = str_replace('"', '"', $term); @@ -95,11 +91,11 @@ class serendipity_event_commentsearch extends serendipity_event $myAddData = array("from" => "serendipity_plugin_commentsearch:generate_content"); foreach($results AS $idx => $result) { $results[$idx]['permalink'] = serendipity_archiveURL($result['id'], $result['title'], 'baseURL', true, $result); - $results[$idx]['comment'] = $result['body'];//(function_exists('serendipity_specialchars') ? serendipity_specialchars(strip_tags($result['body'])) : htmlspecialchars(strip_tags($result['body']), ENT_COMPAT, LANG_CHARSET)); + $results[$idx]['comment'] = $result['body']; // escape it in the template (function_exists('serendipity_specialchars') ? serendipity_specialchars(strip_tags($result['body'])) : htmlspecialchars(strip_tags($result['body']), ENT_COMPAT, LANG_CHARSET)); serendipity_plugin_api::hook_event('frontend_display', $results[$idx], $myAddData); // let the template decide, if we want to have tags or not $results[$idx]['commenthtml'] = $results[$idx]['comment']; - $results[$idx]['comment'] = strip_tags($results[$idx]['comment']); + $results[$idx]['comment'] = strip_tags($results[$idx]['comment']); } $serendipity['smarty']->assign( @@ -110,18 +106,12 @@ class serendipity_event_commentsearch extends serendipity_event ); $filename = 'plugin_commentsearch_searchresults.tpl'; - $tfile = serendipity_getTemplateFile($filename, 'serendipityPath'); - if (!$tfile) { - $tfile = dirname(__FILE__) . '/' . $filename; - } - $inclusion = $serendipity['smarty']->security_settings[INCLUDE_ANY]; - $serendipity['smarty']->security_settings[INCLUDE_ANY] = true; - $content = $serendipity['smarty']->fetch('file:'. $tfile); - $serendipity['smarty']->security_settings[INCLUDE_ANY] = $inclusion; + $content = $this->parseTemplate($filename); echo $content; } - function event_hook($event, &$bag, &$eventData, $addData = null) { + function event_hook($event, &$bag, &$eventData, $addData = null) + { global $serendipity; $hooks = &$bag->get('event_hooks'); @@ -147,5 +137,8 @@ class serendipity_event_commentsearch extends serendipity_event } return false; } + } + /* vim: set sts=4 ts=4 expandtab : */ +?> \ No newline at end of file