https://www.icyphoenix.com/viewtopic.php?f=28&t=71&p=10596#p10596 ----------------------------------- Zuker Fri 23 Mar, 2007 01:19 Re: [MOD] BBCode Hide message with an image ----------------------------------- Try this, it should work[hr] This is a simple method to have a bbcode Hide message with an image (with the message that says that you must post a reply to view the hidden message). The Image to explain the hide message: [url=http://img187.imageshack.us/img187/1583/hideimagejx1.jpg]Example of Image to show with the bbcode hide message (example) [color=darkgreen][b]Example Image of this hack[/b][/color]: [url=http://img187.imageshack.us/img187/4025/hidemessagewithtablehc6.jpg]Hide Text with Image In [b][color=blue]/includes/bbcode.php[/color][/b] [b]FIND[/b]: [code linenumbers=false] $html = '
' . $lang['xs_bbc_hide_message'] . ':
';[/code] [b]BEFORE ADD[/b] (or AFTER, if you want the image after the message explain): [code linenumbers=false]$html .= '';[/code] (here you can put
or any html code) With this changes, we have an image with the text of BBcode Hide explain. [hr]But, the BBcode Hide doesn't have a bbcode button on posting.php (on reply). With this changes, you can add this button. [color=darkgreen][b]Example Image of the button[/b][/color]: [url=http://img458.imageshack.us/img458/1566/hidebuttonly5.jpg]Image of the button pressed Follow this instructions: Upload to [b][color=blue]/images/bbcb_mg/images/gif[/color][/b] this images: [img]http://img106.imageshack.us/img106/4094/hide7aq.gif[/img] = (rename this to [i]hide.gif[/i]) [img]http://img106.imageshack.us/img106/6684/hide13lp.gif[/img] = (rename this to [i]hide1.gif[/i]) In [b][color=blue]/languages/lang_xxx/bbcb_mg.js[/color][/b] [b]FIND[/b]: [code linenumbers=false]s_smiley_creator =[/code] [b]AFTER, ADD[/b] [code linenumbers=false]s_hide_help = 'Hide a text, the registered users must post a reply to view the hidden message: Hidden Message: Sorry, but you must be registered and also post a reply to view this message. ';[/code] [b]FIND[/b]: [code linenumbers=false]var Td = 0;[/code] [b]AFTER ADD[/b]: [code linenumbers=false]var Hide = 0;[/code] [b]FIND[/b]: [code linenumbers=false]'[highlight=]'[/code] [b]AFTER ADD[/b] [code linenumbers=false]'Hidden Message: Sorry, but you must be registered and also post a reply to view this message. ',[/code] [b]FIND[/b]: [code linenumbers=false]function BBCbold()[/code] [b]BEFORE ADD[/b]: [code linenumbers=false]function BBChide() { var txtarea = document.post.message; if ((clientVer >= 4) && is_ie && is_win) { theSelection = document.selection.createRange().text; if (theSelection != '') { document.selection.createRange().text = "Hidden Message: Sorry, but you must be registered and also post a reply to view this message. "; document.post.message.focus(); return; } } else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0)) { //mozWrap(txtarea, "Hidden Message: Sorry, but you must be registered and also post a reply to view this message. "); mozInsert(txtarea, "Hidden Message: Sorry, but you must be registered and also post a reply to view this message. "); return; } if (Hide == 0) { ToAdd = "[hide]"; document.post.hide.src = bbcb_mg_img_path + "hide1.gif"; Hide = 1; } else { ToAdd = "[/hide]"; document.post.hide.src = bbcb_mg_img_path + "hide.gif"; Hide = 0; } PostWrite(ToAdd); }[/code] In [b][color=blue]/templates/mg_themes/bbcb_mg.tpl[/color][/b] [b]FIND[/b]: [code linenumbers=false] {L_BBCB_MG_HIGHLIGHT}[/code] [b]AFTER ADD[/b]: [code linenumbers=false] Hide a message[/code] (note: the text in [color=gray]alt=""[/color] and [color=gray]title=""[/color] must be with [color=gray]{language}[/color] Now, with this changes, we have a new button to use the bbcode hide in the posting page