当前位置: 首页>>代码示例>>PHP>>正文


PHP HTML::stars方法代码示例

本文整理汇总了PHP中OSC\OM\HTML::stars方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML::stars方法的具体用法?PHP HTML::stars怎么用?PHP HTML::stars使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OSC\OM\HTML的用法示例。


在下文中一共展示了HTML::stars方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: execute

 function execute()
 {
     global $currencies, $oscTemplate;
     $OSCOM_Db = Registry::get('Db');
     $OSCOM_Language = Registry::get('Language');
     $reviews_box_contents = '';
     $sql_query = 'select r.reviews_id from :table_reviews r, :table_reviews_description rd, :table_products p, :table_products_description pd where r.reviews_status = 1 and r.products_id = p.products_id and p.products_status = 1 and r.reviews_id = rd.reviews_id and rd.languages_id = :languages_id and p.products_id = pd.products_id and pd.language_id = rd.languages_id';
     if (isset($_GET['products_id'])) {
         $sql_query .= ' and p.products_id = :products_id';
     }
     $sql_query .= ' order by r.reviews_id desc limit ' . (int) MAX_RANDOM_SELECT_REVIEWS;
     $Qcheck = $OSCOM_Db->prepare($sql_query);
     $Qcheck->bindInt(':languages_id', $OSCOM_Language->getId());
     if (isset($_GET['products_id'])) {
         $Qcheck->bindInt(':products_id', $_GET['products_id']);
     }
     $Qcheck->execute();
     $result = $Qcheck->fetchAll();
     if (count($result) > 0) {
         $result = $result[mt_rand(0, count($result) - 1)];
         $Qreview = $OSCOM_Db->prepare('select r.reviews_id, r.reviews_rating, substring(rd.reviews_text, 1, 60) as reviews_text, p.products_id, p.products_image, pd.products_name from :table_reviews r, :table_reviews_description rd, :table_products p, :table_products_description pd where r.reviews_id = :reviews_id and r.reviews_id = rd.reviews_id and rd.languages_id = :languages_id and r.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = rd.languages_id');
         $Qreview->bindInt(':reviews_id', $result['reviews_id']);
         $Qreview->bindInt(':languages_id', $OSCOM_Language->getId());
         $Qreview->execute();
         if ($Qreview->fetch() !== false) {
             // display random review box
             $rand_review_text = tep_break_string($Qreview->valueProtected('reviews_text'), 15, '-<br />');
             $reviews_box_contents = '<div class="text-center"><a href="' . OSCOM::link('product_reviews.php', 'products_id=' . $Qreview->valueInt('products_id')) . '">' . HTML::image(OSCOM::linkImage($Qreview->value('products_image')), $Qreview->value('products_name'), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></div><div><a href="' . OSCOM::link('product_reviews.php', 'products_id=' . $Qreview->valueInt('products_id')) . '">' . $rand_review_text . '</a>...</div><div class="text-center" title="' . OSCOM::getDef('module_boxes_reviews_box_text_of_5_stars', ['reviews_rating' => $Qreview->valueInt('reviews_rating')]) . '">' . HTML::stars($Qreview->valueInt('reviews_rating')) . '</div>';
         }
     } elseif (isset($_GET['products_id'])) {
         // display 'write a review' box
         $reviews_box_contents = '<span class="fa fa-thumbs-up"></span> <a href="' . OSCOM::link('product_reviews_write.php', 'products_id=' . (int) $_GET['products_id']) . '">' . OSCOM::getDef('module_boxes_reviews_box_write_review') . '</a>';
     } else {
         // display 'no reviews' box
         $reviews_box_contents = '<p>' . OSCOM::getDef('module_boxes_reviews_box_no_reviews') . '</p>';
     }
     ob_start();
     include 'includes/modules/boxes/templates/reviews.php';
     $data = ob_get_clean();
     $oscTemplate->addBlock($data, $this->group);
 }
开发者ID:haraldpdl,项目名称:oscommerce2,代码行数:41,代码来源:bm_reviews.php

示例2: execute

 function execute()
 {
     global $oscTemplate, $_GET;
     $OSCOM_Db = Registry::get('Db');
     $Qreviews = $OSCOM_Db->prepare('select substring_index(rd.reviews_text, " ", 20) as reviews_text, r.reviews_rating, r.reviews_id, r.customers_name, r.date_added, r.reviews_read, p.products_id, p.products_price, p.products_tax_class_id, p.products_image, p.products_model, pd.products_name from :table_reviews r, :table_reviews_description rd, :table_products p, :table_products_description pd where r.products_id = :products_id and r.reviews_status = 1 and r.reviews_id = rd.reviews_id and rd.languages_id = :languages_id and r.products_id = p.products_id and p.products_status = 1 and p.products_id = pd.products_id and pd.language_id = rd.languages_id order by r.reviews_rating desc limit :limit');
     $Qreviews->bindInt(':products_id', $_GET['products_id']);
     $Qreviews->bindInt(':languages_id', $_SESSION['languages_id']);
     $Qreviews->bindInt(':limit', MODULE_CONTENT_PRODUCT_INFO_REVIEWS_CONTENT_LIMIT);
     $Qreviews->execute();
     if ($Qreviews->fetch() !== false) {
         $content_width = (int) MODULE_CONTENT_PRODUCT_INFO_REVIEWS_CONTENT_WIDTH;
         $review_data = '';
         do {
             $review_data .= '<blockquote class="col-sm-6">' . '  <p>' . $Qreviews->valueProtected('reviews_text') . ' ... </p>' . '  <footer>' . sprintf(MODULE_CONTENT_PRODUCT_INFO_REVIEWS_TEXT_RATED, HTML::stars($Qreviews->valueInt('reviews_rating')), $Qreviews->valueProtected('customers_name'), $Qreviews->valueProtected('customers_name')) . '</footer>' . '</blockquote>';
         } while ($Qreviews->fetch());
         ob_start();
         include DIR_WS_MODULES . 'content/' . $this->group . '/templates/reviews.php';
         $template = ob_get_clean();
         $oscTemplate->addContent($template, $this->group);
     }
 }
开发者ID:tiansiyuan,项目名称:oscommerce2,代码行数:21,代码来源:cm_pi_reviews.php

示例3:

            <?php 
echo HTML::radioField('rating', '3') . HTML::stars(3, false);
?>
          </label>
        </div>
        <div class="radio">
          <label>
            <?php 
echo HTML::radioField('rating', '2') . HTML::stars(2, false);
?>
          </label>
        </div>
        <div class="radio">
          <label>
            <?php 
echo HTML::radioField('rating', '1', null, 'required aria-required="true"') . HTML::stars(1, false) . ' ' . TEXT_BAD;
?>
          </label>
        </div>
      </div>
    </div>


  </div>

  <div class="clearfix"></div>

  <div class="row">
    <div class="col-xs-6 text-right pull-right"><?php 
echo HTML::button(IMAGE_BUTTON_CONTINUE, 'glyphicon glyphicon-chevron-right', null, 'primary', null, 'btn-success');
?>
开发者ID:Akofelaz,项目名称:oscommerce2,代码行数:31,代码来源:product_reviews_write.php

示例4: while

</span>
    </div>
  </div>
<?php 
    }
    ?>
    <div class="contentText">
      <div class="reviews">
