[ Index ]

PHP Cross Reference of osCMax 2.0.4

title

Body

[close]

/templates/fallback/content/ -> product_reviews.tpl.php (source)

   1      <table border="0" width="100%" cellspacing="0" cellpadding="0">
   2        <tr>
   3          <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
   4            <tr>
   5              <td class="pageHeading" valign="top"><?php echo $products_name; ?></td>
   6              <td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>
   7            </tr>
   8          </table></td>
   9        </tr>
  10        <tr>
  11          <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  12        </tr>
  13        <tr>
  14          <td><table width="100%" border="0" cellspacing="0" cellpadding="2">
  15            <tr>
  16              <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
  17  <?php
  18    $reviews_query_raw = "select r.reviews_id, left(rd.reviews_text, 100) as reviews_text, r.reviews_rating, r.date_added, r.customers_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where r.products_id = '" . (int)$product_info['products_id'] . "' and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "' order by r.reviews_id desc";
  19    $reviews_split = new splitPageResults($reviews_query_raw, MAX_DISPLAY_NEW_REVIEWS);
  20  
  21    if ($reviews_split->number_of_rows > 0) {
  22      if ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3')) {
  23  ?>
  24                <tr>
  25                  <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
  26                    <tr>
  27                      <td class="smallText"><?php echo $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS); ?></td>
  28                      <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $reviews_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info'))); ?></td>
  29                    </tr>
  30                  </table></td>
  31                </tr>
  32                <tr>
  33                  <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  34                </tr>
  35  <?php
  36      }
  37  
  38      $reviews_query = tep_db_query($reviews_split->sql_query);
  39      while ($reviews = tep_db_fetch_array($reviews_query)) {
  40  ?>
  41                <tr>
  42                  <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
  43                    <tr>
  44                      <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $product_info['products_id'] . '&reviews_id=' . $reviews['reviews_id']) . '"><u><b>' . sprintf(TEXT_REVIEW_BY, tep_output_string_protected($reviews['customers_name'])) . '</b></u></a>'; ?></td>
  45                      <td class="smallText" align="right"><?php echo sprintf(TEXT_REVIEW_DATE_ADDED, tep_date_long($reviews['date_added'])); ?></td>
  46                    </tr>
  47                  </table></td>
  48                </tr>
  49                <tr>
  50                  <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
  51                    <tr class="infoBoxContents">
  52                      <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
  53                        <tr>
  54                          <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
  55                          <td valign="top" class="main"><?php echo tep_break_string(tep_output_string_protected($reviews['reviews_text']), 60, '-<br>') . ((strlen($reviews['reviews_text']) >= 100) ? '..' : '') . '<br><br><i>' . sprintf(TEXT_REVIEW_RATING, tep_image(DIR_WS_IMAGES . 'stars_' . $reviews['reviews_rating'] . '.gif', sprintf(TEXT_OF_5_STARS, $reviews['reviews_rating'])), sprintf(TEXT_OF_5_STARS, $reviews['reviews_rating'])) . '</i>'; ?></td>
  56                          <td width="10" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
  57                        </tr>
  58                      </table></td>
  59                    </tr>
  60                  </table></td>
  61                </tr>
  62                <tr>
  63                  <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  64                </tr>
  65  <?php
  66      }
  67  ?>
  68  <?php
  69    } else {
  70  ?>
  71                <tr>
  72                  <td><?php new infoBox(array(array('text' => TEXT_NO_REVIEWS))); ?></td>
  73                </tr>
  74                <tr>
  75                  <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  76                </tr>
  77  <?php
  78    }
  79  
  80    if (($reviews_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) {
  81  ?>
  82                <tr>
  83                  <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
  84                    <tr>
  85                      <td class="smallText"><?php echo $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS); ?></td>
  86                      <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $reviews_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info'))); ?></td>
  87                    </tr>
  88                  </table></td>
  89                </tr>
  90                <tr>
  91                  <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  92                </tr>
  93  <?php
  94    }
  95  ?>
  96                <tr>
  97                  <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
  98                    <tr class="infoBoxContents">
  99                      <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
 100                        <tr>
 101                          <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
 102                          <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params()) . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
 103                          <td class="main" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, tep_get_all_get_params()) . '">' . tep_image_button('button_write_review.gif', IMAGE_BUTTON_WRITE_REVIEW) . '</a>'; ?></td>
 104                          <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
 105                        </tr>
 106                      </table></td>
 107                    </tr>
 108                  </table></td>
 109                </tr>
 110              </table></td>
 111              <td width="<?php echo SMALL_IMAGE_WIDTH + 10; ?>" align="right" valign="top"><table border="0" cellspacing="0" cellpadding="0">
 112                <tr>
 113                  <td align="center" class="smallText">
 114  <?php
 115  
 116  // BOF:  Added for Dynamic MoPics v3.000
 117    if (tep_not_null($product_info['products_image'])) {
 118  ?>
 119            <table border="0" cellspacing="0" cellpadding="2" align="right">
 120              <tr>
 121                <td align="center" class="smallText">
 122  <?php
 123              $image_lg = mopics_get_imagebase($product_info['products_image'], DIR_WS_IMAGES . DYNAMIC_MOPICS_BIGIMAGES_DIR);
 124              if ($lg_image_ext = mopics_file_exists(DIR_FS_CATALOG . $image_lg, DYNAMIC_MOPICS_BIG_IMAGE_TYPES)) {
 125                  $image_size = @getimagesize(DIR_FS_CATALOG . $image_lg . '.' . $lg_image_ext);
 126  ?>
 127            <script language="javascript" type="text/javascript"><!--
 128              document.write('<a href="javascript:popupImage(\'<?php echo tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . '&type=' . $lg_image_ext); ?>\',\'<?php echo ((int)$image_size[1] + 30); ?>\',\'<?php echo ((int)$image_size[0] + 5); ?>\');"><?php echo tep_image(DIR_WS_IMAGES . DYNAMIC_MOPICS_THUMBS_DIR . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT); ?><br /><span class="smallText"><?php echo TEXT_CLICK_TO_ENLARGE; ?></span></a>');
 129  //--></script>
 130  <noscript>
 131              <a href="<?php echo tep_href_link($image_lg . '.' . $lg_image_ext); ?>" target="_blank"><?php echo tep_image(DIR_WS_IMAGES . DYNAMIC_MOPICS_THUMBS_DIR . $product_info['products_image'], stripslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT); ?><br /><span class="smallText"><?php echo TEXT_CLICK_TO_ENLARGE; ?></span></a>
 132  </noscript>
 133  <?php
 134              } else {
 135            echo tep_image(DIR_WS_IMAGES . DYNAMIC_MOPICS_THUMBS_DIR . $product_info['products_image'], stripslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
 136              }
 137  ?>
 138                </td>
 139              </tr>
 140              <tr>
 141                <td>
 142                   <?php
 143                    echo '<p><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now') . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a></p>';
 144                   ?>
 145                </td>
 146              </tr>
 147            </table>
 148  <?php
 149      }
 150  // EOF:  Added for Dynamic MoPics v3.000
 151  ?>
 152                  </td>
 153                </tr>
 154              </table>
 155            </td>
 156          </table></td>
 157        </tr>
 158      </table>


Generated: Fri Jan 1 13:43:16 2010 Cross-referenced by PHPXref 0.7