UseBB Community

The official board for UseBB help and discussion

UseBB Community » Resources & Customization » Disable fields and certain BBcodes?

Disable fields and certain BBcodes?

Moderators: Gaia.

Page: 1 2 >

Author Post
Member
Registered: Jun 2007
Posts: 122
Location: Gatineau, QC, Canada
Hi,

I would like to remove the Website and all other Messenger (Yahoo, MSN, etc.) form the profile page and also disallow the use of the Img and URL codes, how would I go about doing that?

I'm very familiar with phpBB so I have no problems modding tpl and php files.

Thanks,
Gene
:P
Moderator
Registered: Oct 2005
Posts: 447
Location: canada
You can remove the Website and other Messenger fields by going to panel.tpl.php and editing the $templates['edit_profile'] variable to remove the fields you don't want to allow. Then in various.tpl.php and edit the variable $templates['profile'] to remove them from the profile view.

For the BB Code, I think you will have to remove the code within sources/functions.php and remove the bb Code regex that you dont want


//
// All kinds of BBCode regexps
//


Just search for that and they should be listed below.
Member
Registered: Jun 2007
Posts: 122
Location: Gatineau, QC, Canada
Thanks,

Quote
You can remove the Website and other Messenger fields by going to panel.tpl.php and editing the $templates['edit_profile'] variable to remove the fields you don't want to allow. Then in various.tpl.php and edit the variable $templates['profile'] to remove them from the profile view.


Can I only comment out the fields I don't want in the tpl.php files the same way I would in phpBB or do I have to remove them?

Quote
For the BB Code, I think you will have to remove the code within sources/functions.php and remove the bb Code regex that you dont want


As far as the BBcode goes, no problem removing the regex for IMG and URL but will the buttons for these still be visible in the message editor menu?

Cheers,
Gene
:)
Moderator
Registered: Oct 2005
Posts: 447
Location: canada
Quote
Can I only comment out the fields I don't want in the tpl.php files the same way I would in phpBB or do I have to remove them?


With HTML comments yes, you should be able to with no problem.

Quote
As far as the BBcode goes, no problem removing the regex for IMG and URL but will the buttons for these still be visible in the message editor menu?


To remove it from the editor, you need to find the function get_bbcode_controls() in sources/functions.php. Just remove the sections of the array you don't need, such as deleting:


array('[img]', '[/img]', $lang['Img'], ''),
array('[url=http://www.example.com]', '[/url]', $lang['URL'], ''),
Member
Registered: Jun 2007
Posts: 122
Location: Gatineau, QC, Canada
Thanks Gaia, you've been a great help.
Similar to editing phpBB.

