This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

Respect Enter button
#1
Lightbulb 

Hi, guys, problem is comments box.
When typing a text and push "enter" button on keyboard for line or paragraph break, text displayed in one line. Please help fix this problem.

Thank you.
Huh
Reply
#2

Hi,

Have you disabled the 'Line Breaks' setting in Settings -> Processing -> Comment?

Have you completed the interview?
Reply
#3

check box ticked


Attached Files Thumbnail(s)
   
Reply
#4

Okay, what is the web address of your page?

Have you completed the interview?
Reply
#5

(05-Aug-2011, 08:00 PM)Steven Wrote:  Okay, what is the web address of your page?

[carclassed[.]com]
Reply
#6

Ok I see the problem on your webpage.

For some reason there are no line breaks (<br/> or <p/>) appearing in the source code, so there's something going wrong when it processes the comment.

The first step is to check comments/includes/app/processor.php, line 311:
PHP Code:
<?php 
$comment
= cmtx_comment_add_breaks($comment); //add line breaks (<br /> and <p />)

Then check comments/includes/functions/processor.php, lines 1035- 1045:
PHP Code:
<?php 
function cmtx_comment_add_breaks ($comment) { //add line breaks

$comment = preg_replace('/(?:(?:\r\n)|\r|\n){3,}/', "<p style='margin-top: 8px; margin-bottom: 0px;'/>", $comment); //replace instances of 2 or more \r\n with just 1 <p />

$comment = preg_replace('/(?:(?:\<br \/\>)|\<br \/\>){3,}/', "<p style='margin-top: 8px; margin-bottom: 0px;'/>", $comment); //replace instances of 2 or more <br />s with just 1 <p />

$comment = str_ireplace("\r\n", "<br />", $comment); //replace remaining line breaks with <br />s

return $comment; //return breaked string

} //end of comment-add-breaks function

Make sure the code is the same as above.

Another thing is to try this FAQ:
http://www.commentics.org/support/knowle...article=15

Have you completed the interview?
Reply
#7

(05-Aug-2011, 08:50 PM)Steven Wrote:  Ok I see the problem on your webpage.

For some reason there are no line breaks (<br/> or <p/>) appearing in the source code, so there's something going wrong when it processes the comment.

The first step is to check comments/includes/app/processor.php, line 311:
PHP Code:
<?php 
$comment
= cmtx_comment_add_breaks($comment); //add line breaks (<br /> and <p />)

Then check comments/includes/functions/processor.php, lines 1035- 1045:
PHP Code:
<?php 
function cmtx_comment_add_breaks ($comment) { //add line breaks

$comment = preg_replace('/(?:(?:\r\n)|\r|\n){3,}/', "<p style='margin-top: 8px; margin-bottom: 0px;'/>", $comment); //replace instances of 2 or more \r\n with just 1 <p />

$comment = preg_replace('/(?:(?:\<br \/\>)|\<br \/\>){3,}/', "<p style='margin-top: 8px; margin-bottom: 0px;'/>", $comment); //replace instances of 2 or more <br />s with just 1 <p />

$comment = str_ireplace("\r\n", "<br />", $comment); //replace remaining line breaks with <br />s

return $comment; //return breaked string

} //end of comment-add-breaks function

Make sure the code is the same as above.

Another thing is to try this FAQ:
http://www.commentics.org/support/knowle...article=15
reinstall commentics fro scratch but same result?!
Reply
#8

Have you tried testing it on the example.php page which is included in the zip download?

Doing this may rule out that the problem is to do with your web page.

Have you completed the interview?
Reply
#9

(05-Aug-2011, 09:26 PM)Steven Wrote:  Have you tried testing it on the example.php page which is included in the zip download?

Doing this may rule out that the problem is to do with your web page.

check it [http://www.carclassed[.]com/example.php]
(05-Aug-2011, 09:34 PM)arthur1 Wrote:  
(05-Aug-2011, 09:26 PM)Steven Wrote:  Have you tried testing it on the example.php page which is included in the zip download?

Doing this may rule out that the problem is to do with your web page.

check it [http://www.carclassed[.]com/example.php]

not problem with my page.
this is what i have in admin page under manage comments:

this is a test<p style='margin-top: 8px; margin-bottom: 0px;'/>this is a test<p style='margin-top: 8px; margin-bottom: 0px;'/>this is a test
Reply
#10

Steven, in my contact form script using this:

$headers .= "MIME-Version: 1.0\r\n";
$headers .= "X-Priority: 3\r\n";
$headers .= "X-MSMail-Priority: Normal\r\n";
$headers .= "Content-type: text/plain; charset=\"iso-8859-1\"\r\n";
$headers .= "Date: ".date("m j")."\r\n";
$headers .= "From: ".$yourName." <$mailFrom>\r\n";
if($yourName && $mailFrom) {
$send = mail(_adminemail, _Dsubject.$subject, stripslashes($message), $headers);

and i think this is a problem, so please tell me how to define script like shown above in your script?

Thank you.
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by CarlyJ
13-Dec-2011, 07:35 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)