MyBB Community Forums

Full Version: help with buttons
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey guys.

on my forum www.zionmax.com i have ip button and the warning button (that was a mod)

now the problem im having is the ip button and warning button (that is bizarre) are being shown to normal registered members. Now of course i only want them displayed to mods & admins.

also my online/offline buttons are not being shown to guests.

Now i probably with a lot of time could solve this myself but i wanted to ask you guys first as your all very knowledgeable Smile

to see what mod i made and how my button system is set up see this thread : http://community.mybboard.net/showthread...#pid162067

Thanks for any help Big Grin

Edit - footer copyrights fixed Big Grin
Z1on Wrote:now the problem im having is the ip button and warning button (that is bizarre) are being shown to normal registered members. Now of course i only want them displayed to mods & admins.

This code:
<a href="moderation.php?action=getip&pid={$post['pid']}"><img src="{$theme['imgdir']}/ip.gif" /></a> 
...shouldn't be in the postbit_report template. It always shows to normal users because it is in the wrong template.
Well i was aware of that one, but unless it goes there it appears next to the users name which looks awfull. I tried everything i could think of but could not get it to show in the correct place.....

Ideas welcome

Edit - im getting there Big Grin
alright, ive solved the issue with the ip button. it no longer displays to normal users.

But i put my warn button showing code into the same place (as you would assume it would only show to those who are allowed to see ips/warn) but no. Its still showing to normal users (the warn button)

Its baffling, how the hell can it?

Is this a bug with the warning mod? and has anyone any ideas on solving it?

Thanks

Edit : seems its a permission issue with the plugin, any group is allowed to view the warn button.
Edit 2 : fixed it, i just need to do a slight bit more work on it then il post up the fixed code for anyone thats interested Smile
Right ive fixed the problem. For anyone that only wants mods/admins to be able to view the warn button do this :

Open > plugins/fws.php

Find :

if($memprofile['uid'] != $mybb->user['uid'] && ($memprofile['usergroup'] != 4 || $mybb->user['usergroup'] == 4) && (($mybb->settings['fws_warn_warners'] == "yes" && fws_iswarner($memprofile['uid']) == TRUE) || fws_iswarner($memprofile['uid']) == FALSE || $mybb->user['usergroup'] == 4))
		{
			$page = preg_replace('#<!-- FWS_1_0 -->#', ' <span class="smalltext">(<a href="javascript:MyBB.popupWindow(\'fws.php?action=add&uid='.$memprofile['uid'].'\', \'fws\', 400, 300);" style="text-decoration:none;">Warn!</a>)</span><br />', $page);
		}
	}

Replace with :

if($memprofile['uid'] != $mybb->user['uid'] && ($memprofile['usergroup'] == 4 || $mybb->user['usergroup'] == 4) && (($mybb->settings['fws_warn_warners'] == "yes" && fws_iswarner($memprofile['uid']) == TRUE) || fws_iswarner($memprofile['uid']) == FALSE || $mybb->user['usergroup'] == 4))
		{
			$page = preg_replace('#<!-- FWS_1_0 -->#', ' <span class="smalltext">(<a href="javascript:MyBB.popupWindow(\'fws.php?action=add&uid='.$memprofile['uid'].'\', \'fws\', 400, 300);" style="text-decoration:none;">Warn!</a>)</span><br />', $page);
		}
		
		if($memprofile['uid'] != $mybb->user['uid'] && ($memprofile['usergroup'] == 3 || $mybb->user['usergroup'] == 3) && (($mybb->settings['fws_warn_warners'] == "yes" && fws_iswarner($memprofile['uid']) == TRUE) || fws_iswarner($memprofile['uid']) == FALSE || $mybb->user['usergroup'] == 3))
		{
			$page = preg_replace('#<!-- FWS_1_0 -->#', ' <span class="smalltext">(<a href="javascript:MyBB.popupWindow(\'fws.php?action=add&uid='.$memprofile['uid'].'\', \'fws\', 400, 300);" style="text-decoration:none;">Warn!</a>)</span><br />', $page);
		}
				
		}

Find :

if($post['uid'] != $mybb->user['uid'] && ($postuser['usergroup'] != 4 || $mybb->user['usergroup'] == 4) && (($mybb->settings['fws_warn_warners'] == "yes" && fws_iswarner($post['uid']) == TRUE) || fws_iswarner($post['uid']) == FALSE || $mybb->user['usergroup'] == 4))
		{
			$post['fws_warnlink'] = '<!-- Start: fws --><a href="javascript:MyBB.popupWindow(\'fws.php?action=add&uid='.$post['uid'].'&tid='.$post['tid'].'&pid='.$post['pid'].'\', \'fws\', 400, 300);" style="text-decoration:none;"><img src="'.$fws_images.'/postbit_fws.gif" border="0" alt="'.$lang->fws_postbit_warn.'" /></a><!-- End: fws -->';
		}

Replace with :

if($post['uid'] != $mybb->user['uid'] && ($postuser['usergroup'] == 4 || $mybb->user['usergroup'] == 4) && (($mybb->settings['fws_warn_warners'] == "yes" && fws_iswarner($post['uid']) == TRUE) || fws_iswarner($post['uid']) == FALSE || $mybb->user['usergroup'] == 4))
		{
			$post['fws_warnlink'] = '<!-- Start: fws --><a href="javascript:MyBB.popupWindow(\'fws.php?action=add&uid='.$post['uid'].'&tid='.$post['tid'].'&pid='.$post['pid'].'\', \'fws\', 400, 300);" style="text-decoration:none;"><img src="'.$fws_images.'/postbit_fws.gif" border="0" alt="'.$lang->fws_postbit_warn.'" /></a><!-- End: fws -->';
		}
		
		if($post['uid'] != $mybb->user['uid'] && ($postuser['usergroup'] == 3 || $mybb->user['usergroup'] == 3) && (($mybb->settings['fws_warn_warners'] == "yes" && fws_iswarner($post['uid']) == TRUE) || fws_iswarner($post['uid']) == FALSE || $mybb->user['usergroup'] == 3))
		{
			$post['fws_warnlink'] = '<!-- Start: fws --><a href="javascript:MyBB.popupWindow(\'fws.php?action=add&uid='.$post['uid'].'&tid='.$post['tid'].'&pid='.$post['pid'].'\', \'fws\', 400, 300);" style="text-decoration:none;"><img src="'.$fws_images.'/postbit_fws.gif" border="0" alt="'.$lang->fws_postbit_warn.'" /></a><!-- End: fws -->';
		}

That will only show the button and warn user text (in a users profile) to moderators and admins.

Enjoy Wink