MyBB Community Forums

Full Version: Mod/Admin Notes in Profile visible to USER
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hallo

I downloaded this mod

Mod/Admin Notes in Profile http://mods.mybboard.net/view/mod-user-notes

The support link in the mod refers me to a 1.2 plug in, but this mod is available in the 1.4 section.

Its very cool but unfortunately all users can see the text. Is there a fix for this?

thanks

Lee
Maybe something like this (if you know what to edit.)

<?php
$canViewNotes = array(3, 4); //I think these are the usergroup ID's of admins and supermods.
if($mybb->user['uid'] == $mybb->input['uid'] || in_array($mybb->user['usergroup'], $canViewNotes)) {
   echo "Helloz here are teh notes you leik dem?";
}
?>
ER....well, I opened the php file and as the only problem is in the view postbit (non admins/mods cannot see the mod notes input area in the profile) I isolated this piece of code as the area needing a fix

function modusernotes_postbit(&$post)
{
	global $mybb;
	static $xuid=1;
	if(!$post['modnotes'] || ($mybb->usergroup['cancp'] != 1 && $mybb->usergroup['issupermod'] != 1)) return;
	if(my_strlen($post['modnotes']) > POSTBIT_MODNOTES_MAXLEN) // exceeds max len?
	{
		$xnotes = htmlspecialchars_uni(str_replace("\n", '', nl2br(htmlspecialchars_uni(my_substr($post['modnotes'], POSTBIT_MODNOTES_MAXLEN-2)))));
		if($xnotes == '...')
			$notes = nl2br(htmlspecialchars_uni($post['modnotes']));
		else
		{
			$notes = nl2br(htmlspecialchars_uni(my_substr($post['modnotes'], 0, 28))).'<a href="javascript:if($(\'modnotex_'.$xuid.'\').innerHTML==\'...\')$(\'modnotex_'.$xuid.'\').innerHTML=\''.$xnotes.'\';else $(\'modnotex_'.$xuid.'\').innerHTML=\'...\';void(0);" title="Show full note" id="modnotex_'.$xuid.'">...</a>';
			++$xuid;
		}
	}
	else
		$notes = nl2br(htmlspecialchars_uni($post['modnotes']));
	$post['modnotes'] = '<br /><br /><strong>Admin Note:</strong> '.$notes;
}

?>

It seems as if the if function allowing the extra characters is what is opening the door; Only admin and supermod see the words "Admin note" - the other users (who are not supposed to see it) see the note without the special character, and see the whole note - admins and super mods see the cutoff like they are supposed to

I tried just copying the line

if(!$post['modnotes'] || ($mybb->usergroup['cancp'] != 1 && $mybb->usergroup['issupermod'] != 1)) return;
into the above code block at this point
{
			$notes = nl2br(htmlspecialchars_uni(my_substr($post['modnotes'], 0, 28)))

Did not work....
Same issue with my site. If it worked its a nice plugin as I need something where I can record details on users
:bump: anyone else maybe able to help me on this?
The link is down...
I see that it is indeed removed. Any idea why that is? has it been decided that the mod is not good, or is the original author fixing it, as this is the only link that is down (as far as I can tell)
You need to take out the trailing ")" in your link.
Does this occur on a clean installation of MyBB?
Its an upgrade from 1.4.9 (that was my first install). It has a fair few plug ins - should I post a list? Is there a possibility of a clash?

Oh, and I edited the post link Wink
(2010-01-07, 05:56 PM)leesester Wrote: [ -> ]Its an upgrade from 1.4.9 (that was my first install). It has a fair few plug ins - should I post a list? Is there a possibility of a clash?
Possibility is there, but you'll have to play around to see which plugin is causing the incompatibility.
Again, does this work on a clean forum install? If so, start by adding the plugins you use to see which one causes it to break.
Pages: 1 2