Ejemplo n.º 1
0
function smn_set_sPath($sPath)
{
    // calculate store_category path
    if (isset($sPath)) {
        return $sPath;
    } elseif (isset($_GET['store_id'])) {
        return $sPath = smn_get_spath($_GET['store_id']);
    } else {
        return $sPath = '';
    }
}
Ejemplo n.º 2
0
                // do nothing, go through the loop
            } else {
                $store_categories_query = smn_db_query("select c.store_categories_id, cd.store_categories_name, c.store_categories_image, c.store_parent_id from " . TABLE_STORE_CATEGORIES . " c, " . TABLE_STORE_CATEGORIES_DESCRIPTION . " cd where c.store_parent_id = '" . (int) $store_category_links[$i] . "' and c.store_categories_id = cd.store_categories_id and cd.language_id = '" . (int) $languages_id . "' order by sort_order, cd.store_categories_name");
                break;
                // we've found the deepest store_category the customer is in
            }
        }
    }
} else {
    $store_categories_query = smn_db_query("select c.store_categories_id, cd.store_categories_name, c.store_categories_image, c.store_parent_id from " . TABLE_STORE_CATEGORIES . " c, " . TABLE_STORE_CATEGORIES_DESCRIPTION . " cd where c.store_parent_id = '" . (int) $current_store_category_id . "' and c.store_categories_id = cd.store_categories_id and cd.language_id = '" . (int) $languages_id . "' order by sort_order, cd.store_categories_name");
}
$number_of_store_categories = smn_db_num_rows($store_categories_query);
$rows = 0;
while ($store_categories = smn_db_fetch_array($store_categories_query)) {
    $rows++;
    $sPath_new = smn_get_spath($store_categories['store_categories_id']);
    $width = (int) (100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';
    echo '      <td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . smn_href_link(FILENAME_STORE_LISTING, $sPath_new) . '">' . smn_image('images/' . $store_categories['store_categories_image'], $store_categories['store_categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $store_categories['store_categories_name'] . '</a></td>' . "\n";
    if ($rows / MAX_DISPLAY_CATEGORIES_PER_ROW == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) && $rows != $number_of_store_categories) {
        echo '              </tr></table></tr>' . "\n";
        echo '     <tr>';
        echo '        <td>' . smn_draw_separator('pixel_trans.gif', '100%', '20') . '</td>';
        echo '     </tr>';
        echo '              <tr><table valign="top" border="0" width="100%" cellspacing="0" cellpadding="0"><tr>' . "\n";
    }
}
?>
      </table></td>
          </tr>
        </table></td>
      </tr>