Welcome to all phpBB2 Refugees!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. |
|
Author |
Message |
khofech Board Member
Joined: 26 Feb 2009
Posts: 44
|
Posted: 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 this time with "topic description 1.15.2b mod"
this mod have 3 problems with me
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
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
|
Posted: Sun Mar 08, 2009 7:49 am Post subject: Re: Need help with topic description bug |
|
|
ok, guys, I'm happy, anybody knows why !!
because I solved the problem
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 |
|
|
|
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
|
|