MyBB Community Forums

Full Version: Disable post icons for certains user groups.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I want to make it so only admins are able to use post icons is there a way I can do that? Or at least on I can use certain ones.
Thanks
(2015-06-07, 12:46 PM)bilbo Wrote: [ -> ]I want to make it so only admins are able to use post icons is there a way I can do that? Or at least on I can use certain ones.
Thanks

This will require a (small) plugin. Perhaps I can help?
(2015-06-07, 03:38 PM)Ad Bakker Wrote: [ -> ]
(2015-06-07, 12:46 PM)bilbo Wrote: [ -> ]I want to make it so only admins are able to use post icons is there a way I can do that? Or at least on I can use certain ones.
Thanks

This will require a (small) plugin. Perhaps I can help?

If you would be able to help that would be great
To be sure, you want the red row in the attached screenshot only to be shown to admins?
Yeah thats correct, so others cant use it other then me or admins
(2015-06-07, 03:48 PM)bilbo Wrote: [ -> ]Yeah thats correct, so others cant use it other then me or admins

OK, this will take some time because it is almost dinner time here in the Netherlands. But after that I will post the result here (say in 2 to 3 hours).

What is your user name at that forum?
Bilbo
OK, here is the plugin:


<?php
/************************************************************
* author       : Ad Bakker
* plugin       : PostIconsRemove
* last_mod     : 06.07.2015 (June 7th 2015)
* version      : 1.0
*************************************************************/
if(!defined('IN_MYBB'))
{
    die("This file cannot be accessed");
}

$plugins->add_hook("editpost_end", "PostIconsRemove_run");
$plugins->add_hook("newreply_end", "PostIconsRemove_run");
$plugins->add_hook("newthread_end", "PostIconsRemove_run");

function PostIconsRemove_info () {
    return array (
        "name"          => "PostIconsRemove",
        "description"   => "Remove post icons except for admins and user Bilbo",
        'website'       => '',
        'author'        => 'Ad Bakker', 
        'authorsite'    => '',
        'version'       => '1.0',
        'guid'          => '',
        'compatibility' => '18*',
    );
}

function PostIconsRemove_run ($message)
{
    global $mybb, $posticons;

    if ($mybb->user['usergroup'] != 4 && strpos(",".$mybb->user['additionalgroups'].",", ",4,") === false && $mybb->user['username'] != "Bilbo")
    {
        $posticons = "";
    }
}


  1. Copy it and save it as PostIconsRemove.php.
  2. Copy the file to the inc/plugins directory/folder of your forum
  3. Open the plugin page in AdminCP (Home -> Plugins)
  4. Activate the plugin
Then it should work. Success!!
Why not use simple PHP <if> statements? not worth it to make a plugin for such small thing.
(2015-06-08, 02:06 PM)Akay Wrote: [ -> ]Why not use simple PHP <if> statements? not worth it to make a plugin for such small thing.

The <if> statement needs PHP templates, heavier than this small plugin.
And keeping the templates as they are originaly is better.
Pages: 1 2