Icy Phoenix

     
 


Post new topic  Reply to topic 
Page 1 of 1
 
 
Reply with quote Download Post 
Post [MOD IPv1.3.0.*] BBCode Hide Message With An Image Buttom 
 
#--------[ BEGIN MODIFICATION ]-------#

MOD adapted for IP 1.3 by TuningBEB2008 from a mod by Zuker for IP 1.2 [ view post ]

Description:
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: Example

Rename this image as hide_yes.gif and upload to: /images/bbcb_mg/images/

And this image will be shown when users are able to see the hidden message: Example

Rename this image as hide_no.gif and upload to: /images/bbcb_mg/images/

Example Images of this hack: When the message is hidden / When the message is not hidden

OPEN:
includes/bbcode.php

FIND:
Code: [Download] [Hide] [Select]
            // generate html
            $html = '<blockquote class="quote"><div class="quote-nouser">' . $lang['xs_bbc_hide_message'] . ':</div><div class="post-text post-text-hide-flow">';
            if(!$show)
            {
                return array(
                    'valid' => true,
                    'html' => $html . $lang['xs_bbc_hide_message_explain'] . '</div></blockquote>',
                    'allow_nested' => false,
                );
            }
            else
            {
                return array(
                    'valid' => true,
                    'start' => $html,
                    'end' => '</div></blockquote>'
                );
            }


REPLACE WITH:
Code: [Download] [Hide] [Select]
            // generate html
            $html = '<blockquote class="quote"><div class="quote-nouser">' . $lang['xs_bbc_hide_message'] . ':</div><div class="post-text">';
            if(!$show)
            {
                return array(
                    'valid' => true,
                    'html' => $html . '<center><img src="images/bbcb_mg/images/hide_yes.gif" border="0"/></center><br />' . $lang['xs_bbc_hide_message_explain'] . '</div></blockquote>',
                    'allow_nested' => false,
                );
            }
            else
            {
                return array(
                    'valid' => true,
                    'start' => $$html . '<center><img src="images/bbcb_mg/images/hide_no.gif" border="0"/></center><br />',
                    'end' => '</div></blockquote>'
                );
            }


With this changes, we have an image with the text of BBcode Hide explain.

But, the BBcode Hide doesn't have a bbcode button on posting.php (on reply).
With this changes, you can add this button.
Example Image of the button: Image of the button pressed
Follow this instructions:

Upload to /images/bbcb_mg/images/gif this images:
hide7aq = (rename this to hide.gif)
hide13lp = (rename this to hide1.gif)

OPEN:
languages/lang_english/lang_bbcb_mg.php

FIND:
Code: [Download] [Hide] [Select]
    'bbcb_mg_highlight' => 'Highlight',


AFTER, ADD:
Code: [Download] [Hide] [Select]
   'bbcb_mg_hide' => 'Hide a message',


FIND:
Code: [Download] [Hide] [Select]
$js_lang['s_highlight_help'] = 'Highlight: [highlight=#FFFFAA]text';


AFTER, ADD:
Code: [Download] [Hide] [Select]
$js_lang['s_hide_help'] = 'Users must reply or thanks topic to view the hidden message: [hide]Hidden Message[/hide]';


FIND:
Code: [Download] [Hide] [Select]
$js_lang['s_smiley_creator'] = 'Smiley Creator: [smiley=1]Text[/smiley] insert a smiley with text';


AFTER, ADD:
Code: [Download] [Hide] [Select]
$js_lang['s_hide_help'] = 'Users must reply or thanks topic to view the hidden message: [hide]Hidden Message[/hide]';


OPEN:
includes/bbcb_mg.php

FIND:
Code: [Download] [Hide] [Select]
    'L_BBCB_MG_HIGHLIGHT' => $lang['bbcb_mg_highlight'],


AFTER, ADD:
Code: [Download] [Hide] [Select]
    'L_BBCB_MG_HIDE' => $lang['bbcb_mg_hide'],


FIND:
Code: [Download] [Hide] [Select]
    'L_HIGHLIGHT_HELP' => $lang['s_highlight_help'],


AFTER, ADD:
Code: [Download] [Hide] [Select]
    'L_HIDE_HELP' => $lang['s_hide_help'],


OPEN:
templates/common/js/bbcb_mg.js

FIND:
Code: [Download] [Hide] [Select]
var Td = 0;


AFTER ADD:
Code: [Download] [Hide] [Select]
var Hide = 0;


