https://www.icyphoenix.com/viewtopic.php?f=28&t=1533 ----------------------------------- Zuker Thu 05 Apr, 2007 16:45 BBCode Hide Message With An Image Buttom ----------------------------------- 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). This image will be shown to explain that there is a hidden message: [url=http://img129.imageshack.us/img129/6480/hideyesut3.gif]Example [b]Rename this image as hide_yes.gif and upload to: [color=blue]/images/bbcb_mg/images/[/color][/b] And this image will be shown when users are able to see the hidden message: [url=http://img129.imageshack.us/img129/7103/hidenokt2.gif]Example [b]Rename this image as hide_no.gif and upload to: [color=blue]/images/bbcb_mg/images/[/color][/b] [color=darkgreen][b]Example Images of this hack[/b][/color]: [url=http://img139.imageshack.us/img139/1923/exhiddenhx3.gif]When the message is hidden / [url=http://img129.imageshack.us/img129/5059/exnothiddenim8.gif]When the message is not hidden In [b][color=blue]/includes/bbcode.php[/color][/b] [b]FIND[/b]: [code linenumbers=false] // generate html $html = '
' . $lang['xs_bbc_hide_message'] . ':
'; if(!$show) { return array( 'valid' => true, 'html' => $html . $lang['xs_bbc_hide_message_explain'] . '
', 'allow_nested' => false, ); } else { return array( 'valid' => true, 'start' => $html, 'end' => '' ); }[/code] [b]REPLACE WITH[/b] [code linenumbers=false] // generate html $html = '
' . $lang['xs_bbc_hide_message'] . ':
'; if(!$show) { return array( 'valid' => true, 'html' => $html . '

' . $lang['xs_bbc_hide_message_explain'] . '
', 'allow_nested' => false, ); } else { return array( 'valid' => true, 'start' => $$html . '

', 'end' => '' ); }[/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/lang_bbcb_mg.php[/color][/b] [b]FIND[/b]: [code linenumbers=false]$lang['bbcb_mg_highlight'] = 'Highlight';[/code] [b]AFTER, ADD[/b] [code linenumbers=false]$lang['bbcb_mg_hide'] = 'Hide a message';[/code] [b]FIND[/b]: [code linenumbers=false]$lang['s_highlight_help'] = [/code] [b]AFTER, ADD[/b] [code linenumbers=false]$lang['s_hide_help'] = 'Hide a text, registered users must reply or thanks topic to view the hidden message: Hidden Message: Sorry, but you must be registered and also post a reply to view this message. ';[/code] In [b][color=blue]/includes/bbcb_mg.php[/color][/b] [b]FIND[/b]: [code linenumbers=false] 'L_BBCB_MG_HIGHLIGHT' => $lang['bbcb_mg_highlight'],[/code] [b]AFTER, ADD[/b] [code linenumbers=false] 'L_BBCB_MG_HIDE' => $lang['bbcb_mg_hide'],[/code] [b]FIND[/b]: [code linenumbers=false] 'L_HIGHLIGHT_HELP' => $lang['s_highlight_help'],[/code] [b]AFTER, ADD[/b] [code linenumbers=false] 'L_HIDE_HELP' => $lang['s_hide_help'],[/code] In [b][color=blue]/languages/lang_xxx/bbcb_mg.js[/color][/b] [b]FIND[/b]: [code linenumbers=false]s_smiley_creator = 'Smiley Creator: [smiley=1]Text[/smiley] insert a smiley with text';[/code] [b]AFTER, ADD[/b] [code linenumbers=false]s_hide_help = 'Hide a text, registered users must reply or thanks topic 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_img.src = bbcb_mg_img_path + "hide1" + bbcb_mg_img_ext; Hide = 1; } else { ToAdd = "[/hide]"; document.post.hide_img.src = bbcb_mg_img_path + "hide" + bbcb_mg_img_ext; 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] {L_BBCB_MG_HIDE}[/code] Now, with this changes, we have a new button to use the bbcode hide in the posting page ----------------------------------- KugeLSichA Sun 08 Apr, 2007 22:34 Re: BBCode Hide message with an image buttom ----------------------------------- thank you zuker for this :) ----------------------------------- diegomak Wed 11 Apr, 2007 00:24 Re: BBCode Hide Message With An Image Buttom ----------------------------------- Thanks this work perfect ----------------------------------- test Fri 22 Jun, 2007 18:13 Re: BBCode Hide Message With An Image Buttom ----------------------------------- hey thank you for that ..really helps worked!! but.. the combination between thanks button don't work if i press thanks the post is hidded is their a possibillity/solution for that?!?! ----------------------------------- Zuker Fri 22 Jun, 2007 20:38 Re: BBCode Hide message with an image buttom ----------------------------------- there it's no combination in ip for that at the moment ----------------------------------- chusrubi2 Mon 09 Jul, 2007 21:30 Re: BBCode Hide Message With An Image Buttom ----------------------------------- Puting this on bbcode.php[quote]FIND: Code: [Download] [Hide] [Select] Code: [Download] [Show] // generate html $html = '
' . $lang['xs_bbc_hide_message'] . ':
'; if(!$show) { return array( 'valid' => true, 'html' => $html . $lang['xs_bbc_hide_message_explain'] . '
', 'allow_nested' => false, ); } else { return array( 'valid' => true, 'start' => $html, 'end' => '' ); } REPLACE WITH Code: [Download] [Hide] [Select] Code: [Download] [Show] // generate html $html = '
' . $lang['xs_bbc_hide_message'] . ':
'; if(!$show) { return array( 'valid' => true, 'html' => $html . '

