2014-01-10, 02:28 AM
2014-01-10, 03:15 AM
You can certainly do this with a hook. How would you define an inactive member though?
Lower post count than x? Post/day ratio lower than x?
If you are familiar with PHP and plug-in coding you can make use of the report_ hooks and check the user's information (such as post count).
Lower post count than x? Post/day ratio lower than x?
If you are familiar with PHP and plug-in coding you can make use of the report_ hooks and check the user's information (such as post count).
2014-01-10, 03:28 AM
(2014-01-10, 03:15 AM)SentoWeb Wrote: [ -> ]You can certainly do this with a hook. How would you define an inactive member though?
Lower post count than x? Post/day ratio lower than x?
If you are familiar with PHP and plug-in coding you can make use of the report_ hooks and check the user's information (such as post count).
They are simply a member of the "Awaiting Activation" group. It's a mybb default group and nothing special.
2014-01-10, 03:38 AM
My bad, I read inactive instead of "un-activated". (I ran out of coffee this morning...) I might be able to write a little plug-in for you later today so that you don't have to do core modifications.
2014-01-10, 04:17 AM
Ahh - no need for that, I'm surprised it's even possible- might be something to add into the next core
version
version
2014-01-10, 05:55 AM
You can perhaps use Template conditionals plugin to prevent/hide the report button from displaying on the postbit.
2014-01-10, 05:56 AM
(2014-01-10, 05:55 AM)itsmegogo Wrote: [ -> ]You can perhaps use Template conditionals plugin to prevent/hide the report button from displaying on the postbit.
Hiding a button doesn't prevent functionality.
Its simple.
Open report.php, goto line no. 21 and find:
if($mybb->usergroup['canview'] == 0 || !$mybb->user['uid'])
Change it to:
if($mybb->usergroup['canview'] == 0 || !$mybb->user['uid'] || $mybb->user['usergroup'] == 5)
Save the file. Done.
2014-01-10, 06:16 AM
Effone, please correct me if wrong. the report button uses javascript for its function. Is it possible to replicate the function in any other way?
2014-01-10, 07:23 AM
(2014-01-10, 06:16 AM)itsmegogo Wrote: [ -> ]Effone, please correct me if wrong. the report button uses javascript for its function. Is it possible to replicate the function in any other way?
http://community.mybb.com/report.php?pid=1056333
Try it.
Note: That uses js only for making a popup. Reporting is functional with full page view as well.
2014-01-10, 07:38 AM
I am not a fan of edits because I could hardly keep track of them.
Save it as ReportFix.php in inc/plugins. This will close the javascript popup and by no means will they be able to report it. You can play with the exit call and display an error message instead.
<?php
// Hooks
$plugins->add_hook('report_start', 'ReportFix_fix');
function ReportFix_info(){
return array(
"name" => "Prevent inactive users from reporting",
"description" => "That.",
"website" => "http://sentoweb.com",
"author" => "Ervin Czeczi",
"authorsite" => "http://sentoweb.com",
"guid" => "",
"version" => "1.0",
"compatibility" => "16*"
);
}
function ReportFix_fix($data) {
global $mybb;
if ($mybb->usergroup['gid'] == 5) {
exit('<script type="text/javascript">window.close();</script> You can\'t use this function until you activate your account.');
}
}
?>
Save it as ReportFix.php in inc/plugins. This will close the javascript popup and by no means will they be able to report it. You can play with the exit call and display an error message instead.