2014-09-21, 12:11 AM
Hello,
I took a stab at making my first plugin as a way to remove a specific user from the memberlist page in a way that would be persistent through upgrades. The plugin is very simple:
Since the next lines in memberlist.php "continue" if the username isn't set, this removes that member from the list.
The problem is that activating the plugin causes the entire forum, except for the ACP, to return the following error:
I tried commenting out everything in the plugin code other than the IN_MYBB check and the info function, but it still causes the error. Disabling gzip does fix the problem, but I can't for the life of me figure out how activating what is essentially a blank plugin causes gzip to suddenly not work (but the ACP is immune?!?!?).
If anyone has any ideas what could cause this (or has a more elegant solution to remove the member from the memberlist), please let me know. Thanks in advance!
Other possibly relevant info:
MyBB Version - 1.6.13
PHP Version - 5.3.22
SQL Engine - MySQLi 5.1.57
Webserver - IIS 7.5
I took a stab at making my first plugin as a way to remove a specific user from the memberlist page in a way that would be persistent through upgrades. The plugin is very simple:
<?php
if(!defined("IN_MYBB"))
{
die("You Cannot Access This File Directly.");
}
$plugins->add_hook('memberlist_user', 'remove');
function memberlistmod_info()
{
return array(
"name" => "Memberlist Mods",
"description" => "Custom modifications for the memberlist",
"website" => "",
"author" => "",
"authorsite" => "",
"version" => "1.0",
"guid" => "",
"compatibility" => "*"
);
}
function remove($current_user)
{
if ($current_user['uid'] == 3) {$current_user['username'] = '';}
return $current_user;
}
?>
Since the next lines in memberlist.php "continue" if the username isn't set, this removes that member from the list.
The problem is that activating the plugin causes the entire forum, except for the ACP, to return the following error:
Quote:Content Encoding Error
The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.
Please contact the website owners to inform them of this problem.
I tried commenting out everything in the plugin code other than the IN_MYBB check and the info function, but it still causes the error. Disabling gzip does fix the problem, but I can't for the life of me figure out how activating what is essentially a blank plugin causes gzip to suddenly not work (but the ACP is immune?!?!?).
If anyone has any ideas what could cause this (or has a more elegant solution to remove the member from the memberlist), please let me know. Thanks in advance!
Other possibly relevant info:
MyBB Version - 1.6.13
PHP Version - 5.3.22
SQL Engine - MySQLi 5.1.57
Webserver - IIS 7.5