MyBB Community Forums

Full Version: Images in Hide Hack mod
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
[MOD] Hide Hack for 1.2.2

Is there any way to in place of the text ('Hidden Content') to replace with images (2 image > Locked and Unlocked) or something like this?

The problem is that cuz i don't know how to insert them... :\
Moved to code modifications
inc/functions_post.php

add after last }

function hidetags($message) 
{

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

// if user a guest, answered to Posting, or moderators are not the text indicated
if ( ($mybb->user[uid] != "0" && $selfposted > "0") || $mybb->usergroup['cancp'] == "yes") {
    $search="/\[hide](.*)\[\/hide\]/siU";
    $replace="<font color=red><b><i>Hidden Content:</i></b></font><br /> \\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 Content (Post Reply to See Text)</i></b></font>";
    $message = preg_replace($searcharray, $replacearray, $message);
    $message = str_replace("\'", "'", $message);
}

return $message;

}

For Hidden Part;
Replace This Part
    $replacearray[]="<font color=red><b><i>Hidden Content (Post Reply to See Text)</i></b></font>";
With Following
    $replacearray[]="<img src=hidden.gif border=0><br /><font color=red><b><i>Hidden Content (Post Reply to See Text)</i></b></font>";

Replace hidden.gif with your hidden content image.

For Unhidden Part;
Replace This Part
$replace="<font color=red><b><i>Hidden Content:</i></b></font><br /> \\1";
With Following
$replace="<img src=unhidden.gif border=0><br /><font color=red><b><i>Hidden Content:</i></b></font><br /> \\1";

Replace unhidden.gif with your hidden content image.
thank you so much for the help... Smile let's see it
It does not seem to work.
hmmm... yeah... it's not working :\
it's work here Toungue, Ok I just use the following code
DragonFever Wrote:For Hidden Part;
Replace This Part
    $replacearray[]="<font color=red><b><i>Hidden Content (Post Reply to See Text)</i></b></font>";
With Following
    $replacearray[]="<img src=hidden.gif border=0><br />;
Replace hidden.gif with your hidden content image.

For Unhidden Part;
Replace This Part
$replace="<font color=red><b><i>Hidden Content:</i></b></font><br /> \\1";
With Following
$replace="<img src=unhidden.gif border=0><br />\\1";
Replace unhidden.gif with your hidden content image.

thats what i have changed and it's work good.
but I only have a little Qs for Dragon. I want to add an "alt" word for the Hide botton how?
pepotiger Sorry, I don't understand what are you asking for...
pepotiger Wrote:it's work here Toungue, Ok I just use the following code
DragonFever Wrote:For Hidden Part;
Replace This Part
    $replacearray[]="<font color=red><b><i>Hidden Content (Post Reply to See Text)</i></b></font>";
With Following
    $replacearray[]="<img src=hidden.gif border=0><br />;
Replace hidden.gif with your hidden content image.

For Unhidden Part;
Replace This Part
$replace="<font color=red><b><i>Hidden Content:</i></b></font><br /> \\1";
With Following
$replace="<img src=unhidden.gif border=0><br />\\1";
Replace unhidden.gif with your hidden content image.

thats what i have changed and it's work good.
but I only have a little Qs for Dragon. I want to add an "alt" word for the Hide botton how?


oh thanx ... now it's working Big Grin
YVW westside159.


DragonFever Wrote:pepotiger Sorry, I don't understand what are you asking for...

I'll try to explain. whene you roll over the Hide botton in the editor. it's show that "PHP Code" the "alt" message see? how can I set defrent word for the hide botton?
I hope you get It and thnx for this great mode
Pages: 1 2