Cheers,
Gene
Member
Registered: Jun 2007
Posts: 122
Location: Gatineau, QC, Canada
Oh boy, ran into a problem. I commented out the fields I didn't want in the tpl's (real name, website and all the messenger ID's) and when I modified my own profile to include my birthday then pressed OK, I got the following error:

UseBB General Error

An error was encountered. We apologize for any inconvenience.

In file sources/panel_profile.php on line 182:

E_NOTICE - Undefined index: real_name


What's next?

Thanks,
Gene
Member
Registered: Jun 2007
Posts: 122
Location: Gatineau, QC, Canada
As far as BBcode goes, I commented out all of these:


// [img]image[/img]
// "#\[img\]([\w]+?://[\w\#\$%&~/\.\-;:=,\?@\[\]\+\\\\\'!\(\)\*]*?)\[/img\]#is" => '<img src="\\1" alt="'.$lang['UserPostedImage'].'" />',
// www.usebb.net
// "#([\s])(www\.[\w\#\$%&~/\.\-;:=,\?@\[\]\+\\\\\'!\(\)\*]*?)#is" => '\\1<a href="http://\\2" title="http://\\2"'.$rel.'>\\2</a>\\3',
// ftp.usebb.net
// "#([\s])(ftp\.[\w\#\$%&~/\.\-;:=,\?@\[\]\+\\\\\'!\(\)\*]*?)([\s])#is" => '\\1<a href="ftp://\\2" title="ftp://\\2"'.$rel.'>\\2</a>\\3',
// [url]http://www.usebb.net[/url]
// "#\[url\]([\w]+?://[\w\#\$%&~/\.\-;:=,\?@\[\]\+\\\\\'!\(\)\*]*?)\[/url\]#is" => '<a href="\\1" title="\\1"'.$rel.'>\\1</a>',
// [url=http://www.usebb.net]UseBB[/url]
// "#\[url=([\w]+?://[\w\#\$%&~/\.\-;:=,\?@\[\]\+\\\\\'!\(\)\*]*?)\](.*?)\[/url\]#is" => '<a href="\\1" title="\\1"'.$rel.'>\\2</a>',
// [mailto]somebody@nonexistent.com[/mailto]
// "#\[mailto\]([a-z0-9&\-_\.\+]+?@[\w\-]+\.([\w\-\.]+\.)?[\w]+)\[/mailto\]#is" => '<a href="mailto:\\1" title="\\1">\\1</a>',
// [mailto=somebody@nonexistent.com]mail me[/mailto]
// "#\[mailto=([a-z0-9&\-_\.\+]+?@[\w\-]+\.([\w\-\.]+\.)?[\w]+)\](.*?)\[/mailto\]#is" => '<a href="mailto:\\1" title="\\1">\\3</a>',


And still, if the user types in a link, it's still hot...

Mind you, I made the buttons go from the editor.

Cheers,
Gene
:(
« Last edit by Raygene on Sun Jun 24, 2007 2:05 am. »
Moderator
Registered: Oct 2005
Posts: 447
Location: canada
If you want, you can edit the panel_profile.php and remove all instances of that from the file, as well as from the database queries. But, it might be alittle easier, if you just add them as hidden fields with no values. That way, the parts of the script that are looking for each input field, are finding them.

So, in the fields you commented out, just uncomment the input fields and change their type to hidden

<input type="hidden" name="real_name" />

Or something similar. I haven't tested, but it should work.
Moderator
Registered: Oct 2005
Posts: 447
Location: canada
raygene wrote
As far as BBcode goes, I commented out all of these:

// [img]image[/img]
// "#[img]([w]+?://[w#$%&~/.-;:=,?@[]+\'!()*]*?)[/img]#is" => '<img src="" alt="'.$lang['UserPostedImage'].'" />',
// www.usebb.net
// "#([s])(www.[w#$%&~/.-;:=,?@[]+\'!()*]*?)#is" => '<a href="http://" title="http://"'.$rel.'></a>',
// ftp.usebb.net
// "#([s])(ftp.[w#$%&~/.-;:=,?@[]+\'!()*]*?)([s])#is" => '<a href="ftp://" title="ftp://"'.$rel.'></a>',
// [url]http://www.usebb.net[/url]
// "#[url]([w]+?://[w#$%&~/.-;:=,?@[]+\'!()*]*?)[/url]#is" => '<a href="" title=""'.$rel.'></a>',
// [url=http://www.usebb.net]UseBB[/url]
// "#[url=([w]+?://[w#$%&~/.-;:=,?@[]+\'!()*]*?)](.*?)[/url]#is" => '<a href="" title=""'.$rel.'></a>',
// [mailto]somebody@nonexistent.com[/mailto]
// "#[mailto]([a-z0-9&-_.+]+?@[w-]+.([w-.]+.)?[w]+)[/mailto]#is" => '<a href="mailto:" title=""></a>',
// [mailto=somebody@nonexistent.com]mail me[/mailto]
// "#[mailto=([a-z0-9&-_.+]+?@[w-]+.([w-.]+.)?[w]+)](.*?)[/mailto]#is" => '<a href="mailto:" title=""></a>',


And still, if the user types in a link, it's still hot...

Mind you, I made the buttons go from the editor.

Cheers,
Gene
:(


Try commenting out this block of code:


//
// Parse URL's and e-mail addresses enclosed in special characters
//
$ignore_chars = "^a-z0-9"; # warning, rawly included in regex!
$ignore_chars_url_end = "^a-z0-9/"; # to include trailing /
$string = preg_replace(array(
"#([\s][".$ignore_chars."]*?)([\w]+?://[\w\#\$%&~/\.\-;:=,\?@\[\]\+\\\\\'!\(\)\*]*?)([".$ignore_chars_url_end."]*?[\s])#is",
"#([\s][".$ignore_chars."]*?)(www\.[\w\#\$%&~/\.\-;:=,\?@\[\]\+\\\\\'!\(\)\*]*?)([".$ignore_chars_url_end."]*?[\s])#is",
"#([\s][".$ignore_chars."]*?)([a-z0-9&\-_\.\+]+?@[\w\-]+\.([\w\-\.]+\.)?[\w]+)([".$ignore_chars."]*?[\s])#is"
), array(
'\\1<a href="\\2" title="\\2"'.$rel.'>\\2</a>\\3',
'\\1<a href="http://\\2" title="http://\\2"'.$rel.'>\\2</a>\\3',
'\\1<a href="mailto:\\2" title="\\2">\\2</a>\\4'
), $string);
Member
Registered: Jun 2007
Posts: 122
Location: Gatineau, QC, Canada
LOL, you're quick!

Let me try and see what happens.

Thanks,
Gene
Moderator
Registered: Oct 2005
Posts: 447
Location: canada
<input type="hidden" name="real_name" value="" /> for the first part.

Heh, thanks ^_^.
Member
Registered: Jun 2007
Posts: 122
Location: Gatineau, QC, Canada
Gaia wrote
<input type="hidden" name="real_name" value="" /> for the first part.

Heh, thanks ^_^.


OK, changed "text" to "hidden" but didn't work, still getting that error message on line 182, mind you, I still have the whole line:

'real_name_input' => '<input type="hidden" size="50" maxlength="255" name="real_name" value="'.unhtml(stripslashes($user_info['real_name'])).'" />',

So, if I modify every line with what you suggested above, should work?

I know, I'm a pain... :lol:

Cheers,
Gene
Member
Registered: Jun 2007
Posts: 122
Location: Gatineau, QC, Canada
Quote
Try commenting out this block of code:


That worked great, no more hot links, thanks!

Gene
:P
Moderator
Registered: Oct 2005
Posts: 447
Location: canada
hmmm. And the same error is still saying that real_name is the undefined index?

Try changing the value to value="".

Quote
That worked great, no more hot links, thanks!

Gene
:P


No problem ^_^. One thing down, and one more to go :P.
Member
Registered: Jun 2007
Posts: 122
Location: Gatineau, QC, Canada
Oops, did the " thing and now I get:

Parse error: syntax error, unexpected T_STRING, expecting ')' in /home/gemigene/public_html/usebb/sources/panel_profile.php on line 325

LOL
Member
Registered: Jun 2007
Posts: 122
Location: Gatineau, QC, Canada
Example of what that line is:

'real_name_input' => '<input type="hidden" size="50" maxlength="255" name="real_name" value="".unhtml(stripslashes($user_info['real_name'])).'" />',
Moderator
Registered: Oct 2005
Posts: 447
Location: canada
Lol :P.

If your editor can do it, just undo it until you get back to the default.


'real_name_input' => '<input type="hidden" size="50" maxlength="255" name="real_name" value="'.unhtml(stripslashes($user_info['real_name'])).'" />',


Replace it with:


'real_name_input' => '<input type="hidden" size="50" maxlength="255" name="real_name" value="" />',


If you get any errors after that, copy and paste it here.
Member
Registered: Jun 2007
Posts: 122
Location: Gatineau, QC, Canada
Son of a gun, did that to every line that I wanted out and still got:

Quote
n file sources/panel_profile.php on line 182:

E_NOTICE - Undefined index: real_name


Line 182 and on are:

real_name     = '".$_POST['real_name']."',
location = '".$_POST['location']."',
website = '".$_POST['website']."',
occupation = '".$_POST['occupation']."',
interests = '".$_POST['interests']."',
signature = '".$_POST['signature']."',
birthday = '".$birthday."',
msnm = '".$_POST['msnm']."',
yahoom = '".$_POST['yahoom']."',
aim = '".$_POST['aim']."',
icq = '".$_POST['icq']."',
jabber = '".$_POST['jabber']."',
skype = '".$_POST['skype']."'


Great way to spend a Saturday night. LOL
Moderator
Registered: Oct 2005
Posts: 447
Location: canada
Lol. Well, I don't understand then. real_name is still being sent through the $_POST.

Try changing

real_name = '".$_POST['real_name']."',

To:

real_name = '',
Member
Registered: Jun 2007
Posts: 122
Location: Gatineau, QC, Canada
Why the heck not, hang on... LOL
Moderator
Registered: Oct 2005
Posts: 447
Location: canada
Looool. It's the last thing I can think of lol.
Member
Registered: Jun 2007
Posts: 122
Location: Gatineau, QC, Canada
:lol: :lol: :lol: :lol: :lol: :lol:

Great, that worked. Dunno why I had problems with this, I and a couple of friends modded a phpbb board into a dating site (still Alpha) with a sh**load of hardcoding (custom profiles, search function, latest registered members with a photo thumbnail, etc.).

http://www.matesjunction.com/mjfdatebb

Thanks a million!
Gene

BTW, how the heck did you get the paypal function on your board?
Moderator
Registered: Oct 2005
Posts: 447
Location: canada
Glad it worked ^_^.

You mean the paypal button? It's just generated code from paypal. I believe it is under Merchant Tools -> Donations.
Member
Registered: Jun 2007
Posts: 122
Location: Gatineau, QC, Canada
And about hotlinking, I can still do it as Admin using HTML...

Fantastic! Great little board!

BTW, downloaded a couple of MODs, I'll be installing Rules page, has it been tested?

Gracias Amigo
Andre
Member
Registered: Jun 2007
Posts: 122
Location: Gatineau, QC, Canada
Gaia wrote
Glad it worked ^_^.

You mean the paypal button? It's just generated code from paypal. I believe it is under Merchant Tools -> Donations.


Good stuff (Paypal)

Thanks to you, got everything working now... Time to go watch a movie with the GF.

Cheers,
Gene

Page: 1 2 >

UseBB Community » Resources & Customization » Disable fields and certain BBcodes?

UseBB Community is powered by UseBB 1 Forum Software