• <small id='nwSGL'></small><noframes id='nwSGL'>

    <i id='nwSGL'><tr id='nwSGL'><dt id='nwSGL'><q id='nwSGL'><span id='nwSGL'><b id='nwSGL'><form id='nwSGL'><ins id='nwSGL'></ins><ul id='nwSGL'></ul><sub id='nwSGL'></sub></form><legend id='nwSGL'></legend><bdo id='nwSGL'><pre id='nwSGL'><center id='nwSGL'></center></pre></bdo></b><th id='nwSGL'></th></span></q></dt></tr></i><div id='nwSGL'><tfoot id='nwSGL'></tfoot><dl id='nwSGL'><fieldset id='nwSGL'></fieldset></dl></div>

        <bdo id='nwSGL'></bdo><ul id='nwSGL'></ul>
    1. <tfoot id='nwSGL'></tfoot>
    2. <legend id='nwSGL'><style id='nwSGL'><dir id='nwSGL'><q id='nwSGL'></q></dir></style></legend>

      1. K2_content 模块评分

        K2_content module rating(K2_content 模块评分)

          • <small id='V8q5m'></small><noframes id='V8q5m'>

                  <tbody id='V8q5m'></tbody>

                <tfoot id='V8q5m'></tfoot>
                <legend id='V8q5m'><style id='V8q5m'><dir id='V8q5m'><q id='V8q5m'></q></dir></style></legend>
              • <i id='V8q5m'><tr id='V8q5m'><dt id='V8q5m'><q id='V8q5m'><span id='V8q5m'><b id='V8q5m'><form id='V8q5m'><ins id='V8q5m'></ins><ul id='V8q5m'></ul><sub id='V8q5m'></sub></form><legend id='V8q5m'></legend><bdo id='V8q5m'><pre id='V8q5m'><center id='V8q5m'></center></pre></bdo></b><th id='V8q5m'></th></span></q></dt></tr></i><div id='V8q5m'><tfoot id='V8q5m'></tfoot><dl id='V8q5m'><fieldset id='V8q5m'></fieldset></dl></div>
                  <bdo id='V8q5m'></bdo><ul id='V8q5m'></ul>

                  本文介绍了K2_content 模块评分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我一直在 category_item.php 中重建标准的 K2 评分,以查看评分从显示为星星到显示为数字.

                  我所做的是,我替换了这段代码:

                  item->params->get('catItemRating')): ?><div id="catItemRatingBlock"><div class="itemRatingForm"><ul class="itemRatingList"><li class="itemCurrentRating" id="itemCurrentRating<?php echo $this->item->id; ?>"style="width:<?php echo $this->item->votingPercentage; ?>%;"></li><li><a href="#" rel="<?php echo $this->item->id; ?>"class="一星">1</a></li><li><a href="#" rel="<?php echo $this->item->id; ?>"class="两星">2<li><a href="#" rel="<?php echo $this->item->id; ?>"class="三星级">3</a></li><li><a href="#" rel="<?php echo $this->item->id; ?>"class="四星">4</a></li><li><a href="#" rel="<?php echo $this->item->id; ?>"class="五颗星">5</a></li>

                  <?php endif;?>

                  使用此代码:

                  item->params->get('catItemRating')): ?><div id="catItemRatingBlock"><div class="itemRatingForm"><?php$rating_sum=0;$rating_cont=0;$db =&JFactory::getDBO();$query='SELECT * FROM #__k2_rating WHERE itemID='.$this->item->id;$db->setQuery($query);$votes=$db->loadObject();$rating_sum = intval($votes-> rating_sum);$rating_count = intval($votes-> rating_count);$evaluate = ($rating_count==0) ?"0" : number_format($rating_sum/$rating_count,1);$evaluate = str_replace('.0', '', $evaluate);$output=" 评分:".$评估."/5";回声$输出;?>

                  <?php endif;?>

                  我想要的是它也能在 K2 模块上运行.我尝试使用我在上面写的相同代码在 k2 内容模块中实现它,但这根本不起作用.

                  有人知道怎么把它拉下来吗?

                  解决方案

                  替换

                  item->params->get('catItemRating')): ?>

                  与:

                  get('catItemRating')): ?>

                  I've been reconstructing the standard K2 rating in the category_item.php to view ratings from to show as stars to show as number.

                  What I did was, I replaced this code:

                  <?php if($this->item->params->get('catItemRating')): ?>
                  <div id="catItemRatingBlock">
                   <div class="itemRatingForm">
                    <ul class="itemRatingList">
                      <li class="itemCurrentRating" id="itemCurrentRating<?php echo $this->item->id; ?>" style="width:<?php echo $this->item->votingPercentage; ?>%;"></li>
                      <li><a href="#" rel="<?php echo $this->item->id;  ?>" class="one-star">1</a></li>
                      <li><a href="#" rel="<?php echo $this->item->id;  ?>" class="two-stars">2</a></li>
                      <li><a href="#" rel="<?php echo $this->item->id;  ?>" class="three-stars">3</a></li>
                      <li><a href="#" rel="<?php echo $this->item->id;  ?>" class="four-stars">4</a></li>
                      <li><a href="#" rel="<?php echo $this->item->id;  ?>" class="five-stars">5</a></li>
                     </ul>
                    </div>
                    </div>
                   <?php endif; ?>
                  

                  with this code:

                  <?php if($this->item->params->get('catItemRating')): ?>
                  <div id="catItemRatingBlock">
                  <div class="itemRatingForm">
                     <?php
                     $rating_sum=0;
                     $rating_cont=0;
                     $db        =& JFactory::getDBO();
                     $query='SELECT * FROM #__k2_rating WHERE itemID='. $this->item->id;
                     $db->setQuery($query);
                     $votes=$db->loadObject();
                  
                     $rating_sum = intval($votes->rating_sum);
                     $rating_count = intval($votes->rating_count);
                     $evaluate = ($rating_count==0) ? "0" : number_format($rating_sum/$rating_count,1);
                  
                     $evaluate = str_replace('.0', '', $evaluate);
                  
                     $output=" Rating: ". $evaluate."/5";
                     echo $output;
                     ?>
                     </div>
                     </div>
                     <?php endif; ?>
                  

                  And what I want is for it to work on the K2 module as well. I tried to use the same code that I wrote above here to achieve it in k2 content module but that doesn't work at all.

                  Anyone know how to pull it off?

                  解决方案

                  Replace

                  <?php if($this->item->params->get('catItemRating')): ?>
                  

                  with:

                  <?php if($params->get('catItemRating')): ?>
                  

                  这篇关于K2_content 模块评分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                  • <bdo id='kr0kc'></bdo><ul id='kr0kc'></ul>
                  <legend id='kr0kc'><style id='kr0kc'><dir id='kr0kc'><q id='kr0kc'></q></dir></style></legend>

                  <i id='kr0kc'><tr id='kr0kc'><dt id='kr0kc'><q id='kr0kc'><span id='kr0kc'><b id='kr0kc'><form id='kr0kc'><ins id='kr0kc'></ins><ul id='kr0kc'></ul><sub id='kr0kc'></sub></form><legend id='kr0kc'></legend><bdo id='kr0kc'><pre id='kr0kc'><center id='kr0kc'></center></pre></bdo></b><th id='kr0kc'></th></span></q></dt></tr></i><div id='kr0kc'><tfoot id='kr0kc'></tfoot><dl id='kr0kc'><fieldset id='kr0kc'></fieldset></dl></div>

                    1. <small id='kr0kc'></small><noframes id='kr0kc'>

                    2. <tfoot id='kr0kc'></tfoot>