FIND:
Spoiler: [ Show ]


AFTER ADD:
Code: [Download] [Hide] [Select]
'[hide]','[/hide]',


FIND:
Code: [Download] [Hide] [Select]
function BBChl()
{
    var txtarea = document.forms[form_name].elements[text_name];

    if ((clientVer >= 4) && is_ie && is_win)
    {
        theSelection = document.selection.createRange().text;
        if (theSelection != '')
        {
            document.selection.createRange().text = "[highlight=#FFFFAA]" + theSelection + "
";
            document.forms[form_name].elements[text_name].focus();
            return;
        }
    }
    else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0))
    {
        mozInsert(txtarea, "[highlight=#FFFFAA]", "
");
        return;
    }
    ToAdd = "[highlight=#FFFFAA]"+" " + "
";
    PostWrite(ToAdd);
}


AFTER, ADD:
Code: [Download] [Hide] [Select]
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 = "[hide]Quoted Hidden Message, which is still hidden.[/hide]";
            document.post.message.focus();
            return;
        }
    }
    else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0))
    {
        //mozWrap(txtarea, "[hide]Quoted Hidden Message, which is still hidden.[/hide]");
        mozInsert(txtarea, "[hide]Quoted Hidden Message, which is still hidden.[/hide]");
        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);
}


OPEN:
templates/default/bbcb_mg.tpl

FIND:
Code: [Download] [Hide] [Select]
                    <a href="javascript:BBChl()" ><img src="{BBCB_MG_IMG_PATH}highlight{BBCB_MG_IMG_EXT}" name="highlight" onmouseover="helpline('highlight')" alt="{L_BBCB_MG_HIGHLIGHT}" title="{L_BBCB_MG_HIGHLIGHT}" class="bbimages" /></a>


AFTER ADD:
Code: [Download] [Hide] [Select]
                    <a href="javascript:BBChide()"><img src="{BBCB_MG_IMG_PATH}hide{BBCB_MG_IMG_EXT}" name="hide_img" onMouseOver="helpline('hide')" alt="{L_BBCB_MG_HIDE}" title="{L_BBCB_MG_HIDE}" class="bbimages" /></a>


Now, with this changes, we have a new button to use the bbcode hide in the posting page

DEMO: http://testicyforummods.site11.com/viewtopic.php?f=1&t=7

Before adding this MOD to your Icy Phoenix, you should Backup all files related to this MOD.

#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
# EoM  
 



 
TuningBEB2008Send private messageVisit poster's website  
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Reply with quote Download Post 
Post Re: [MOD IPv1.3.0.*] BBCode Hide Message With An Image Buttom 
 
Thank you very much, this excellent.    

Greetings
 



 
AerosmithSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: [MOD IPv1.3.0.*] BBCode Hide Message With An Image Buttom 
 
I have a question, Can I set this mod so it will only need to be registered to view the post?

Thanks.
 



 
DiegorkSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: [MOD IPv1.3.0.*] BBCode Hide Message With An Image Buttom 
 
Why don't set appropriate permissions in ACP for that?

Do you want to hide only the first post?
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: [MOD IPv1.3.0.*] BBCode Hide Message With An Image Buttom 
 
I want to hide the first post, and i want that the users who want see the first post only be registrered, I donĀ“t want that the users need to reply the post to see the post.

PD: In the ACP where are the permissions for the hide mod?

Bye and thanks.
 



 
DiegorkSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: [MOD IPv1.3.0.*] BBCode Hide Message With An Image Buttom 
 
Diegork wrote: [View Post]
PD: In the ACP where are the permissions for the hide mod?

I was meaning forums VIEW and READ permissions...
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: [MOD IPv1.3.0.*] BBCode Hide Message With An Image Buttom 
 
Thank you very much, this excellent but I really need help with this mod already and could not move from the incluided
 



 
rendimareSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: [MOD IPv1.3.0.*] BBCode Hide Message With An Image Buttom 
 
Thank you for this customize .  I just noitce there is an error when hide it.  Let say if you click on Hide button twice, you'll get this
Code: [Download] [Hide] [Select]
[hide] [/hide]
, then you put anything thing that you want to hide in between.  This way is ok.   But if you hightlight it then click on Hide button, then you'll get this
Code: [Download] [Hide] [Select]
[hide]Quoted Hidden Message, which is still hidden.[/hide]


for example:  i want to hide a link that i already typed
htttp://blablablabla.....

