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: Oct 2006
Posts: 37
Hello friends.
I need a bb code option that can hide sometext, links for non registered users. I know this kind of things are mostly used in warez sites.

Don`t think I too want to do that. I need it to hide something from guests and force them to register at my forum

I have searched in the forum and cannot find any mods that can do the same.
Can anyone create one like this?

Thank you. :)
« Last edit by Dietrich on Thu Oct 26, 2006 8:12 pm. »
Member
Registered: Apr 2004
Posts: 192
Location: Brussels Belgium
Open file languages/land_English.php, at the end before
?>
add
$lang['Hide'] = 'Hide';


Open sources/functions.php, Line +- 1483 you will find
$existing_tags = array('code', 'b', 'i', 'u', 's', 'img', 'url', 'mailto', 'color', 'size', 'google', 'quote');
replace with
$existing_tags = array('code', 'b', 'i', 'u', 's', 'img', 'url', 'mailto', 'color', 'size', 'google', 'quote','hide');


Line +- 1522 you will find
$existing_tags = array('code', 'b', 'i', 'u', 's', 'img', 'url', 'mailto', 'color', 'size', 'google', 'quote');
replace with
$existing_tags = array('code', 'b', 'i', 'u', 's', 'img', 'url', 'mailto', 'color', 'size', 'google', 'quote','hide');


Line +- 1689 you will find
global $db, $template, $lang;
replace with
global $db, $template, $lang, $session;


Line +- 1800 you will find
// [google=keyword]text[/google]
"#\[google=(.*?)\](.*?)\[/google\]#is" => '<a href="http://www.google.com/search?q="'.$rel.'></a>',
);
after add
/*
Hide mod
Copyright Vandamme Samuel
http://www.sava.be
*/
if ( $session->sess_info['user_id'] == 0 ) {
$regexps["#\[hide\](.*?)\[/\hide\]#is"] = '';
} else {
$regexps["#\[hide\](.*?)\[/\hide\]#is"] = '\\\\1';
}


Line +- 1853 you will find
array('[size=14]', '[/size]', $lang['Size'], '')
);
replace with
array('[size=14]', '[/size]', $lang['Size'], ''),
array('[hide]', '[/hide]', $lang['Hide'], '')
);



I think thats all, you can allways post here if you have any problems.
_______________
« Last edit by Samuel on Mon Oct 09, 2006 7:09 pm. »
Member
Registered: Oct 2006
Posts: 37
Hey Samuel..
Oh my god.. ;)
What a nice hack..! It works perfectly man.. Thank you so much..
I can`t describe how much happy I am of your help.. :-)
Member
Registered: Oct 2006
Posts: 11
Location: El Salvador
What a nice hack!! I think this will be useful in the next release of UseBB, as an optional choice.

Thanks a lot for this good mod for UseBB.
Member
Registered: Oct 2006
Posts: 37
This hack doesn`t work correctly on the latest version 1.0.5..
Can anyone make a new hack for the latest version?

I will be happy if Samuel want to spend little of his time to do that..

Please..
_______________
"Three things cannot be long hidden: the sun, the moon, and the truth." - said by Buddha.
Member
Registered: Apr 2004
Posts: 192
Location: Brussels Belgium
I'l check this out as soon as I can :)
_______________
Member
Registered: Oct 2006
Posts: 37
Thank you..
I am just waiting for your help..
_______________
"Three things cannot be long hidden: the sun, the moon, and the truth." - said by Buddha.
Member
Registered: Apr 2004
Posts: 192
Location: Brussels Belgium
Ok I found the problem :)

/*
Hide mod
Copyright Vandamme Samuel
http://www.sava.be
*/
if ( $session->sess_info['user_id'] == 0 ) {
$regexps["#\[hide\](.*?)\[/\hide\]#is"] = '';
} else {
$regexps["#\[hide\](.*?)\[/\hide\]#is"] = '\\\\1';
}


should become

/*
Hide mod
Copyright Vandamme Samuel
http://www.sava.be
*/
if ( $session->sess_info['user_id'] == 0 ) {
$regexps["#\[hide\](.*?)\[/\hide\]#is"] = '';
} else {
$regexps["#\[hide\](.*?)\[/\hide\]#is"] = '\\1';
}
_______________
Member
Registered: Oct 2006
Posts: 37
I can confirm that the latest hack of this modules is working perfectly.
Thanks again Samuel..
_______________
"Three things cannot be long hidden: the sun, the moon, and the truth." - said by Buddha.
Member
Registered: May 2005
Posts: 298
Location: 98671
Thanks Samuel, nice and handy addition to my (slow to take off) forum.

http://www.wmcintosh.com/usebb/topic.php?id=9 just to show it works.
Member
Registered: Oct 2006
Posts: 37
Friends..
Belive in me that mod help you much.. I have builded up a community forum with 9809 members with this mod.
_______________
"Three things cannot be long hidden: the sun, the moon, and the truth." - said by Buddha.
Member
Registered: Oct 2006
Posts: 37
Hi Samuel.
I have problem with this mod in the latest version. Will you please check it once and fix the error.

Thank you so much for your time.
_______________
"Three things cannot be long hidden: the sun, the moon, and the truth." - said by Buddha.
Member
Registered: May 2005
Posts: 298
Location: 98671
sarangan it still works ( UseBB 1.0.8 )...
http://www.wimc.us/usebb/topic.php?id=6
Member
Registered: May 2005
Posts: 298
Location: 98671
Both links I've posted above have nothing to do with this mod now.
Member
Registered: Apr 2004
Posts: 192
Location: Brussels Belgium
Sarangan : Can you give some more details ? Like version of usebb ? Any php errors ?
_______________
Member
Registered: Oct 2006
Posts: 37
Samuel wrote
Sarangan : Can you give some more details ? Like version of usebb ? Any php errors ?


In both versions 1.0.7 & 1.0.8. It doesn't give any php errors, but it doesn't hide those things it should hide for guests. That what I see in a topic is only the tags [hide] my text [/hide]

I hope this information is enough to fix that error. :roll:

Thank you Samuel. :D
_______________
"Three things cannot be long hidden: the sun, the moon, and the truth." - said by Buddha.
Member
Registered: May 2005
Posts: 298
Location: 98671
How I got it to work... and worked fine.
http://www.wimc.us/temp/hidetext.txt
« Last edit by William on Mon Oct 08, 2007 7:15 pm. »
Member
Registered: Apr 2004
Posts: 192
Location: Brussels Belgium
I'l test it later today :)
_______________
Member
Registered: Oct 2006
Posts: 37
Samuel..
You don`t need to test it. William's modification works perfectly.

