Graeme S. Posted May 15, 2009 Posted May 15, 2009 Would it be possible to get BBCodes parsed in comments? Basically I want people to be able to have emoticons in profile comments. :)
Mark Posted May 15, 2009 Posted May 15, 2009 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.
Graeme S. Posted May 15, 2009 Author Posted May 15, 2009 So we can't get them to parse emoticons only? Cheers for the response.
Management Matt Posted May 15, 2009 Management Posted May 15, 2009 You could with a modification (hook, etc).
realmaverickuk Posted April 26, 2010 Posted April 26, 2010 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.
Mark Posted April 26, 2010 Posted April 26, 2010 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 :)
Mark Posted April 26, 2010 Posted April 26, 2010 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'] );
Jaggi Posted April 26, 2010 Posted April 26, 2010 :o thats secret ipb code!!! /me puts a blanked over the post.
bfarber Posted April 26, 2010 Posted April 26, 2010 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.
realmaverickuk Posted April 29, 2010 Posted April 29, 2010 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
InvisionNutCase Posted April 29, 2010 Posted April 29, 2010 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:
realmaverickuk Posted May 5, 2010 Posted May 5, 2010 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?
realmaverickuk Posted May 10, 2010 Posted May 10, 2010 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.
Mark Posted May 10, 2010 Posted May 10, 2010 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'] );
realmaverickuk Posted May 10, 2010 Posted May 10, 2010 Hi Mark, That worked perfectly. You've just made a lot of people very happy, including me, as I'll not have to deal with nagging members anymore :D Thanks very much, Paul
Guest CallieJo Posted May 19, 2010 Posted May 19, 2010 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!
Claudia999 Posted August 28, 2010 Posted August 28, 2010 It doesn't work for me. Is there a new code for 3.1.2?
Jυra Posted August 29, 2010 Posted August 29, 2010 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.
TCWT Posted August 29, 2010 Posted August 29, 2010 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!
Arun Kumar Posted August 30, 2010 Posted August 30, 2010 Would it be possible to make a similar modification to show emoticon images in Recent Status Updates bar?
Claudia999 Posted November 24, 2010 Posted November 24, 2010 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?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.