コード例 #1
0
ファイル: bm_reviews.php プロジェクト: haraldpdl/oscommerce2
 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);
 }
コード例 #2
0
 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);
     }
 }
コード例 #3
0
            <?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');
?>
コード例 #4
0
ファイル: reviews.php プロジェクト: haraldpdl/oscommerce2
</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">
コード例 #5
0
ファイル: reviews.php プロジェクト: tiansiyuan/oscommerce2
        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>
コード例 #6
0
        ?>
</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>