MyBB Community Forums

Full Version: [Mod] Hide Hack - WORK!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
judel Wrote:Thanks, Kodaks. At least that solved that problem.

Maybe I'm missing the obvious, but how do you use this mod? I've been through the admin CP and have looked at my forum itself. I don't see where this mod takes effect????
I believe you simply put the [HIDE][/HIDE] tags around some text in a thread, then users will have to reply to that thread in order to view the hidden text.

I think hide.gif should actually be a code button, not a regular blue button. Sorry about that! Toungue
here's the hide code button

You're welcome. Smile
yeah Wink
You've forgotten the newest bugfix for Hidehack:

here you are:

#### newreply.php ####

Search:
---
$quoted['subject'] = preg_replace("#RE:#i", "", stripslashes($quoted['subject']));
$subject = "RE: ".$quoted['subject'];
$quoted['message'] = preg_replace('#^/me (.*)$#im', "* $quoted[username] \\1", $quoted['message']);
---
add after:
---
$searcharray[]="/\[hide](.*)\[\/hide\]/siU";
$replacearray[]=" HIDDEN CONTENT ";
$quoted['message'] = preg_replace($searcharray, $replacearray, $quoted['message']);
---

mHackmanno1
Hey, Hackman! Do you know what needs to be added so that Admin can see the hidden text without posting??
yes.. that's what i'm looking for too
In inc/functions_post.php, replace the whole hidetags function. Find:
function hidetags($message) {
global $db, $n, $mybbuser, $selfposted;
// if user a guest, answered to Posting, or moderators are not the text indicated
if ( ($mybbuser[uid] != "0" && $selfposted[0]) || $mybbuser[cancp]) {
$search="/\[hide](.*)\[\/hide\]/siU";
$replace="<font color=red><b><i>Hidden Text:</i></b></font> $1";
$message = preg_replace($search, $replace, $message);
$message = str_replace("\'", "'", $message);
} else {
// sonst nix anzeigen
$searcharray[]="/\[hide](.*)\[\/hide\]/siU";
$replacearray[]="<font color=red><b><i>Hidden Text (post reply to see text)</i></b></font>";
$message = preg_replace($searcharray, $replacearray, $message);
$message = str_replace("\'", "'", $message);
}
return $message;
}

Replace with:
function hidetags($message) 
{

global $db, $n, $mybb, $selfposted;

// if user a guest, answered to Posting, or moderators are not the text indicated
if ( ($mybbuser[uid] != "0" && $selfposted[0]) || $mybb->usergroup['cancp'] == "yes") {
	$search="/\[hide](.*)\[\/hide\]/siU";
	$replace="<font color=red><b><i>Hidden Text:</i></b></font> \\1";
	$message = preg_replace($search, $replace, $message);
	$message = str_replace("\'", "'", $message);
} else {
	// sonst nix anzeigen
	$searcharray[]="/\[hide](.*)\[\/hide\]/siU";
	$replacearray[]="<font color=red><b><i>Hidden Text (post reply to see text)</i></b></font>";
	$message = preg_replace($searcharray, $replacearray, $message);
	$message = str_replace("\'", "'", $message);
}

return $message;

}


I havn't tested it so I'm not sure if it will work. 'cancp' gives permission to admins to view the hidden text without replying. You can replace 'cancp' with 'issupermod' to allow supermods to view the hidden text as well.
Doesn't work for me! Now for both the poster and admin, all I see is

Hidden Text:

in red. Can't even see the hidden text at all anymore!!!
Ok, give it another try ... Were you previously using the code posted in the first post of this topic?
Pages: 1 2 3