' . $lang['xs_bbc_hide_message_explain'] . '
', 'allow_nested' => false, ); } else { return array( 'valid' => true, 'start' => $html . '

', 'end' => '' ); } [/quote] I have this error:[code linenumbers=false]Parse error: syntax error, unexpected T_VARIABLE, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/www/downloading.mygamesonline.org/includes/bbcode.php on line 3550[/code] :( what can i do? Zuker if you are spanish answer me in spanish plz. ----------------------------------- Zuker Mon 09 Jul, 2007 22:47 Re: BBCode Hide message with an image buttom ----------------------------------- u are making some edit wrogn attach me your file so i can check it ----------------------------------- chusrubi2 Thu 26 Jul, 2007 16:22 Re: BBCode Hide Message With An Image Buttom ----------------------------------- I have added the file adjunt in .rar. Modify it plz ----------------------------------- Zuker Thu 26 Jul, 2007 22:34 Re: BBCode Hide message with an image buttom ----------------------------------- But you are gaving me the clean file Try to do it and if u can't, attach the modded file ;) ----------------------------------- leonidfg Fri 17 Aug, 2007 06:19 Re: BBCode Hide Message With An Image Buttom ----------------------------------- Thanks Zuker!!! I did it. Thanks men. ----------------------------------- Sergini Sun 19 Aug, 2007 21:50 Re: BBCode Hide Message With An Image Buttom ----------------------------------- I have a problem. I had one modification. When I push the button not view the message Original (Quoted Hidden Message, which is still hidden.). There aren't message :lol: But, if I write a word, I select the word with the mouse and I push the eye,...: Hidden Message: Sorry, but you must be registered and also post a reply to view this message. wordundefined Im spanish, sorry my bad english ^^ IN SPANISH... Yo tengo un problema. He hecho una modificación. Cuando yo hago click en el botón no veo el mensaje original (....). No me sale nada, en blanco [Así quería yo ^^].... hasta aquí todo bien. Pero, si yo escribo una palabara, Yo la selecciono con el ratón y pulso en el botón del ojo, me sale... Hidden Message: Sorry, but you must be registered and also post a reply to view this message. palabraundefined Nosé si me explico. Si primero pongo hide y luego escribo bien :oops: ----------------------------------- leonidfg Fri 24 Aug, 2007 09:01 Re: BBCode Hide Message With An Image Buttom ----------------------------------- Hi again... in all this HIDE button stuff I have another question. There's a way to the hide messages may be visible only to the registered users without the need of posting a message? An example may be the Thanks button that allow to see the hide messages. But I didn't find a post with this Thanks button MOD. Anyone here know how to do it. Bye...! ----------------------------------- Mighty Gorgon Fri 24 Aug, 2007 11:14 Re: BBCode Hide message with an image buttom ----------------------------------- I think it has already been posted somewhere here... try to search... ----------------------------------- Zuker Fri 24 Aug, 2007 15:09 Re: BBCode Hide message with an image buttom ----------------------------------- [quote user="leonidfg" post="18865"]Hi again... in all this HIDE button stuff I have another question. There's a way to the hide messages may be visible only to the registered users without the need of posting a message? An example may be the Thanks button that allow to see the hide messages. But I didn't find a post with this Thanks button MOD. Anyone here know how to do it. Bye...![/quote] on bbcode.php & viewtopic.php replace [quote] if($userdata['session_logged_in']) { $sql = "SELECT p.poster_id, p.topic_id FROM " . POSTS_TABLE . " p WHERE p.topic_id = $topic_id AND p.poster_id = " . $userdata['user_id']; $resultat = $db->sql_query($sql); $show = $db->sql_numrows($resultat) ? true : false; if ( ($userdata['user_level'] == ADMIN) || ($userdata['user_level'] == MOD)) { $show = true; } }[/quote] with [code linenumbers=false] if ( ($userdata['session_logged_in'] ) { $show = true; }[/code] test it :v: ----------------------------------- robin cracker Sun 26 Aug, 2007 08:29 Re: BBCode Hide Message With An Image Buttom ----------------------------------- hello can configure to allow groups that not post to view the content ? ----------------------------------- Zuker Sun 26 Aug, 2007 18:45 Re: BBCode Hide message with an image buttom ----------------------------------- you have to do it manually and play with groups id ----------------------------------- robin cracker Mon 27 Aug, 2007 09:18 Re: BBCode Hide Message With An Image Buttom ----------------------------------- excuseme in what file edit the groups permision to hide mod? my php and mysql knowledge is very bad :oops: ----------------------------------- Zuker Mon 27 Aug, 2007 15:19 Re: BBCode Hide message with an image buttom ----------------------------------- [quote user="robin cracker" post="18986"]excuseme in what file edit the groups permision to hide mod? my php and mysql knowledge is very bad :oops:[/quote] when i arrive home i'll try to play quickly with it. ----------------------------------- Zuker Mon 27 Aug, 2007 17:36 Re: BBCode Hide message with an image buttom ----------------------------------- mmm, i don't think if it's ok. i have no idea of how to make it :P try in bbcode.php and viewtopic.php replace [code linenumbers=false] if($userdata['session_logged_in']) { $sql = "SELECT * FROM " . THANKS_TABLE . " WHERE topic_id = $topic_id AND user_id = " . $userdata['user_id']; $resultat = $db->sql_query($sql); $show = $db->sql_numrows($resultat) ? true : false; if ( ($userdata['user_level'] == ADMIN) || ($userdata['user_level'] == MOD)) { $show = true; } }[/code] with [code linenumbers=false] if($userdata['session_logged_in']) { $sql = "SELECT user_id FROM " . USER_GROUP_TABLE . " WHERE group_id = x"; $result = $db->sql_query($sql); if ( $userdata['user_id'] == $result ) { $show = true; } if ( ($userdata['user_level'] == ADMIN) || ($userdata['user_level'] == MOD)) { $show = true; } }[/code] IMPORTANT: Replace in WHERE group_id = x"; the x, with the id of the group you want to see the hidden code. ----------------------------------- robin cracker Mon 27 Aug, 2007 19:17 Re: BBCode Hide Message With An Image Buttom ----------------------------------- thanks try this code in localhost to test, and later comment , thanks for your help zuker :D ----------------------------------- Zuker Mon 27 Aug, 2007 19:21 Re: BBCode Hide message with an image buttom ----------------------------------- [quote user="robin cracker" post="18997"]thanks try this code in localhost to test, and later comment , thanks for your help zuker :D[/quote] i hope this to work or help you in "how to code it" i won't go further in this customization you ask for :( ----------------------------------- Mighty Gorgon Mon 27 Aug, 2007 20:41 Re: BBCode Hide message with an image buttom ----------------------------------- Playing with usergroups it's not so easy. [b]robin cracker[/b], you should try to study a bit phpBB groups system and then try to add the check you wish. Unfortunately such kind of modifications requires times and skills. I would create PRIVATE forums instead of creating such a strange BBCode structure. Zuker did already a lot trying to help you, but as he said, we try to help users where we can and as we can, but where requests require too much times, we can't always sacrifice our free time for that :sad: . Trust me we are trying to do our best to help anyone. A clap to Zuker for putting so many efforts in helping users like you in their customizations! :wink: ----------------------------------- Zuker Mon 27 Aug, 2007 22:17 Re: BBCode Hide message with an image buttom ----------------------------------- :mricy: i told you that i would not work :P ----------------------------------- robin cracker Tue 28 Aug, 2007 07:59 Re: BBCode Hide Message With An Image Buttom ----------------------------------- ok thanks for the help,im new in phpbb and php but i wish to learn where i ready the docs of code in icy? ----------------------------------- aswin12 Thu 06 Sep, 2007 00:59 Re: BBCode Hide Message With An Image Buttom ----------------------------------- I get this error please help!!!! :( :( :( [code linenumbers=false]Parse error: syntax error, unexpected T_STRING in ******/htdocs/includes/bbcode.php on line 2598[/code] ----------------------------------- Zuker Thu 06 Sep, 2007 12:46 Re: BBCode Hide message with an image buttom ----------------------------------- You are missing someting i think. Attach your modded file here please. ----------------------------------- aswin12 Thu 06 Sep, 2007 21:46 Re: BBCode Hide Message With An Image Buttom ----------------------------------- ok here you go.... [code linenumbers=false]http://rapidshare.com/files/53866891/bbcode.php.html[/code] ----------------------------------- Zuker Fri 07 Sep, 2007 04:20 Re: BBCode Hide message with an image buttom ----------------------------------- attach it here please ----------------------------------- aswin12 Sat 08 Sep, 2007 00:10 Re: BBCode Hide Message With An Image Buttom ----------------------------------- ok.. :v: ----------------------------------- Zuker Sat 08 Sep, 2007 13:23 Re: BBCode Hide message with an image buttom ----------------------------------- Try this file, i'm not at home so i can't test it, but maybe works :) ----------------------------------- aswin12 Sun 09 Sep, 2007 19:43 Re: BBCode Hide Message With An Image Buttom ----------------------------------- yay! :loveit: it works thanx..... :mricy: :mrgreen: :mrblue: :mrorange: :mrviolet: ----------------------------------- Zuker Sun 09 Sep, 2007 20:05 Re: BBCode Hide message with an image buttom ----------------------------------- :mricy: great ----------------------------------- MiNdPhAsEr Sat 22 Sep, 2007 10:38 Re: BBCode Hide Message With An Image Buttom ----------------------------------- [quote user="Zuker" post="11381"] 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, registered users must 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)) { mozInsert(txtarea, "Hidden Message: Sorry, but you must be registered and also post a reply to view this message. "); return; } ToAdd = "Hidden Message: Sorry, but you must be registered and also post a reply to view this message. "; 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[/quote] well i trie this but nothings work when i post a message ill don't see the button for hide or /hide and when i look from a other location at the post i see the image that ill look to a hidden message but unther the gif ill see the message that should be hidden some body know's the solution ? ( sorry for my english i'm dutch ) ----------------------------------- Zuker Tue 02 Oct, 2007 20:16 Re: BBCode Hide message with an image buttom ----------------------------------- review your changes, this worked for lot's of guys ----------------------------------- Mairena Wed 24 Oct, 2007 23:22 Re: BBCode Hide Message With An Image Buttom ----------------------------------- Zuker, thanks for this excelent mod... is very important in my forum... I want to ask you for a modification: when a user quote the original post, he can see the hide message.. it´s possible to change that? I want to everyone Write something before see the message.. what do you think? ----------------------------------- Zuker Thu 06 Mar, 2008 13:16 Re: BBCode Hide Message With An Image Buttom ----------------------------------- Topic updated to make it work with 1.2 please test it :) ----------------------------------- Master09 Sun 09 Mar, 2008 03:40 Re: BBCode Hide Message With An Image Buttom ----------------------------------- zuker can u help me with Hide Message when i do it im my forum i go alot of problems can i Attach my bbcode and u add the imagen to the hide message plz couse :cry: i never ge it good ? [img]http://www.icyphoenix.com/files/images/3297/ocultar.gif[/img] and this imagen when the user post a repley [img]http://www.icyphoenix.com/files/images/3297/ocultar_1205071898_756020.gif[/img] ----------------------------------- edfara Sat 19 Apr, 2008 18:42 Re: BBCode Hide Message With An Image Buttom ----------------------------------- [b]Zuker, una consulta funciona en la version Icy Phoenix 1.2.0.27a[/b] [b][u]Zuker, a consultation works in version Icy Phoenix 1.2.0.27a[/u][/b] ----------------------------------- ALTUN Fri 13 Jun, 2008 22:43 Re: BBCode Hide Message With An Image Buttom ----------------------------------- Thanks for superfine "BBCode Hide Message With An Image Buttom" Mod to Zuker. [smiley smilie=6 fontcolor=000000 shadowcolor=000000 shieldshadow=1]Thanks Zuker[/smiley] [img]http://www.icyphoenix.com/images/smiles/0056.gif[/img] ----------------------------------- Fade05 Fri 18 Jul, 2008 00:35 Re: BBCode Hide Message With An Image Buttom ----------------------------------- I changed all files and upload images as was the explanation but I can not see the buttons on the panel BBCode. he modificado todos los archivos y subi las imagenes como estaba en la explicacion pero no puedo ver los botones en el panel de bbcodes. Alguna solucion? esto es en la version 1.2.0.27 ----------------------------------- channelasian Thu 09 Jul, 2009 03:56 Re: BBCode Hide Message With An Image Buttom ----------------------------------- hello how to do it with phpbb3 style Avaloncyan? i cant do that. please help me. Thanks sorry for bad english.