zencart dgreviews ,评论显示在产品下方

<?php // dgReviews v 1.01 //Modified to work with version v1.3.6 of the dgcart // This is a quick down and dirty mod to add product reviews onto the product info page // by MichaelDuvall.com // Modified by Anne (Picaflor-Azul.com) for Winchester Responisve v. 1.0 ?>
<!-- bof: dgReviews--> 
<?php //change this constant to change the title for the customer reviews $review_title = 'Customer Reviews';

$review_status = " and r.status = ‘1’";
/* This is where you change the parameter value to output 1000 charaters or equivelent */
r e v i e w s q u e r y r a w = &quot; s e l e c t r . r e v i e w s i d , l e f t ( r d . r e v i e w s t e x t , 1000 ) a s r e v i e w s t e x t , r . r e v i e w s r a t i n g , r . d a t e a d d e d , r . c u s t o m e r s n a m e f r o m &quot; . T A B L E R E V I E W S . &quot; r , &quot; . T A B L E R E V I E W S D E S C R I P T I O N . &quot; r d w h e r e r . p r o d u c t s i d = ′ &quot; . ( i n t ) reviews_query_raw = &quot;select r.reviews_id, left(rd.reviews_text, 1000) as reviews_text, r.reviews_rating, r.date_added, r.customers_name from &quot; . TABLE_REVIEWS . &quot; r, &quot; . TABLE_REVIEWS_DESCRIPTION . &quot; rd where r.products_id = &#x27;&quot; . (int) reviewsqueryraw="selectr.reviewsid,left(rd.reviewstext,1000)asreviewstext,r.reviewsrating,r.dateadded,r.customersnamefrom".TABLEREVIEWS."r,".TABLEREVIEWSDESCRIPTION."rdwherer.productsid=".(int)_GET[‘products_id’] . “’
and r.reviews_id = rd.reviews_id
and rd.languages_id = '” . (int)$_SESSION[‘languages_id’] . “’” .
$review_status . "
order by r.reviews_id desc";

r e v i e w s s p l i t = n e w s p l i t P a g e R e s u l t s ( reviews_split = new splitPageResults( reviewssplit=newsplitPageResults(reviews_query_raw, MAX_DISPLAY_NEW_REVIEWS);

if ($reviews_split->number_of_rows > 0) {
if ((PREV_NEXT_BAR_LOCATION == ‘1’) || (PREV_NEXT_BAR_LOCATION == ‘3’)) {
?>

<?php if ($reviews->fields['count'] > 0) { } ?>
<?php echo TEXT_RESULT_PAGE . ' ' . $reviews_split->display_links(MAX_DISPLAY_PAGE_LINKS, zen_get_all_get_params(array('page', 'info', 'main_page'))); ?>

<?php }
$reviews = $db->Execute($reviews_split->sql_query); 

while (!$reviews->EOF) { 

?>

<?php // change the class name here to reflect your CSS page ?>
<?php echo sprintf(zen_date_short($reviews->fields['date_added'])); ?>
<?php echo sprintf(zen_output_string_protected($reviews->fields['customers_name'])); ?>
<?php echo sprintf(zen_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $reviews->fields['reviews_rating'] . '.gif', sprintf(TEXT_OF_5_STARS, $reviews->fields['reviews_rating'])), sprintf(TEXT_OF_5_STARS, $reviews->fields['reviews_rating'])) . '

' . zen_break_string(zen_output_string_protected(stripslashes($reviews->fields['reviews_text'])), 35, ''); ?>

<?php $reviews->MoveNext(); } ?> <?php } else { echo TEXT_FIRST_REVIEW . ' <?php echo '
<div class="navSplitPagesResult"><?php echo $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS); ?></div> 

<?php echo TEXT_RESULT_PAGE . ' ' . $reviews_split->display_links(MAX_DISPLAY_PAGE_LINKS, zen_get_all_get_params(array('page', 'info', 'main_page'))); ?>
<?php } ?> <?php //this is the end of dgReview?>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值