<?php 
    while ($Qreviews->fetch()) {
        echo '<blockquote class="col-sm-6">';
        echo '  <p><span class="pull-left">' . HTML::image(OSCOM::linkImage($Qreviews->value('products_image')), $Qreviews->value('products_name'), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</span>' . $Qreviews->valueProtected('reviews_text') . ' ... </p><div class="clearfix"></div>';
        $review_name = $Qreviews->valueProtected('customers_name');
        echo '<footer>';
        $review_name = $Qreviews->valueProtected('customers_name');
        echo OSCOM::getDef('reviews_text_rated', ['reviews_rating' => HTML::stars($Qreviews->value('reviews_rating')), 'review_name' => $review_name]);
        echo '<a href="' . OSCOM::link('product_reviews.php', 'products_id=' . $Qreviews->valueInt('products_id')) . '">';
        echo '<span class="pull-right label label-info">' . OSCOM::getDef('reviews_text_read_more') . '</span>';
        echo '</a>';
        echo '</footer>';
        echo '</blockquote>';
    }
    ?>
      </div>
      <div class="clearfix"></div>
    </div>
<?php 
} else {
    ?>

  <div class="alert alert-info">
开发者ID:haraldpdl,项目名称:oscommerce2,代码行数:31,代码来源:reviews.php

示例5: sprintf

        echo '<a href="' . OSCOM::link('product_reviews.php', 'products_id=' . $Qreviews->valueInt('products_id') . '&reviews_id=' . $Qreviews->valueInt('reviews_id')) . '">' . $Qreviews->value('products_name') . '</a>';
        ?>
</h4>
    <blockquote>
      <p><span class="pull-left"><?php 
        echo HTML::image(DIR_WS_IMAGES . $Qreviews->value('products_image'), $Qreviews->value('products_name'), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
        ?>
</span><?php 
        echo $Qreviews->valueProtected('reviews_text') . ' ... ';
        ?>
</p>
      <div class="clearfix"></div>
      <footer>
        <?php 
        $review_name = $Qreviews->valueProtected('customers_name');
        echo sprintf(REVIEWS_TEXT_RATED, HTML::stars($Qreviews->value('reviews_rating')), $review_name, $review_name) . '<a href="' . OSCOM::link('product_reviews.php', 'products_id=' . $Qreviews->valueInt('products_id')) . '"><span class="pull-right label label-info">' . REVIEWS_TEXT_READ_MORE . '</span></a>';
        ?>
      </footer>
    </blockquote>
  </div>

<?php 
    }
    ?>
</div>

<?php 
    if (PREV_NEXT_BAR_LOCATION == '2' || PREV_NEXT_BAR_LOCATION == '3') {
        ?>

  <div class="clearfix"></div>
开发者ID:tiansiyuan,项目名称:oscommerce2,代码行数:31,代码来源:reviews.php

示例6: sprintf

        ?>
</p>
      <meta itemprop="datePublished" content="<?php 
        echo $Qreviews->value('date_added');
        ?>
">
      <span itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating">
        <meta itemprop="ratingValue" content="<?php 
        echo $Qreviews->value('reviews_rating');
        ?>
">
      </span>
      <footer>
        <?php 
        $review_name = $Qreviews->valueProtected('customers_name');
        echo sprintf(REVIEWS_TEXT_RATED, HTML::stars($Qreviews->value('reviews_rating')), $review_name, $review_name);
        ?>
      </footer>
    </blockquote>

<?php 
    }
    ?>
  </div>

<?php 
    if (PREV_NEXT_BAR_LOCATION == '2' || PREV_NEXT_BAR_LOCATION == '3') {
        ?>

  <div class="clearfix"></div>
开发者ID:tiansiyuan,项目名称:oscommerce2,代码行数:30,代码来源:product_reviews.php


注:本文中的OSC\OM\HTML::stars方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。