If i highlight it then click on Hide button i'll get this instead
Code: [Download] [Hide] [Select]
[hide]Quoted Hidden Message, which is still hidden.[/hide]

 



 
xmenfileSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: [MOD IPv1.3.0.*] BBCode Hide Message With An Image Buttom 
 
I'm interested in this mod but I could make it work in any way if someone can throw me a hand with the agradecere selo
 



 
rendimareSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: [MOD IPv1.3.0.*] BBCode Hide Message With An Image Buttom 
 
I do not have this mod, but when I manually type
Code: [Download] [Hide] [Select]
[hide][/hide] or [hide=][/hide]

it works like it worked before, when we were at phpbb3...   But I have no buttons to push in the bbcode bar...
I uploaded hide.gif into image path and did this

OPEN:
templates/common/js/bbcb_mg.js

FIND:
Code: [Download] [Hide] [Select]
var Td = 0;


AFTER ADD:
Code: [Download] [Hide] [Select]
var Hide = 0;


FIND:
Spoiler: [ Show ]


AFTER ADD:
Code: [Download] [Hide] [Select]
'
Hidden Message:
Sorry, but you must be registered and also post a reply to view this message.
',

and that:

OPEN:
templates/default/bbcb_mg.tpl

FIND:

                  
Code: [Download] [Hide] [Select]
<a href="javascript:BBChl()" ><img src="{BBCB_MG_IMG_PATH}highlight{BBCB_MG_IMG_EXT}" name="highlight" onmouseover="helpline('highlight')" alt="{L_BBCB_MG_HIGHLIGHT}" title="{L_BBCB_MG_HIGHLIGHT}" class="bbimages" /></a>



AFTER ADD:
Code: [Download] [Hide] [Select]
                    <a href="javascript:BBChide()"><img src="{BBCB_MG_IMG_PATH}hide{BBCB_MG_IMG_EXT}" name="hide_img" onMouseOver="helpline('hide')" alt="{L_BBCB_MG_HIDE}" title="{L_BBCB_MG_HIDE}" class="bbimages" /></a>


So now the image appear, but it is not pushable  

Tell me please, what should I do to make hide.gif
Code: [Download] [Hide] [Select]
[hide][/hide]
when clicking on it?
 



 
RipleySend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: [MOD IPv1.3.0.*] BBCode Hide Message With An Image Buttom 
 
i use this code in my forum  i think this can be another option for the mod
 with this change you need to select the text to hide
 do all the steps  in the start of this  topic  after you can try  this function
Im not a coder please check this be ok

sorry about my english


Before Try this change to the mod
Backup this file
and  the next to do is

in  
templates/common/js/bbcb_mg.js


FIND:

Code: [Download] [Hide] [Select]
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 = "[hide]Quoted Hidden Message, which is still hidden.[/hide]";
            document.post.message.focus();
            return;
        }
    }
    else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0))
    {
        //mozWrap(txtarea, "[hide]Quoted Hidden Message, which is still hidden.[/hide]");
        mozInsert(txtarea, "[hide]Quoted Hidden Message, which is still hidden.[/hide]");
        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);
}





REPLACE WITH:


Code: [Download] [Hide] [Select]
function BBChide()
{
    var txtarea = document.forms[form_name].elements[text_name];

    if ((clientVer >= 4) && is_ie && is_win)
    {
        theSelection = document.selection.createRange().text;
        if (theSelection != '')
        {
            document.selection.createRange().text = "[hide]" + theSelection + "[/hide]";
            document.forms[form_name].elements[text_name].focus();
            return;
        }
    }
    else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0))
    {
        mozInsert(txtarea, "[hide]", "[/hide]");
        return;
    }
    if (hide == 0)
    {
        ToAdd = "[hide]";
        document.forms[form_name].hide.src = bbcb_mg_img_path + "hide1" + bbcb_mg_img_ext;
        Hide = 1;
    }
    else
    {
        ToAdd = "[/hide]";
        document.forms[form_name].hide.src = bbcb_mg_img_path + "hide" + bbcb_mg_img_ext;
        Hide = 0;
    }
    PostWrite(ToAdd);
}


take care about the images
Code: [Download] [Hide] [Select]
hide_no.gif
and
Code: [Download] [Hide] [Select]
hide_yes.gif
if be necesary switch the names via ftp
 



 
El_FenixSend private message  
Back to topPage bottom
Post new topic  Reply to topic  Page 1 of 1
 


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events


  

 

  cron