UseBB Community

The official board for UseBB help and discussion

UseBB Community » Resources & Customization » [hide] BBCode

[hide] BBCode

Moderators: Gaia.

Page: < 1 2

Author Post
Member
Registered: May 2005
Posts: 296
Location: 98671
Oops, another post to make sense.

The code above adds a Hide bbc code that members can click to "hide" whatever text they select, ...
Member
Registered: Dec 2007
Posts: 62
I did exactly as explained, but it doesnt work.
When I type [hide]HIDDENTEXT[/hide]
Everyone can still see "HIDDENTEXT" plus the [hide] and [/ is showing ^^
Member
Registered: May 2005
Posts: 296
Location: 98671
Code works... http://www.wmcintosh.com/board/topic.php?id=1 (only signature shows, actual post is hidden).

I believe you are missing code.
Member
Registered: Dec 2007
Posts: 62
I re-added the code even tho I checked it a second time before, but it doesnt work.

Maybe I have to remove cookies or something?
I'm using Firefox
Developer
Registered: Apr 2004
Posts: 2215
Location: Belgium
Member tag feature request merged with topic about hide tag mod.
_______________
--Dietrich (developer)
UseBB roadmap, dev mailing list & weblog
Member
Registered: May 2005
Posts: 296
Location: 98671
Hello Samuel.

Though hide works http://www.wmcintosh.com/board/topic.php?id=1

But shows when you do search member's posts.
http://www.wmcintosh.com/board/profile.php?id=1

I really like this addition, is there anyway to hide for that search?
Thanks
Member
Registered: Apr 2004
Posts: 192
Location: Brussels Belgium
I'm not sure if this is completely bugfree.

Find in sources/functions.php (line 1507)
/**
* Removes BBCode
*
* @param string $string Text string to clean
* @returns string Cleaned text
*/
function bbcode_clear($string) {

$existing_tags = array('code', 'b', 'i', 'u', 's', 'img', 'url', 'mailto', 'color', 'size', 'google', 'quote');
return preg_replace('#\[/?(?:'.join('|', $existing_tags).')(?:=[^\]]*)?\]#i', '', $string);

}

Under $existing_tags = array(...
Add
$string = preg_replace('#\[hide\][^\[]*\[/hide\]#i', '' ,$string);


The result should be this.
function bbcode_clear($string) {

$existing_tags = array('code', 'b', 'i', 'u', 's', 'img', 'url', 'mailto', 'color', 'size', 'google', 'quote');
$string = preg_replace('#\[hide\][^\[]*\[/hide\]#i', '' ,$string);
return preg_replace('#\[/?(?:'.join('|', $existing_tags).')(?:=[^\]]*)?\]#i', '', $string);

}
_______________
Member
Registered: May 2005
Posts: 296
Location: 98671
Appears to work, thank you.
Member
Registered: May 2005
Posts: 296
Location: 98671
Posted to be sure other text showed that weren't hid, so it still appears to work great.

Page: < 1 2

UseBB Community » Resources & Customization » [hide] BBCode

UseBB Community is powered by UseBB 1 Forum Software