diff --git a/e107_plugins/linkwords/admin_config.php b/e107_plugins/linkwords/admin_config.php index 30b8dc6b3..8300fb10a 100644 --- a/e107_plugins/linkwords/admin_config.php +++ b/e107_plugins/linkwords/admin_config.php @@ -86,7 +86,7 @@ 'linkword_id' => array ( 'title' => LAN_ID, 'data' => 'int', 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), 'linkword_word' => array ( 'title' => LWLAN_21, 'type' => 'tags', 'data' => 'str', 'width' => 'auto', 'inline' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), 'linkword_link' => array ( 'title' => LWLAN_6, 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'inline' => true, 'help' => '', 'readParms' => '', 'writeParms' => 'size=xxlarge', 'class' => 'left', 'thclass' => 'left', ), - 'linkword_active' => array ( 'title' => LAN_ACTIVE, 'type' => 'dropdown', 'data' => 'int', 'width' => 'auto', 'batch' => true, 'filter' => true, 'inline' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'left' => 'center', 'thclass' => 'left', ), + 'linkword_active' => array ( 'title' => LAN_ACTIVE, 'type' => 'dropdown', 'data' => 'int', 'width' => 'auto', 'batch' => true, 'filter' => true, 'inline' => true, 'help' => '', 'readParms' => '', 'writeParms' => array(), 'left' => 'center', 'thclass' => 'left', ), 'linkword_tooltip' => array ( 'title' => LWLAN_50, 'type' => 'textarea', 'data' => 'str', 'width' => 'auto', 'inline' => true, 'help' => '', 'readParms' => '', 'writeParms' => array('size'=>'xxlarge'), 'class' => 'left', 'thclass' => 'left', ), 'linkword_limit' => array ( 'title' => "Max. links/tips", 'type' => 'number', 'data' => 'int', 'width' => '10%', 'help' => LWLAN_63, 'readParms' => '', 'writeParms' => array('default'=>3), 'class' => 'right', 'thclass' => 'right', ), @@ -132,7 +132,7 @@ // ------- Customize Create -------- - public function beforeCreate($new_data) + public function beforeCreate($new_data, $old_data) { return $new_data; } diff --git a/e107_plugins/linkwords/e_tohtml.php b/e107_plugins/linkwords/e_tohtml.php index 1700f54fa..23d83e355 100755 --- a/e107_plugins/linkwords/e_tohtml.php +++ b/e107_plugins/linkwords/e_tohtml.php @@ -139,7 +139,14 @@ class e_tohtml_linkwords $lwlist = explode(',',$lw); foreach ($lwlist as $lw) { - $this->word_list[] = trim($lw); + $lw = trim($lw); + + if(empty($lw)) + { + continue; + } + + $this->word_list[] = $lw; $this->word_class[] = 'lw-'.$frm->name2id($lw); $this->word_limit[] = vartrue($row['linkword_limit'],3); @@ -152,6 +159,14 @@ class e_tohtml_linkwords } else { + + $lw = trim($lw); + + if(empty($lw)) + { + continue; + } + $this->word_list[] = $lw; $this->word_class[] = 'lw-'.$frm->name2id($lw); $this->word_limit[] = vartrue($row['linkword_limit'],3); @@ -176,8 +191,6 @@ class e_tohtml_linkwords } } - - } @@ -245,9 +258,10 @@ class e_tohtml_linkwords // Consider next line - stripos is PHP5, and mb_stripos is PHP >= 5.2 - so may well often require handling // while (($first < $limit) && (stripos($text,$this->word_list[$first]) === FALSE)) { $first++; }; // *utf (stripos is PHP5 - compatibility handler implements) - $needle = $this->word_list[$first]; - while (($first < $limit) && (strpos($tp->ustrtolower($text), $needle) === false)) + + + while (($first < $limit) && (strpos($tp->ustrtolower($text),$this->word_list[$first]) === false)) { $first++; } // *utf