Update of /cvsroot/php-blog/serendipity/plugins/serendipity_event_bbcode
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20164/plugins/serendipity_event_bbcode
Modified Files:
serendipity_event_bbcode.php
Log Message:
* German translation fix
* Upgrader kills the current session for possible changes inside session
data on upgrade
* Fixed wrong comparison operator - bug reported by tom, where nl2br plugin
has "reversed" logic.
This is because (true != 'false') evaluates to true. Plugin config did not
evaluate radio values correctly.
* Fixed textile plugin not enabled by default after adding it as a plugin
* Comments plugin now correctly wordwraps
* Couple of linebreak fixes (*sigh*)
PLEASE TEST THE PLUGIN-STUFF! Needs to be verified working for rc2...
Index: serendipity_event_bbcode.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/plugins/serendipity_event_bbcode/serendipity_event_bbcode.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- serendipity_event_bbcode.php 3 Apr 2004 17:36:17 -0000 1.3
+++ serendipity_event_bbcode.php 13 Apr 2004 10:00:37 -0000 1.4
@@ -21,7 +21,7 @@
function introspect(&$propbag)
{
global $serendipity;
-
+
$propbag->add('name', PLUGIN_EVENT_BBCODE_NAME);
$propbag->add('description', PLUGIN_EVENT_BBCODE_DESC);
$propbag->add('event_hooks', array('frontend_display' => true, 'frontend_comment' => true));
@@ -114,7 +114,7 @@
$propbag->add('description', sprintf(APPLY_MARKUP_TO, $name));
return true;
}
-
+
function bbcode($input) {
/* Regular expressions taken from http://smarty.incutio.com/?page=BBCodePlugin Wiki (Andre Rabold) */
return preg_replace(array_keys($this->bbcodes), array_values($this->bbcodes), $input);
@@ -122,7 +122,7 @@
function event_hook($event, &$bag, &$eventData) {
global $serendipity;
-
+
$hooks = &$bag->get('event_hooks');
if (isset($hooks[$event])) {
@@ -130,16 +130,16 @@
case 'frontend_display':
foreach ($this->markup_elements as $temp) {
- if ($this->get_config($temp['name']) != 'false'&& isset($eventData[$temp['element']])) {
+ if (serendipity_db_bool($this->get_config($temp['name'], true)) && isset($eventData[$temp['element']])) {
$element = $temp['element'];
$eventData[$element] = $this->bbcode($eventData[$element]);
- }
+ }
}
return true;
break;
case 'frontend_comment':
- if ($this->get_config(COMMENT) != 'false') {
+ if (serendipity_db_bool($this->get_config(COMMENT, true))) {
echo PLUGIN_EVENT_BBCODE_TRANSFORM . '<br />';
}
return true;
|