| Author |
Post |
|
|
#1 Mon Oct 09, 2006 12:17 am
|
|
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. »
|
|
|
#2 Mon Oct 09, 2006 6:48 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. »
|
|
|
#3 Tue Oct 10, 2006 8:44 am
|
|
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.. :-)
|
|
|
#4 Fri Oct 13, 2006 1:14 pm
|
|
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.
|
|
|
#5 Thu Mar 29, 2007 10:06 pm
|
|
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.
|
|
|
#6 Thu Apr 05, 2007 8:00 pm
|
|
Member
Registered: Apr 2004
Posts: 192
Location: Brussels Belgium
|
I'l check this out as soon as I can 
|
|
|
#7 Thu Apr 05, 2007 8:31 pm
|
|
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.
|
|
|
#8 Sun Apr 08, 2007 4:00 pm
|
|
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'; }
|
|
|
#9 Mon Apr 09, 2007 5:02 am
|
|
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.
|
|
|
#10 Mon Apr 09, 2007 7:18 am
|
|
Member
Registered: May 2005
Posts: 294
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.
|
|
|
#11 Mon Apr 09, 2007 7:59 am
|
|
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.
|
|
|
#12 Wed Sep 05, 2007 5:52 am
|
|
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.
|
|
|
#13 Sun Sep 30, 2007 11:30 pm
|
|
Member
Registered: May 2005
Posts: 294
Location: 98671
|
sarangan it still works ( UseBB 1.0.8 )... http://www.wimc.us/usebb/topic.php?id=6
|
|
|
#14 Sun Oct 07, 2007 1:04 am
|
|
Member
Registered: May 2005
Posts: 294
Location: 98671
|
Both links I've posted above have nothing to do with this mod now.
|
|
|
#15 Mon Oct 08, 2007 5:38 pm
|
|
Member
Registered: Apr 2004
Posts: 192
Location: Brussels Belgium
|
Sarangan : Can you give some more details ? Like version of usebb ? Any php errors ?
|
|
|
#16 Mon Oct 08, 2007 5:52 pm
|
|
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. Thank you Samuel.  _______________ "Three things cannot be long hidden: the sun, the moon, and the truth." - said by Buddha.
|
|
|
#17 Mon Oct 08, 2007 7:08 pm
|
|
Member
Registered: May 2005
Posts: 294
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. »
|
|
|
#18 Wed Oct 10, 2007 12:35 pm
|
|
Member
Registered: Apr 2004
Posts: 192
Location: Brussels Belgium
|
I'l test it later today 
|
|
|
#19 Wed Oct 10, 2007 1:17 pm
|
|
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.
|
|
|
#20 Wed Oct 10, 2007 5:58 pm
|
|
Member
Registered: May 2005
Posts: 294
Location: 98671
|
No problem, only thing I done was updated the line numbers for code locations.
|
|
|
#21 Fri Oct 12, 2007 8:13 am
|
|
Member
Registered: May 2005
Posts: 294
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'], '') );
|
|
|
#22 Tue Jan 08, 2008 8:53 pm
|
|
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 
|
|
|
#23 Tue Jan 08, 2008 9:15 pm
|
|
Member
Registered: May 2005
Posts: 294
Location: 98671
|
|
|
|
#24 Wed Jan 09, 2008 7:06 am
|
|
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?
|
|
|
#25 Wed Jan 09, 2008 3:19 pm
|
|
Member
Registered: May 2005
Posts: 294
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. »
|