Line break Issue

Having problems with NicEdit? Post here for support

Line break Issue

Postby Marco » Sat Jan 12, 2008 8:33 am

this is a random occurring issue and as everyone I talked to has no real clue on what is going on I'll try to explain it:

I added NicEdit to my Wordpress Blog (as did a few of my friends) and every now and then the line breaks are not submitted.
One comment shows up like you styled it with breaks before hitting submit, the next won't.

I'm not sure, but I'd guess that one of ten comments has this issue. It has nothing to do with the browser being used as it is really random on when it happens.
Marco
 
Posts: 34
Joined: Fri Jan 11, 2008 12:00 pm
Location: Germany

Re: Line break Issue

Postby ihsan » Sat Jan 12, 2008 1:20 pm

hello marco your problem is about html codes.

wp strip html codes at comments.

that have solution but it will make security hole.

if you want i will explain how to disable html check in comments.
ihsan
 
Posts: 15
Joined: Thu Jan 10, 2008 9:54 am
Location: Turkey

Re: Line break Issue

Postby Marco » Sat Jan 12, 2008 1:28 pm

I guess I'm not the only wordpress user having that issue...and the funny thing is that it does work properly most of the time.

I don't know if there is any kind of fix possible, but feel free to tell me about removing the html check. Maybe I use it as walkaround.
Marco
 
Posts: 34
Joined: Fri Jan 11, 2008 12:00 pm
Location: Germany

Re: Line break Issue

Postby ihsan » Sat Jan 12, 2008 1:39 pm

i didnt look last version of wp when i wrote my comment.
it is not wp problem, maybe theme problem. when i test last version of wp 1min ago. i didnt see that problem at my localhost.

may you add your comment.php of your template?
ihsan
 
Posts: 15
Joined: Thu Jan 10, 2008 9:54 am
Location: Turkey

Re: Line break Issue

Postby Marco » Sat Jan 12, 2008 2:11 pm

if it is an issue generated by the template then there are many templates out there which also have the issue...

the code of my comments.php

Code: Select all
<?php // Do not delete these lines
   if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
      die ('Please do not load this page directly. Thanks!');

   if (!empty($post->post_password)) { // if there's a password
      if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) {  // and it doesn't match the cookie
         ?>

         <p class="nocomments">This post is password protected. Enter the password to view comments.</p>

         <?php
         return;
      }
   }

   /* This variable is for alternating comment background */
   $oddcomment = 'class="alt" ';
?>

<!-- You can start editing here. -->

<?php if ($comments) : ?>
   <h3 id="comments"><?php comments_number('No Responses', 'One Response', '% Responses' );?> to &#8220;<?php the_title(); ?>&#8221;</h3>

   <ol class="commentlist">

   <?php foreach ($comments as $comment) : ?>
   
   <?php
      $PostAuthor = false;
      switch ($comment->comment_author_email)
      {
         case get_the_author_email():
                              $PostAuthor = true;
                              break;
         case 'marco@ruelicke.net':
                              $PostAuthor = true;
                              break;
         default:
                              $PostAuthor = false;
                              break;
      }
   ?>

      <li <?php if($PostAuthor) {echo 'class="authorcomment" ';} else {echo $oddcomment;} ?>id="comment-<?php comment_ID() ?>">
         <cite><?php comment_author_link() ?></cite> Says:
         <?php if ($comment->comment_approved == '0') : ?>
         <em>Your comment is awaiting moderation.</em>
         <?php endif; ?>
         <br />

         <small class="commentmetadata"><a href="#comment-<?php comment_ID() ?>" title=""><?php comment_date('F jS, Y') ?> at <?php comment_time() ?></a> <?php edit_comment_link('edit','&nbsp;&nbsp;',''); ?></small>

         <?php comment_text() ?>

      </li>

   <?php
      /* Changes every other comment to a different class */
      $oddcomment = ( empty( $oddcomment ) ) ? 'class="alt" ' : '';
   ?>

   <?php endforeach; /* end for each comment */ ?>

   </ol>

<?php else : // this is displayed if there are no comments so far ?>

   <?php if ('open' == $post->comment_status) : ?>
      <!-- If comments are open, but there are no comments. -->

    <?php else : // comments are closed ?>
      <!-- If comments are closed. -->
      <p class="nocomments">Comments are closed.</p>

   <?php endif; ?>
<?php endif; ?>


<?php if ('open' == $post->comment_status) : ?>



<?php if ( get_option('comment_registration') && !$user_ID ) : ?>
<p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>">logged in</a> to post a comment.</p>
<?php else : ?>

<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
<h3 id="respond">Leave a Reply</h3>
<?php if ( $user_ID ) : ?>

<p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="Log out of this account">Logout &raquo;</a></p>

<?php else : ?>

<p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" />
<label for="author"><small>Name <?php if ($req) echo "(required)"; ?></small></label></p>

<p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" />
<label for="email"><small>Mail (will not be published) <?php if ($req) echo "(required)"; ?></small></label></p>

<p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
<label for="url"><small>Website (We <strong>DoFollow</strong>)</small></label></p>

<?php endif; ?>

<?php do_action('secure_image', $post->ID); ?>

<!--<p><small><strong>XHTML:</strong> You can use these tags: <code><?php echo allowed_tags(); ?></code></small></p>-->
<p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p>

<p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
</p>
<p><?php do_action('comment_form', $post->ID); ?></p>

</form>

<?php endif; // If registration required and not logged in ?>

<?php endif; // if you delete this the sky will fall on your head ?>
Marco
 
Posts: 34
Joined: Fri Jan 11, 2008 12:00 pm
Location: Germany

Re: Line break Issue

Postby ihsan » Sat Jan 12, 2008 2:29 pm

i didnt see any problem at comments.php

today i try to find solution.

if i find it i will write it there
Last edited by ihsan on Mon Jan 14, 2008 5:31 pm, edited 1 time in total.
ihsan
 
Posts: 15
Joined: Thu Jan 10, 2008 9:54 am
Location: Turkey

Re: Line break Issue

Postby ihsan » Mon Jan 14, 2008 5:30 pm

open wp-includes/kses.php

find:
Code: Select all
//   'br' => array(),


uncomment it: (remove //)
Code: Select all
'br' => array(),
ihsan
 
Posts: 15
Joined: Thu Jan 10, 2008 9:54 am
Location: Turkey

Re: Line break Issue

Postby Marco » Sun Jan 27, 2008 2:22 pm

sorry for the very late reply (and the resulting big bump) but I finally got the time to apply the fix.


the fix is working and with your permission I will write an article on my blog to share the fix as I know many of my blogging friends use NicEdit but don't use the forum here.
Marco
 
Posts: 34
Joined: Fri Jan 11, 2008 12:00 pm
Location: Germany

Re: Line break Issue

Postby Marco » Tue Feb 12, 2008 10:56 am

once again sorry for the bump and a double post... but I just want to inform you that I wrote said article on my blog:

NicEdit Linebreak Issue - How to fix it

Feel free to leave me a comment when you stop by :)
Marco
 
Posts: 34
Joined: Fri Jan 11, 2008 12:00 pm
Location: Germany


Return to Technical Problems/Support

Who is online

Users browsing this forum: No registered users and 2 guests

cron