Hello all i am try to make comment limit on plugin "chat" https://community.elgg.org/plugins/879242 by juho jakkalo ,using spam throttle plugin because if I want to stop spamming in chat plugin I need to set global limit setting I want make limit on that plugin without set global limit i want specific limit on chat message like wire,blog limit so I change code in setting php file but i don't get success whatever I changed is highlighted in bold fonts below in comment please have take look and give me suggestion that what actually i need to change :)
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
<?php
/*
* This is the form to set the plugin settings
*/
// preamble & explanation
echo elgg_echo('spam_throttle:explanation') . "<br>
";
echo elgg_echo('spam_throttle:consequence:explanation');
echo "
";
// globals
$title = elgg_echo('spam_throttle:settings:global');
$body = elgg_view('input/text', array(
'name' => 'params[global_limit]',
'value' => $vars['entity']->global_limit,
));
$body .= " " . elgg_echo('spam_throttle:helptext:limit', array(elgg_echo('spam_throttle:new_content'))) . "
";
$body .= elgg_view('input/text', array(
'name' => 'params[global_time]',
'value' => $vars['entity']->global_time,
));
$body .= " " . elgg_echo('spam_throttle:helptext:time') . '
';
// action to perform if threshold is broken
$body .= elgg_view('input/dropdown', array(
'name' => 'params[global_consequence]',
'value' => $vars['entity']->global_consequence ? $vars['entity']->global_consequence : 'suspend',
'options_values' => array(
'nothing' => elgg_echo('spam_throttle:nothing'),
'suspend' => elgg_echo('spam_throttle:suspend'),
'ban' => elgg_echo('spam_throttle:ban'),
'delete' => elgg_echo('spam_throttle:delete')
)
));
$body .= elgg_echo('spam_throttle:consequence:title', array(elgg_echo('spam_throttle:global')));
echo elgg_view_module('main', $title, $body);
// chat
$title = elgg_echo('spam_throttle:settings:chat');
$body = elgg_view('input/text', array(
'name' => 'params[chat_limit]',
'value' => $vars['subtypes']->chat_limit,
));
$body .= " " . elgg_echo('spam_throttle:helptext:limit', array(elgg_echo('spam_throttle:new_content'))) . "
";
$body .= elgg_view('input/text', array(
'name' => 'params[chat_time]',
'value' => $vars['subtypes']->chat_time,
));
$body .= " " . elgg_echo('spam_throttle:helptext:time') . '
';
// action to perform if threshold is broken
$body .= elgg_view('input/dropdown', array(
'name' => 'params[chat_consequence]',
'value' => $vars['subtypes']->chat_consequence ? $vars['subtypes']->chat_consequence : 'suspend',
'options_values' => array(
'nothing' => elgg_echo('spam_throttle:nothing'),
'suspend' => elgg_echo('spam_throttle:suspend'),
'ban' => elgg_echo('spam_throttle:ban'),
'delete' => elgg_echo('spam_throttle:delete')
)
));
$body .= elgg_echo('spam_throttle:consequence:title', array(elgg_echo('spam_throttle:global')));
echo elgg_view_module('main', $title, $body);
// loop through all of our object subtypes
$registered_types = get_registered_entity_types();
$registered_types['object'][] = 'messages';
foreach ($registered_types as $type => $subtypes) {
if ($subtypes) {
foreach ($subtypes as $subtype) {
$attr = $type . ':' . $subtype . '_limit';
$title = elgg_echo('spam_throttle:settings:subtype', array(elgg_echo("item:{$type}:{$subtype}")));
$body = elgg_view('input/text', array(
'name' => "params[{$attr}]",
'value' => $vars['entity']->$attr,
));
$body .= ' ' . elgg_echo('spam_throttle:helptext:limit', array(elgg_echo("item:{$type}:{$subtype}"))) . "
";
$attr = $type . ':' . $subtype . '_time';
$body .= elgg_view('input/text', array(
'name' => "params[{$attr}]",
'value' => $vars['entity']->$attr,
));
$body .= " " . elgg_echo('spam_throttle:helptext:time') . '
';
// action to perform if threshold is broken
$attr = $type . ':' . $subtype . '_consequence';
$body .= elgg_view('input/dropdown', array(
'name' => "params[{$attr}]",
'value' => $vars['entity']->$attr ? $vars['entity']->$attr : 'suspend',
'options_values' => array(
'nothing' => elgg_echo('spam_throttle:nothing'),
'suspend' => elgg_echo('spam_throttle:suspend'),
'ban' => elgg_echo('spam_throttle:ban'),
'delete' => elgg_echo('spam_throttle:delete')
)
));
$body .= elgg_echo('spam_throttle:consequence:title', array(elgg_echo("item:{$type}:{$subtype}")));
echo elgg_view_module('main', $title, $body);
}
}
else {
$attr = $type . '_limit';
$title = elgg_echo('spam_throttle:settings:subtype', array(ucfirst($type)));
$body = elgg_view('input/text', array(
'name' => "params[{$attr}]",
'value' => $vars['entity']->$attr,
));
$body .= ' ' . elgg_echo('spam_throttle:helptext:limit', array(ucfirst($type))) . "
";
$attr = $type . '_time';
$body .= elgg_view('input/text', array(
'name' => "params[{$attr}]",
'value' => $vars['entity']->$attr,
));
$body .= " " . elgg_echo('spam_throttle:helptext:time') . '
';
// action to perform if threshold is broken
$attr = $type . '_consequence';
$body .= elgg_view('input/dropdown', array(
'name' => "params[{$attr}]",
'value' => $vars['entity']->$attr ? $vars['entity']->$attr : 'suspend',
'options_values' => array(
'nothing' => elgg_echo('spam_throttle:nothing'),
'suspend' => elgg_echo('spam_throttle:suspend'),
'ban' => elgg_echo('spam_throttle:ban'),
'delete' => elgg_echo('spam_throttle:delete')
)
));
$body .= elgg_echo('spam_throttle:consequence:title', array(ucfirst($type)));
echo elgg_view_module('main', $title, $body);
}
}
// length of time of a suspension
echo "
" . elgg_echo('spam_throttle:suspensiontime') . "
";
echo elgg_view('input/text', array(
'name' => 'params[suspensiontime]',
'value' => isset($vars['entity']->suspensiontime) ? $vars['entity']->suspensiontime : 24,
));
echo " " . elgg_echo('spam_throttle:helptext:suspensiontime') . "
";
// period for reporting, once in x hours to pre
echo "
" . elgg_echo('spam_throttle:reporttime') . "
";
echo elgg_view('input/text', array(
'name' => 'params[reporttime]',
'value' => isset($vars['entity']->reporttime) ? $vars['entity']->reporttime : 24
));
echo " " . elgg_echo('spam_throttle:helptext:reporttime') . "
";
?>
$('input[type="text"]').css('width', '50px');
any expret?? i really need help
Why you don't want to ask an author of Spam throttle plugin about this issue?
i did but no reply yet :(
any one ??i really need it
Sorry, been extremely busy. I'm not familiar with that other plugin, spam throttle only affects registered entities (those can show up in search). I don't have a good answer for you without inspecting the other plugin and making it work and I just don't have time at the moment. Good luck.
ok i will try myself i hope i will get success :)
Do you really have any spam issues with the Chat plugin? If not, do you really think it is necessary to limit the number of chat messages to be allowed within a certain time? I wouldn't think the Chat plugin is a likely target of spammers. And the problem is that setting limits on the number of chat messages might affect valid usage, too. For example, it's quite unlikely that a user would make more than 1 or 2 valid blog postings per minute. So, it would seem okay to assume someone being a spammer if posting more blogs. But with chatting it's different. I wouldn't see 5 chat messages per minute an indication of spamming in all cases. So, I don't know if restricting usage of the Chat plugin by using the Spam Throttle plugin makes sense.
cuteboy 3 days ago
hahahaahahahah.
.
cuteboy
Edit
cuteboy 3 days ago
hahahaahahahah...
.
.
cuteboy
Edit
cuteboy 3 days ago
hahahaahahahah..
.
.
cuteboy
Edit
cuteboy 3 days ago
haahahahahahah..................................
cuteboy
Edit
cuteboy 3 days ago
haahahahahahah...................................
cuteboy
Edit
cuteboy 3 days ago
haahahahahahah.....................................
cuteboy
Edit
cuteboy 3 days ago
haahahahahahah......................................
cuteboy
Edit
cuteboy 3 days ago
haahahahahahah.......................................
cuteboy
Edit
cuteboy 3 days ago
haahahahahahah....................................
cuteboy
Edit
cuteboy 3 days ago
haahahahahahah.............................
cuteboy
Edit
cuteboy 3 days ago
haahahahahahah..............................
cuteboy
Edit
cuteboy 3 days ago
haahahahahahah...............................
cuteboy
Edit
cuteboy 3 days ago
haahahahahahah................................
cuteboy
Edit
cuteboy 3 days ago
haahahahahahah......................
cuteboy
Edit
cuteboy 3 days ago
haahahahahahah.......................
cuteboy
Edit
cuteboy 3 days ago
haahahahahahah.........................
cuteboy
Edit
cuteboy 3 days ago
haahahahahahah.............................
cuteboy
Edit
cuteboy 3 days ago
haahahahahahah..............................
cuteboy
Edit
cuteboy 3 days ago
haahahahahahah...............................
cuteboy
Edit
cuteboy 3 days ago
haahahahahahah................................
cuteboy
Edit
cuteboy 3 days ago
haahahahahahah....................................
cuteboy
Edit
cuteboy 3 days ago
haahahahahahah.......................................
cuteboy
Edit
cuteboy 3 days ago
haahahahahahah......................................
cuteboy
Edit
cuteboy 3 days ago
haahahahahahah.....................................
cuteboy
Edit
cuteboy 3 days ago
haahahahahahah...................................
cuteboy
Edit
cuteboy 3 days ago
haahahahahahah..................................
cuteboy
Edit
cuteboy 3 days ago
hahahaahahahah.
cuteboy
Edit
cuteboy 3 days ago
hahahaahahahah...
cuteboy
Edit
cuteboy 3 days ago
hahahaahahahah..
i wish i could add screen-shot. In above msg "hahahah" is nothing but sapm message now did you get me why i want message limit in chat plugin or neeed more explanation ?? @iionly??
- Previous
- 1
- 2
- Next
You must log in to post replies.