CGFeedback Line feed / Break

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
Decorsign
Forum Members
Forum Members
Posts: 17
Joined: Mon Feb 09, 2009 8:37 pm

CGFeedback Line feed / Break

Post by Decorsign »

I've read some topics regarding line feeds in the cgfeedback module. In my case it's without succes till so far.

I would like linefeeds to be visible when comments are placed.
I have tried changing the action.summary.php file with nl2br but without succes.
Any ideas on this topic?

I use CMSMS 1.9.2 and CGFeedback 1.3.2
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: CGFeedback Line feed / Break

Post by Dr.CSS »

Can you explain a little more about what you mean by linefeeds?...

Never heard of this before...
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: CGFeedback Line feed / Break

Post by Wishbone »

linefeeds is the same as newlines, '\n', etc. He wants to replace them with '<br />'

You shouldn't have to change the code. Edit your summary template in the admin panel for CGFeedback.

Change:

Code: Select all

<div class="feedback_item_data">
  {$one.data|htmlspecialchars}
</div>
to:

Code: Select all

<div class="feedback_item_data">
  {$one.data|htmlspecialchars|nlbr}
</div>
I think that's the variable that deals with the actual comment. If it's not $one.data, you'll have to put test data in various points of the summary template to figure out where to place the modifier.

The reason that editing the php file didn't work is because you're trying to inject HTML into the output. As you see in the template above, it's filtering it out with '|htmlspecialchars'. We're then taking the newline and converting it to <br /> after filtering out other html. You'll have to remove your hack, or there will be no newlines to convert ;)
Decorsign
Forum Members
Forum Members
Posts: 17
Joined: Mon Feb 09, 2009 8:37 pm

Re: CGFeedback Line feed / Break

Post by Decorsign »

Hi Guys,

That's exactly what i mean. It works like a charm now!
Did you know that IE9 does not show the "Save" "Submit" and "Cancel" buttons on te top and bottom of a page in the back-office in 1.9.2 ?
Strange...

Greetz Geert
janvl
Power Poster
Power Poster
Posts: 972
Joined: Wed Aug 13, 2008 10:57 am

Re: CGFeedback Line feed / Break

Post by janvl »

I tried this solution in 1.10.3 but I have no linefeeds and after adding "|nlbr" I get a smarty-error stating this is not implemented.

string(149) "Smarty error: [in module_db_tpl:CGFeedback;summary_mysample01 line 33]: [plugin] modifier 'nlbr' is not implemented (core.load_plugins.php, line 198)" /is/htdocs/wp10625670_ZMV58VEOJD/www5/lib/smarty/Smarty.class.php:1819 - trigger_error


What to do?

Kind regards,
Jan
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: CGFeedback Line feed / Break

Post by Dr.CSS »

janvl
Power Poster
Power Poster
Posts: 972
Joined: Wed Aug 13, 2008 10:57 am

Re: CGFeedback Line feed / Break

Post by janvl »

Hi,

Sorry I did not edit the post because I found that I forgot the "2".
I could not find this peticular post to edit it.

It is working now like I wanted it to work.

In CGFeedback, I do not allow html and no editor with nl2br it works like the old Comments module. Maybe the old module should be marked as "overdue" with a link to cgfeedback because in 1.10.3 Comments will not work.

Kind regards,
Jan
Post Reply

Return to “Modules/Add-Ons”