diff --git a/admin/panels/config/admin.config.tpl b/admin/panels/config/admin.config.tpl index 03b27da..c5920fa 100755 --- a/admin/panels/config/admin.config.tpl +++ b/admin/panels/config/admin.config.tpl @@ -24,7 +24,7 @@

{$panelstrings.gensetts}

-
+
@@ -84,7 +84,7 @@

{$panelstrings.intsetts}

-
+
{$panelstrings.utctime}
{assign var=temp_time value="%b %d %Y %H:%M:%S"}
{"r"|date:$smarty.now}
diff --git a/fp-interface/themes/leggero/leggero/res/admin.css b/fp-interface/themes/leggero/leggero/res/admin.css index 567c09a..b17690c 100755 --- a/fp-interface/themes/leggero/leggero/res/admin.css +++ b/fp-interface/themes/leggero/leggero/res/admin.css @@ -237,7 +237,8 @@ input.maxsize, select.maxsize { width: 100% } } -#plugin-table-body td { +.admin-widgets-blockparser td , +.admin-plugin-default td { padding: 1em .6em; } @@ -468,7 +469,7 @@ li.widget-class { /* ===== CONFIG PANEL ===== */ -.option-set dl { +.option-set .option-list { margin-bottom: 4em; } diff --git a/fp-plugins/bbcode/plugin.bbcode.php b/fp-plugins/bbcode/plugin.bbcode.php index c52fe45..4b9dc76 100644 --- a/fp-plugins/bbcode/plugin.bbcode.php +++ b/fp-plugins/bbcode/plugin.bbcode.php @@ -277,7 +277,7 @@ function do_bbcode_img($action, $attributes, $content, $params, $node_object) { // Plugin hook, here lightbox attachs $popup = apply_filters('bbcode_img_popup', $popup, $absolutepath); $popup_start = $attributes['popup'] == 'true' - ? '' : ''; $popup_end = $attributes['popup'] == 'true' diff --git a/fp-plugins/bbcode/tpls/admin.plugin.bbcode.tpl b/fp-plugins/bbcode/tpls/admin.plugin.bbcode.tpl index a32a3ff..7eaab41 100644 --- a/fp-plugins/bbcode/tpls/admin.plugin.bbcode.tpl +++ b/fp-plugins/bbcode/tpls/admin.plugin.bbcode.tpl @@ -3,10 +3,10 @@ {include file=shared:errorlist.tpl} -{html_form class="config-panel"} +{html_form class=option-set}

{$plang.editing}

-
+
@@ -28,7 +28,7 @@

{$plang.other}

-
+
diff --git a/fp-plugins/qspam/lang/lang.en-us.php b/fp-plugins/qspam/lang/lang.en-us.php new file mode 100644 index 0000000..e545bdd --- /dev/null +++ b/fp-plugins/qspam/lang/lang.en-us.php @@ -0,0 +1,25 @@ + 'ERROR: The comment contained banned words' +); + +$lang['admin']['plugin']['submenu']['qspam'] = 'QuickSpamFilter'; +$lang['admin']['plugin']['qspam'] = array( + 'head' => 'QuickSpam Configuration', + 'desc1' => 'Do not allow comments containing these words (write one per line) :', + 'desc2' => 'Warning: A comment will be disallowed even when one word is part of another. + + (e.g. "old" matches "bold" too)', + 'options' => 'Other options', + 'desc3' => 'Bad Word Count', + 'desc3pre' => 'Block comments containing more than ', + 'desc3post' => ' bad word(s).', + 'submit' => 'Save configuration', + 'msgs' => array( + 1 => 'Bad words successful saved.', + -1 => 'Bad words not saved.' + ) +); + +?> diff --git a/fp-plugins/qspam/plugin.qspam.php b/fp-plugins/qspam/plugin.qspam.php index c228dcc..89a00ba 100755 --- a/fp-plugins/qspam/plugin.qspam.php +++ b/fp-plugins/qspam/plugin.qspam.php @@ -1,38 +1,121 @@ -assign('error', array('ERROR: The comment contained banned words')); - return false; - } - - return true; - - -} -?> += $qscfg['number']) { + global $smarty; + $lang = lang_load('plugin:qspam'); + $smarty->assign('error', array($lang['plugin']['qspam']['error'])); + return false; + } + return true; +} +add_action('comment_validate', 'plugin_qspam_validate', 5, 2); + +if (class_exists('AdminPanelAction')){ + /** + * Provides an admin panel entry for QuickSpam setup. + */ + class admin_plugin_qspam extends AdminPanelAction { + var $langres = 'plugin:qspam'; + + /** + * Initializes this panel. + */ + function setup() { + $this->smarty->assign('admin_resource', "plugin:qspam/admin.plugin.qspam"); + } + + /** + * Setups the default panel. + */ + function main() { + $qscfg = plugin_getoptions('qspam'); + $qscfg['wordlist'] = isset($qscfg['wordlist']) && is_array($qscfg['wordlist']) + ? implode("\n", $qscfg['wordlist']) + : ''; + $qscfg['number'] = isset($qscfg['number']) + ? $qscfg['number'] + : 1; + $this->smarty->assign('qscfg', $qscfg); + } + + /** + * Will be executed when the QSF configuration is send. + * + * @return int + */ + function onsubmit() { + if ($_POST['qs-wordlist']){ + $wordlist = isset($_POST['qs-wordlist']) + ? stripslashes($_POST['qs-wordlist']) + : ''; + $wordlist = str_replace("\r", "\n", $wordlist); + // DMKE: Works neither recursive correct nor in a loop... *grrr* + #$wordlist = str_replace("\n\n", "\n", $wordlist); + $wordlist = explode("\n", $wordlist); + $wordlist = array_filter($wordlist, array($this, '_array_filter')); + $number = isset($_POST['qs-number']) && is_numeric($_POST['qs-number']) + ? (int)$_POST['qs-number'] + : 1; + plugin_addoption('qspam', 'wordlist', $wordlist); + plugin_addoption('qspam', 'number', $number); + plugin_saveoptions('qspam'); + $this->smarty->assign('success', 1); + } else { + $this->smarty->assign('success', -1); + } + return 2; + } + + /** + * Array filter callback function. Culls empty array values. + * Life is hell ._. + * + * @param string $str + * @return boolean + */ + function _array_filter($str) { + return strlen(trim($str)) > 0; + } + } + admin_addpanelaction('plugin', 'qspam', true); +} + +?> \ No newline at end of file diff --git a/fp-plugins/qspam/tpls/admin.plugin.qspam.tpl b/fp-plugins/qspam/tpls/admin.plugin.qspam.tpl new file mode 100644 index 0000000..1f3ad72 --- /dev/null +++ b/fp-plugins/qspam/tpls/admin.plugin.qspam.tpl @@ -0,0 +1,29 @@ +

{$plang.head}

+ +{include file=shared:errorlist.tpl} + +{html_form class=option-set} + +
+

{$plang.desc1|wptexturize}

+

+ +

+

{$plang.desc2}

+
+ +

{$plang.options}

+
+
+
+ {$plang.desc3pre} + + {$plang.desc3post} +
+ +
+ +
+ +
+{/html_form}