phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

Need help with topic description bug


 
Search this topic... | Search MOD Writing... | Search Box
Register or Login to Post    Index » MOD Writing  Previous TopicPrint TopicNext Topic
Author Message
khofech
Board Member



Joined: 26 Feb 2009

Posts: 44



PostPosted: Sat Mar 07, 2009 4:31 pm 
Post subject: Need help with topic description bug

hi guys
hope this is the right place for this post.


I have a new problem icon_sad.gif this time with "topic description 1.15.2b mod"
this mod have 3 problems with me icon_smile.gif
let's treat the first please
I already correct the first step of the first problem
for whom don't know this mod, it add a description to the topic and show it as a under the title in viewforum, it also show a tooltip with the subject,,,..... it also have a lot of options blablablabla

I figured the problem right here

Code:


// makes BBCode from the hatelist unparsable or removes it if needed
function check_bbcode( $text, $bbcode_uid )
{
        global $board_config;
       
        // the extra .*? are there because some MODs might add stuff there :)
        if ( empty( $board_config['desc_bbcode_hatelist'] ) || empty( $text ) )
        {
                return $text;
        }
       
        preg_match_all( '#(\[(' . $board_config['desc_bbcode_hatelist'] . ').*?[:' . $bbcode_uid . '].*?\])(.*?)(\[/(' . $board_config['desc_bbcode_hatelist'] . ').*?[:' . $bbcode_uid . '].*?\])#is', $text, $matches );

        // the all famous loop ^^
        foreach ( $matches[ 0 ] as $i => $match )
        {
                if ( $board_config['desc_bbcode_remove'] )
                { // simply remove it
                        $text = str_replace( $match, '', $text );
                }
                else
                { // a tad more complex :)
                        $finds = array( ':' . $bbcode_uid, '[', ']' );
                        $replaces = array( '', '[', ']' );
                        $rep1 = '[b:' . $bbcode_uid . ']' . str_replace( $finds, $replaces, $matches[ 1 ][ $i ] ) . '[/b:' . $bbcode_uid . ']';
                        $rep2 = '[b:' . $bbcode_uid . ']' . str_replace( $finds, $replaces, $matches[ 4 ][ $i ] ) . '[/b:' . $bbcode_uid . ']';
                        $text = str_replace( $match, $rep1 . $matches[ 3 ][ $i ] . $rep2, $text );
                }
        }

        return $text;
}


the original preg_match_all was

Code:

preg_match_all( '#(\[(' . $board_config['desc_bbcode_hatelist'] . ').*?:' . $bbcode_uid . '\])(.*?)(\[/(' . $board_config['desc_bbcode_hatelist'] . ').*?:' . $bbcode_uid . '\])#is', $text, $matches );


this original one , parse the bbcode with a bbcode_uid but it's unable to parse a simple
Code:

[url]  blablabla [/url]


so I change it to the one u see in first code section, it works fine and hope u correct it if u see any problems there,

now the problem is, that this modification to the preg_match_all is still unable to parse this kind of bbcode

Code:

[url=http://blabalblabla] site name [/url]
and the others "We do URLs in several different ways.. (c)"

and at this point I need your help icon_smile.gif
so..... can anybody take a look at that regExp and tweak it , so we can proceed to the rest of bugs hhhhh ?

thnx in advance
Back to top
khofech
Board Member



Joined: 26 Feb 2009

Posts: 44



PostPosted: Sun Mar 08, 2009 7:49 am 
Post subject: Re: Need help with topic description bug

ok, guys, I'm happy, anybody knows why !! icon_smile.gif icon_smile.gif
because I solved the problem icon_smile.gif
ok

here is what the preg_match_all should look like around
the line 378 in functions_desc.php from topic_desc 1.15.2b mod

Code:

//bug repaired by khofech :), the bug is that
// this preg_match_all() don't see bbcode without bbcode uid and //with extended firest tag like [url=.....]
//hope is will work with extended img tag that containt width and height , didn't test it yet


        preg_match_all( '#(\[(' . $board_config['desc_bbcode_hatelist'] . ').*[:' . $bbcode_uid . ']*\])(.*?)(\[/(' . $board_config['desc_bbcode_hatelist'] . ')[:' . $bbcode_uid . ']*\])#is', $text, $matches );




----------------
so guys ? let's proceed to the next bug in this mod ? anybody ready to help ?
Back to top
Display posts from previous:   
Register or Login to Post    Index » MOD Writing  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT - 4 Hours
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0467 seconds using 17 queries. (SQL 0.0141 Parse 0.0005 Other 0.0322)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo