No comments in sidebar

Register an Account
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 08-10-2007, 05:36 AM
grimusm's Avatar
Casual Pligger
Pligg Version: 9.7
Pligg Template: custom
 
Join Date: Aug 2007
Posts: 51
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.

Last edited by grimusm; 08-11-2007 at 08:25 PM.
Reply With Quote
  #2 (permalink)  
Old 08-11-2007, 08:26 PM
grimusm's Avatar
Casual Pligger
Pligg Version: 9.7
Pligg Template: custom
 
Join Date: Aug 2007
Posts: 51
Anyone can help?
Reply With Quote
  #3 (permalink)  
Old 08-11-2007, 08:36 PM
Pligg Developer/Admin
Pligg Version: 0
Pligg Template: none
 
Join Date: Jun 2006
Location: Muncie, Indiana
Posts: 3,215
Need a link to your site.
Reply With Quote
  #4 (permalink)  
Old 02-11-2008, 07:38 AM
longcountdown's Avatar
Pligg Donor
Pligg Version: 9.8.2
Pligg Template: moderno-orange
 
Join Date: Nov 2007
Location: Japan
Posts: 75
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.
Reply With Quote
  #5 (permalink)  
Old 02-11-2008, 07:55 AM
longcountdown's Avatar
Pligg Donor
Pligg Version: 9.8.2
Pligg Template: moderno-orange
 
Join Date: Nov 2007
Location: Japan
Posts: 75
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?
Reply With Quote
  #6 (permalink)  
Old 02-11-2008, 08:08 AM
longcountdown's Avatar
Pligg Donor
Pligg Version: 9.8.2
Pligg Template: moderno-orange
 
Join Date: Nov 2007
Location: Japan
Posts: 75
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.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Latest Comments in Sidebar revolver Questions and Comments 23 12-01-2009 02:55 AM
Lemontwist - new last comments sidebar jmruas Questions and Comments 0 11-16-2008 12:35 PM
Beta 9.9.5- Bug in Categories & Latest comments sidebar modules kallu Questions and Comments 3 08-07-2008 08:28 AM
Sidebar Comments + $title_short DailyResearch Questions and Comments 4 01-02-2008 11:41 AM
Problem with comments in sidebar grimusm Questions and Comments 0 01-01-2008 09:11 AM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development