Thanks anyway.

Thankyou William :)
_______________
"Three things cannot be long hidden: the sun, the moon, and the truth." - said by Buddha.
Member
Registered: May 2005
Posts: 298
Location: 98671
No problem, only thing I done was updated the line numbers for code locations.
Member
Registered: May 2005
Posts: 298
Location: 98671
Only the line numbers were changed to reflect UseBB 1.0.8

Open file languages/land_English.php

At the end...

?>

Add before...

$lang['Hide'] = 'Hide';

=================================================

Open sources/functions.php

Line +- 1515 you will find...

$existing_tags = array('code', 'b', 'i', 'u', 's', 'img', 'url', 'mailto', 'color', 'size', 'google', 'quote');


Replace with...

$existing_tags = array('code', 'b', 'i', 'u', 's', 'img', 'url', 'mailto', 'color', 'size', 'google', 'quote', 'hide');

--------------------------------------------------------------------------------------

Line +- 1554 you will find...

$existing_tags = array('code', 'b', 'i', 'u', 's', 'img', 'url', 'mailto', 'color', 'size', 'google', 'quote');

Replace with...

$existing_tags = array('code', 'b', 'i', 'u', 's', 'img', 'url', 'mailto', 'color', 'size', 'google', 'quote', 'hide');

--------------------------------------------------------------------------------------

Line +- 1725 you will find...

global $db, $template, $lang;

Replace with...

global $db, $template, $lang, $session;

--------------------------------------------------------------------------------------

Line +- 1835 you will find...

// [google=keyword]text[/google]
"#\[google=(.*?)\](.*?)\[/google\]#is" => '<a href="http://www.google.com/search?q="'.$rel.'></a>',
);

After add...

/*
Hide mod
Copyright Vandamme Samuel
http://www.sava.be
*/
if ( $session->sess_info['user_id'] == 0 ) {
$regexps["#\[hide\](.*?)\[/\hide\]#is"] = '';
} else {
$regexps["#\[hide\](.*?)\[/\hide\]#is"] = '\\1';
}

--------------------------------------------------------------------------------------

Line +- 1876 you will find...

array('[size=14]', '[/size]', $lang['Size'], '')
);

Replace with...

array('[size=14]', '[/size]', $lang['Size'], ''),
array('[hide]', '[/hide]', $lang['Hide'], '')
);
Member
Registered: Dec 2007
Posts: 62
Hi, I think this feature has never been suggested..

If you would type the following in the post, only logged in users would see it, else "This part is hidden to guests":
[member]
Hi, only members would see this
[/member]

Consider it, please :)
Member
Registered: May 2005
Posts: 298
Location: 98671
Can add a hide to UseBB 1.
http://www.usebb.net/community/topic-post7879.html#post7879
Member
Registered: Dec 2007
Posts: 62
I'm really not good with such things.
Can you tell me where to add this?
And will I use [hide] instead of [member] in the part of the posts I want to be for members only?
Member
Registered: May 2005
Posts: 298
Location: 98671
The code above adds a bbc code that allows members can click to "hide" whatever text they select, there are only 2 files to modify, but I didn't write it, Samuel did.
« Last edit by William on Wed Jan 09, 2008 3:22 pm. »

Page: 1 2 >

UseBB Community » Resources & Customization » [hide] BBCode

UseBB Community is powered by UseBB 1 Forum Software