2015-06-07, 12:46 PM
Pages: 1 2
2015-06-07, 03:38 PM
(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:40 PM
(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
2015-06-07, 03:46 PM
To be sure, you want the red row in the attached screenshot only to be shown to admins?
2015-06-07, 03:48 PM
Yeah thats correct, so others cant use it other then me or admins
2015-06-07, 03:54 PM
(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?
2015-06-07, 04:10 PM
Bilbo
2015-06-07, 06:18 PM
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 = "";
}
}
- Copy it and save it as PostIconsRemove.php.
- Copy the file to the inc/plugins directory/folder of your forum
- Open the plugin page in AdminCP (Home -> Plugins)
- Activate the plugin
2015-06-08, 02:06 PM
Why not use simple PHP <if> statements? not worth it to make a plugin for such small thing.
2015-06-08, 02:41 PM
(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