Jump to content

BBCode in Comments


Graeme S.

Recommended Posts

Posted

It's deliberately not done. The idea of profile comments was to be as simple as possible so as to not detract users from the actual forums.

  • 11 months later...
Posted

It's deliberately not done. The idea of profile comments was to be as simple as possible so as to not detract users from the actual forums.



How would allowing smilies in the guestbook, detract from the forums? That answer really doesn't make any sense at all. You're basically saying, users will now use the forum more, because they can't post smilies in the guestbook. Urghhh OK.

I think the answer is more likely due to the fact that while searching for inspiration for the comments system, you decided Facebook was the site to model but rather than just taking their best bits, you copied it almost exactly. Bad move IMO.
Posted

Well, while I didn't work here when the feature was added, the suggestion we got was probably "you should add profile comments, like Facebook!" so probably yes ;)

It's a really simple change though, leave it with me and I'll post some instructions later :)

Posted

admin/applications/members/sources/classes/comments.php

Find:

$comment = IPSText::truncate( $comment, 400 ); $comment = preg_replace( "#(\r\n|\r|\n|<br />|<br>){1,}#s", "\n", $comment ); $comment = trim( IPSText::getTextClass('bbcode')->stripBadWords( $comment ) );







Replace with:

IPSText::getTextClass('bbcode')->parse_html = 0; IPSText::getTextClass('bbcode')->parse_nl2br = 1; IPSText::getTextClass('bbcode')->parse_smilies = 1; IPSText::getTextClass('bbcode')->parse_bbcode = 1; $comment = IPSText::getTextClass('bbcode')->preDbParse( IPSText::truncate( $comment, 400 ) );










Find:

$comments[] = $row;





Add above:

IPSText::getTextClass('bbcode')->parse_html = 0; IPSText::getTextClass('bbcode')->parse_nl2br = 1; IPSText::getTextClass('bbcode')->parse_bbcode = 1; IPSText::getTextClass('bbcode')->parse_smilies = 1; IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $row['member_group_id']; IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $row['mgroup_others']; $row['comment'] = IPSText::getTextClass('bbcode')->preDisplayParse( $row['comment'] );









Posted

Facebook wasn't quite as big and popular as it is now when that feature was added. I don't think Facebook provided any real inspiration for the profile comments feature. We simply wanted a "light weight" parser there instead of full-on parsing of every tag. In fact, at first, no parsing was done, but people requested we add at least b/i/u support, so we did.

Posted

admin/applications/members/sources/classes/comments.php



Find:



		$comment = IPSText::truncate( $comment, 400 );

		$comment = preg_replace( "#(\r\n|\r|\n|<br />|<br>){1,}#s", "\n", $comment );

		$comment = trim( IPSText::getTextClass('bbcode')->stripBadWords( $comment ) );

Replace with:


		IPSText::getTextClass('bbcode')->parse_html		= 0;

		IPSText::getTextClass('bbcode')->parse_nl2br	= 1;

		IPSText::getTextClass('bbcode')->parse_smilies	= 1;

		IPSText::getTextClass('bbcode')->parse_bbcode	= 1;

		$comment = IPSText::getTextClass('bbcode')->preDbParse( IPSText::truncate( $comment, 400 ) );

Find:


$comments[] = $row;

Add above:


			IPSText::getTextClass('bbcode')->parse_html 				= 0;

			IPSText::getTextClass('bbcode')->parse_nl2br				= 1;

			IPSText::getTextClass('bbcode')->parse_bbcode				= 1;

			IPSText::getTextClass('bbcode')->parse_smilies				= 1;

			IPSText::getTextClass( 'bbcode' )->parsing_mgroup			= $row['member_group_id'];

			IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others	= $row['mgroup_others'];

			$row['comment']	= IPSText::getTextClass('bbcode')->preDisplayParse( $row['comment'] );




Thanks for this. I had already modded my IPB to do this - I was just pushing for a setting, so we don't have to modify the IPB source code in the future :P
Posted

correct me wrong but isnt the correct path: admin/applications/members/sources/comments.php (er minus the classes)

i asked mark why i coudln't find it in admin/applications/members/sources/classes/comments.php, ergo the new path...:thumbsup:

Posted

admin/applications/members/sources/classes/comments.php



Find:



		$comment = IPSText::truncate( $comment, 400 );

		$comment = preg_replace( "#(\r\n|\r|\n|<br />|<br>){1,}#s", "\n", $comment );

		$comment = trim( IPSText::getTextClass('bbcode')->stripBadWords( $comment ) );

Replace with:


		IPSText::getTextClass('bbcode')->parse_html		= 0;

		IPSText::getTextClass('bbcode')->parse_nl2br	= 1;

		IPSText::getTextClass('bbcode')->parse_smilies	= 1;

		IPSText::getTextClass('bbcode')->parse_bbcode	= 1;

		$comment = IPSText::getTextClass('bbcode')->preDbParse( IPSText::truncate( $comment, 400 ) );

Find:


$comments[] = $row;

Add above:


			IPSText::getTextClass('bbcode')->parse_html 				= 0;

			IPSText::getTextClass('bbcode')->parse_nl2br				= 1;

			IPSText::getTextClass('bbcode')->parse_bbcode				= 1;

			IPSText::getTextClass('bbcode')->parse_smilies				= 1;

			IPSText::getTextClass( 'bbcode' )->parsing_mgroup			= $row['member_group_id'];

			IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others	= $row['mgroup_others'];

			$row['comment']	= IPSText::getTextClass('bbcode')->preDisplayParse( $row['comment'] );

I'm currently using this code, however BBCode parsing doesn't work (urls, images, etc). Even though parse_bbcode is set to 1, it has no effect. I double checked the DB and its definitely not getting parsed. it simply shows up as text, like:

[/img]


[img]		



and doesn't parse it at all. Turning off parse_smilies, however, stops smilies from parsing, as it should. I just can't get it to parse BBCode. Any suggestions?

Posted

Still not managed to figure this out. Opened a ticket to support and apparently they can't assist because it's a none standard feature.

Members are complaining daily, as it was a massively used feature.

Posted

Sorry I missed this :)

There is an error in the second edit I posted, it should be:

IPSText::getTextClass('bbcode')->parse_html = 0; IPSText::getTextClass('bbcode')->parse_nl2br = 1; IPSText::getTextClass('bbcode')->parse_bbcode = 1; IPSText::getTextClass('bbcode')->parse_smilies = 1; IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $row['member_group_id']; IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $row['mgroup_others']; $row['comment_content'] = IPSText::getTextClass('bbcode')->preDisplayParse( $row['comment_content'] );




  • 2 weeks later...
Guest CallieJo
Posted

Thanks for this. Not parsing images and smilies in the profile comments was a big dent in our move from vb. Especially when it left a mess of bbcode in the comments from the import. Now all is great thanks to the help in this thread. Thanks!

  • 3 months later...
Posted

Some forums are pretty wild and likely would want an option for this. I would not use it myself and I understand why it is the way it is.

Posted

A number of members asked for this. I don't think it will detract from the actual forums. If anything, the PM system already plays that role. :P

Thanks Mark!

  • 2 months later...
Posted

My users are so so so happy with their colored profiles ;) :blink: Now they asked about the possibility to delete their comments in other profiles. Is this technically feasible?

  • 1 year later...

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...