It doesn't work, it is a bug. I had to write a UDT to get around it in order for comments to be able to appear on any page not just the page they are posted on.
Call the UDT below with {testimonials num=3} num is obviously the number of comments you want to return and
Code: Select all
if(isset($params['num'])) {
$num = $params['num'];
}
$testimonial_resource = mysql_query("
SELECT author_name as author, data as quote from cms_module_cgfeedback_comments WHERE status='published' ORDER BY RAND() LIMIT $num
") or die(mysql_error());
while ($testimonial = mysql_fetch_assoc($testimonial_resource)) {
$i++;
$smarty->assign("test_quote$i",$testimonial['quote']);
$smarty->assign("test_author$i",$testimonial['author']);
#echo '<p>'.{$show|summarize:3}.'<br /><strong>'.$testimonial['author'].'</strong></p>';
}
then where you want it to appear e.g.
Code: Select all
<p class="quote">{$test_quote1|summarize:25}</p>
<p class="author">{$test_author1}</p>
<p class="quote">{$test_quote2|summarize:25}</p>
<p class="author">{$test_author2}</p>
or use this where you do all the formatting in the UDT
Code: Select all
if(isset($params['num'])) {
$num = $params['num'];
}
$numwords = 25;
$testimonial_resource = mysql_query("
SELECT author_name as author, data as quote from cms_module_cgfeedback_comments WHERE status='published' ORDER BY RAND() LIMIT $num
") or die(mysql_error());
while ($testimonial = mysql_fetch_assoc($testimonial_resource)) {
preg_match("/(\S+\s*){0,$numwords}/", $testimonial['quote'], $regs);
$shortdesc = trim($regs[0]);
echo '<p>'.$shortdesc.'...<br /><strong>'.$testimonial['author'].'</strong></p>';
}