Results 1 to 6 of 6
  1. #1
    Casual Pligger grimusm's Avatar
    Joined
    Aug 2007
    Posts
    51
    Thanks
    Received:0
    Given: 0

    Comments not showing properly in sidebar

    Using 9.7 and my site and stories are all in simplified chinese.

    Comments have been added, but the sidebar comments is just showing the ... with the link. The comment (which is written in chinese) is not displayed.

    Any help would be greatly appreciated.

  2. #2
    Casual Pligger grimusm's Avatar
    Joined
    Aug 2007
    Posts
    51
    Thanks
    Received:0
    Given: 0
    Anyone can help?

  3. #3
    Pligg Developer/Admin kbeeveer46's Avatar
    Joined
    Jun 2006
    Posts
    3,215
    Thanks
    Received:1
    Given: 0
    Need a link to your site.

  4. #4
    Pligg Donor longcountdown's Avatar
    Joined
    Nov 2007
    Posts
    75
    Thanks
    Received:0
    Given: 0
    Same here but for Japanese. Comments show up on story page and even on the /comments page, but not in the sidebar latest comments box. Just leaves the "..." which links to the story.

    My site is JapanSoc.com but only one recent comment has been in Japanese.

  5. #5
    Pligg Donor longcountdown's Avatar
    Joined
    Nov 2007
    Posts
    75
    Thanks
    Received:0
    Given: 0
    The problem is the ShortenText function in /sidebar_comments.php

    Code:
    // determine the amount of characters to show for each comment	
    function ShortenText($text) {
    	$chars = comments_length_sidebar;
    
      $text = $text." ";
      $text = substr($text,0,$chars);
      $text = substr($text,0,strrpos($text,' '));
      $text = $text."...";
    
      return $text;
      }		
    	
    ?>
    By commenting out the $text lines, the Japanese shows up in the sidebar, but the comments still need to be shortened. Any ideas?

  6. #6
    Pligg Donor longcountdown's Avatar
    Joined
    Nov 2007
    Posts
    75
    Thanks
    Received:0
    Given: 0

    Solution for broken Japanese/Chinese in sidebar comments

    Fixed it!

    In the ShortenText function in /sidebar_comments.php, change:

    Code:
    $text = $text." ";
      $text = substr($text,0,$chars);
      $text = substr($text,0,strrpos($text,' '));
      $text = $text."...";
    to:

    Code:
    $text = $text." ";
      $text = mb_substr($text,0,$chars);
      $text = mb_substr($text,0,strrpos($text,' '));
      $text = $text."...";
    The mb means multi-byte and works with UTF-8 (international) encoding.

Similar Threads

  1. Latest Comments in Sidebar
    By revolver in forum Questions & Comments
    Replies: 23
    Last Post: 11-30-2009, 10:55 PM
  2. how to move the sidebar comments out of the sidebar?
    By alphachu in forum Questions & Comments
    Replies: 4
    Last Post: 10-23-2009, 09:02 AM
  3. Lemontwist - new last comments sidebar
    By jmruas in forum Questions & Comments
    Replies: 0
    Last Post: 11-16-2008, 08:35 AM
  4. Avatars next to comments in sidebar
    By grimusm in forum Questions & Comments
    Replies: 6
    Last Post: 07-15-2008, 07:42 PM
  5. Problem with comments in sidebar
    By grimusm in forum Questions & Comments
    Replies: 0
    Last Post: 01-01-2008, 05:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Pligg Modules and Pligg Templates from Pligg Pro Web Hosting Services by Midphase Dreamhost Web Hosting Donate to Pligg