[ Index ]

PHP Cross Reference of osCMax 2.0.4

title

Body

[close]

/templates/fallback/content/ -> 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"><?php echo HEADING_TITLE; ?></td>
   6              <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_reviews_new.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></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 border="0" width="100%" cellspacing="0" cellpadding="2">
  15  <?php
  16    $reviews_query_raw = "select r.reviews_id, left(rd.reviews_text, 100) as reviews_text, r.reviews_rating, r.date_added, p.products_id, pd.products_name, p.products_image, r.customers_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = r.products_id and r.reviews_id = rd.reviews_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and rd.languages_id = '" . (int)$languages_id . "' order by r.reviews_id DESC";
  17    $reviews_split = new splitPageResults($reviews_query_raw, MAX_DISPLAY_NEW_REVIEWS);
  18  
  19    if ($reviews_split->number_of_rows > 0) {
  20      if ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3')) {
  21  ?>
  22            <tr>
  23              <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
  24                <tr>
  25                  <td class="smallText"><?php echo $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS); ?></td>
  26                  <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>
  27                </tr>
  28              </table></td>
  29            </tr>
  30            <tr>
  31              <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  32            </tr>
  33  <?php
  34      }
  35  
  36      $reviews_query = tep_db_query($reviews_split->sql_query);
  37      while ($reviews = tep_db_fetch_array($reviews_query)) {
  38  ?>
  39            <tr>
  40              <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
  41                <tr>
  42                  <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $reviews['products_id'] . '&reviews_id=' . $reviews['reviews_id']) . '"><u><b>' . $reviews['products_name'] . '</b></u></a> <span class="smallText">' . sprintf(TEXT_REVIEW_BY, tep_output_string_protected($reviews['customers_name'])) . '</span>'; ?></td>
  43                  <td class="smallText" align="right"><?php echo sprintf(TEXT_REVIEW_DATE_ADDED, tep_date_long($reviews['date_added'])); ?></td>
  44                </tr>
  45              </table></td>
  46            </tr>
  47            <tr>
  48              <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
  49                <tr class="infoBoxContents">
  50                  <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
  51                    <tr>
  52                      <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
  53                      <td width="<?php echo SMALL_IMAGE_WIDTH + 10; ?>" align="center" valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $reviews['products_id'] . '&reviews_id=' . $reviews['reviews_id']) . '">' . tep_image(DIR_WS_IMAGES . $reviews['products_image'], $reviews['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?></td>
  54                      <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>
  55                      <td width="10" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
  56                    </tr>
  57                  </table></td>
  58                </tr>
  59              </table></td>
  60            </tr>
  61            <tr>
  62              <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  63            </tr>
  64  <?php
  65      }
  66  ?>
  67  <?php
  68    } else {
  69  ?>
  70            <tr>
  71              <td><?php new infoBox(array(array('text' => TEXT_NO_REVIEWS))); ?></td>
  72            </tr>
  73            <tr>
  74              <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  75            </tr>
  76  <?php
  77    }
  78  
  79    if (($reviews_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) {
  80  ?>
  81            <tr>
  82              <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
  83                <tr>
  84                  <td class="smallText"><?php echo $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS); ?></td>
  85                  <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>
  86                </tr>
  87              </table></td>
  88            </tr>
  89            <tr>
  90              <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  91            </tr>
  92  <?php
  93    }
  94  ?>
  95          </table></td>
  96        </tr>
  97      </table>
  98  


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