26

Re: [extension release] pun_quote 2.0.2

New version pun_quote 2.2 has been released. Quoted text is added to the current cursor position now.

27 (edited by postulat 2009-09-07 19:38)

Re: [extension release] pun_quote 2.0.2

Here is one question extension really works good, I use [hide=some number][/hide] tag, so on using your extension it shows all the hiden content what doesn't do good fjob for my forum, can you offer the correct replacement for this tag in order to delete this block from the 'quote'

Thanks

28

Re: [extension release] pun_quote 2.0.2

Study the code of the function "do_bbcode" in the file "<FORUM_ROOT>/include/parser.php". This function replaces bbcode tags with HTML tags

Re: [extension release] pun_quote 2.0.2

Slavok wrote:

Study the code of the function "do_bbcode" in the file "<FORUM_ROOT>/include/parser.php". This function replaces bbcode tags with HTML tags

Hide tag works perfectly with the posts, it has only bag if I click "quick quote" your javascript grabs the whole post content together with the hide tag.

with the parser.php have the following block

/// MOD HIDE TAG begin
    if (strpos($text, 'hide=') !== false)
    {
        if ($forum_user['is_guest'])
        {
                $text = preg_replace("#\[hide=([0-9]*)](.+?)\[/hide\]#is", '<div style="margin: 5px 20px 20px 20px;"><table cellpadding="0" cellspacing="0" border="0" width="100%"><td style="border:1px inset; background: #e8ecef"><i> <font color="red">('.$lang_topic['Hidden text guest'].')</font></i></td>
</td></table></div>', $text);
        }
        else 
        {
            preg_match('#\[hide=([0-9]*)]#s',$text,$hide_count);
            if($hide_count[1]<0) $hide_count[1]=0;
            if(($forum_user['g_id'] == FORUM_MOD) || ($forum_user['g_id'] == FORUM_ADMIN) || (($forum_user['num_posts']) >= ($hide_count[1])))
            {
                $text = preg_replace('#\[hide=([0-9]*)](.*?)\[/hide\]#s', '<div style="margin: 5px 20px 20px 20px;"><table cellpadding="0" cellspacing="0" border="0" width="100%"><td style="border:1px inset; background: #e8ecef"><i>'.$lang_topic['Hidden text'].':<br><i>$2</i></i></td>
</td></table></div>', $text);
            }
            else
            {
                $text = preg_replace("#\[hide=([0-9]*)](.+?)\[/hide\]#is", '<div style="margin: 5px 20px 20px 20px;"><table cellpadding="0" cellspacing="0" border="0" width="100%"><td style="border:1px inset; background: #e8ecef"><i> <font color="red">('.$lang_topic['Hidden count begin'].' '.$hide_count[1].' '.$lang_topic['Hidden count end'].')</font></i></td>
</td></table></div>', $text);
            }
        }
    }
    if (strpos($text, 'hide') !== false)
    {
        if ($forum_user['is_guest'])
        {
                $text = preg_replace("#\[hide\](.+?)\[/hide\]#is", '<b>['.$lang_topic['Hidden text guest'].']</b>', $text);
        }
        else 
        {
            $text = str_replace('[hide]', '<blockquote>'.$lang_topic['Hidden text'].':<br><i>', $text);
            $text = preg_replace('#\[\/hide\]\s*#', '</i></blockquote>', $text);
        }
    }    
// MOD HIDE TAG end

Re: [extension release] pun_quote 2.0.2

So as I understand the hide variable should be added to the this function with property to hide text or any content in
[hide=][/hide]

function QuickQuote(qid_param)
{
    var selected_text = getSelectedText();
    var quick_post_value = document.getElementsByName('req_message');
    var cur_pos = getCaretPos();
    var text = quick_post_value[0].value;
    var text_below = text.substring(0, cur_pos);
    var text_above = text.substring(cur_pos, text.length);

    [b]if (selected_text == undefined || selected_text == '')[/b]
    {
        var quote = '[quote=' + pun_quote_authors[qid_param] + ']' + ParseMessage(pun_quote_posts[qid_param]) + '[/quote]';
        quick_post_value[0].value = text_below + quote + text_above;
    }

31

Re: [extension release] pun_quote 2.0.2

I think it will be better to modify the function "ParseMessage". It will be:

function ParseMessage(string)
{
     var search_arr = new Array(/&amp;/g, /&quot;/g, /&#039;/g, /&lt;/g, /&gt;/g);
     var replace_arr = new Array('&', '"', '\'', '<', '>');
     for (var replace_num = 0; replace_num < search_arr.length; replace_num++)
         string = string.replace(search_arr[replace_num], replace_arr[replace_num]);
     string = string.replace(/\[hide=?\].*\[\/hide\]/g, '');
     return string;
}

Report about results of this changes, please.

32 (edited by postulat 2009-09-18 07:41)

Re: [extension release] pun_quote 2.0.2

This function gives no result it doesn't hide content in [hide=?][/hide] and the hidden links also can be seen in html code by browsing java script the pun_quote creates.

the problem can be seen here http://blog.dynotab.com.ua/viewtopic.php?id=23

33

Re: [extension release] pun_quote 2.0.2

Is this code works for you?

function ParseMessage(string)
{
     var search_arr = new Array(/&amp;/g, /&quot;/g, /&#039;/g, /&lt;/g, /&gt;/g);
     var replace_arr = new Array('&', '"', '\'', '<', '>');
     for (var replace_num = 0; replace_num < search_arr.length; replace_num++)
         string = string.replace(search_arr[replace_num], replace_arr[replace_num]);
     string = string.replace('(Скрытый текст доступен для пользователей с определенным количеством сообщений.)', '');
     return string;
}

34 (edited by postulat 2009-09-24 06:50)

Re: [extension release] pun_quote 2.0.2

This code doesn't work it gives the results as previous, by the link from the forum

http://blog.dynotab.com.ua/viewtopic.php?id=23


[quote=G. Spider]ДСТУ 3099-95 Спирт етиловий ректифікований із меляси високоякісний.

Технічні умови
[hide=30][url=http://blog.dynotab.com.ua/norma/8_d3099-95.djv]загрузить>>>[/url][/hide]
Файл в формате djv
Для просмотра необходим Djvu Viewer скачать по следующей ссылке| [url=http://depositfiles.com/files/8mq7o8s05l target="_blank"][color=blue]загрузить>>>[/color][/url][/quote]

I'm stuck at this moment !

35 (edited by Radovar 2010-03-08 20:57)

Re: [extension release] pun_quote 2.0.2

If any post is ended by backslash, pun_quote's javascript code will be corrupted on whole page. For example: :\

Re: [extension release] pun_quote 2.0.2

Fixed and the new version of pun_quote (2.2.1) is released.

Re: [extension release] pun_quote 2.0.2

New bug: "\n" symbols in quoted text.

Slavok wrote:

I think it will be better to modify the function "ParseMessage". It will be:\n

\nfunction ParseMessage(string)\n{\n     var search_arr = new Array(/&amp;/g, /"/g, /'/g, /</g, />/g);\n     var replace_arr = new Array('&', '"', '\'', '<', '>');\n     for (var replace_num = 0; replace_num < search_arr.length; replace_num++)\n         string = string.replace(search_arr[replace_num], replace_arr[replace_num]);\n     string = string.replace(/\[hide=?\].*\[\/hide\]/g, '');\n     return string;\n}\n

\nReport about results of this changes, please.

Re: [extension release] pun_quote 2.0.2

Thanks for reporting. Fixed and the new version (2.2.2) is released.

Re: [extension release] pun_quote 2.0.2

Another bug in IE 6 - 8: after clicking "Quick quote" link, user is redirected to reply page.

Re: [extension release] pun_quote 2.0.2

Can anyone please update this and make this work for 1.4.2. Its a very nice feature, especially for quick multi quote for qucik reply.

MyFootballCafe.com  is Now Online!

Re: [extension release] pun_quote 2.0.2

I tested this with 1.4.2, it works in Chrome 21.0, IE9 and FF 15.0

MyFootballCafe.com  is Now Online!