本文整理汇总了PHP中osc_link_object函数的典型用法代码示例。如果您正苦于以下问题:PHP osc_link_object函数的具体用法?PHP osc_link_object怎么用?PHP osc_link_object使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了osc_link_object函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initialize
public function initialize()
{
$OSCOM_Product = Registry::exists('Product') ? Registry::get('Product') : null;
$OSCOM_Customer = Registry::get('Customer');
$OSCOM_Database = Registry::get('Database');
$OSCOM_Language = Registry::get('Language');
$this->_title_link = OSCOM::getLink(null, 'Account', 'Notifications', 'SSL');
if (isset($OSCOM_Product) && $OSCOM_Product instanceof \osCommerce\OM\Site\Shop\Product && $OSCOM_Product->isValid()) {
if ($OSCOM_Customer->isLoggedOn()) {
$Qcheck = $OSCOM_Database->query('select global_product_notifications from :table_customers where customers_id = :customers_id');
$Qcheck->bindInt(':customers_id', $OSCOM_Customer->getID());
$Qcheck->execute();
if ($Qcheck->valueInt('global_product_notifications') === 0) {
$Qcheck = $OSCOM_Database->query('select products_id from :table_products_notifications where products_id = :products_id and customers_id = :customers_id limit 1');
$Qcheck->bindInt(':products_id', $OSCOM_Product->getID());
$Qcheck->bindInt(':customers_id', $OSCOM_Customer->getID());
$Qcheck->execute();
if ($Qcheck->numberOfRows() > 0) {
$this->_content = '<div style="float: left; width: 55px;">' . osc_link_object(OSCOM::getLink(null, null, osc_get_all_get_params(array('action')) . '&action=notify_remove', 'AUTO'), osc_image(DIR_WS_IMAGES . 'box_products_notifications_remove.gif', sprintf(OSCOM::getDef('box_product_notifications_remove'), $OSCOM_Product->getTitle()))) . '</div>' . osc_link_object(OSCOM::getLink(null, null, osc_get_all_get_params(array('action')) . '&action=notify_remove', 'AUTO'), sprintf(OSCOM::getDef('box_product_notifications_remove'), $OSCOM_Product->getTitle()));
} else {
$this->_content = '<div style="float: left; width: 55px;">' . osc_link_object(OSCOM::getLink(null, null, osc_get_all_get_params(array('action')) . '&action=notify_add', 'AUTO'), osc_image(DIR_WS_IMAGES . 'box_products_notifications.gif', sprintf(OSCOM::getDef('box_product_notifications_add'), $OSCOM_Product->getTitle()))) . '</div>' . osc_link_object(OSCOM::getLink(null, null, osc_get_all_get_params(array('action')) . '&action=notify_add', 'AUTO'), sprintf(OSCOM::getDef('box_product_notifications_add'), $OSCOM_Product->getTitle()));
}
$this->_content .= '<div style="clear: both;"></div>';
}
}
}
}
示例2: add
/**
* Adds an entry to the breadcrumb navigation path
*
* @param string $title The title of the breadcrumb navigation entry
* @param string $link The link of the breadcrumb navigation entry
* @access public
*/
public function add($title, $link = null)
{
if (!empty($link)) {
$title = osc_link_object($link, $title);
}
$this->_path[] = $title;
}
示例3: initialize
function initialize()
{
global $osC_Database, $osC_Language, $osC_Product, $osC_Customer;
$this->_title_link = osc_href_link(FILENAME_ACCOUNT, 'notifications', 'SSL');
if (isset($osC_Product) && is_a($osC_Product, 'osC_Product')) {
if ($osC_Customer->isLoggedOn()) {
$Qcheck = $osC_Database->query('select global_product_notifications from :table_customers where customers_id = :customers_id');
$Qcheck->bindTable(':table_customers', TABLE_CUSTOMERS);
$Qcheck->bindInt(':customers_id', $osC_Customer->getID());
$Qcheck->execute();
if ($Qcheck->valueInt('global_product_notifications') === 0) {
$Qcheck = $osC_Database->query('select products_id from :table_products_notifications where products_id = :products_id and customers_id = :customers_id limit 1');
$Qcheck->bindTable(':table_products_notifications', TABLE_PRODUCTS_NOTIFICATIONS);
$Qcheck->bindInt(':products_id', $osC_Product->getID());
$Qcheck->bindInt(':customers_id', $osC_Customer->getID());
$Qcheck->execute();
if ($Qcheck->numberOfRows() > 0) {
$this->_content = '<div style="float: left; width: 55px;">' . osc_link_object(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), osc_get_all_get_params(array('action')) . '&action=notify_remove', 'AUTO'), osc_image(DIR_WS_IMAGES . 'box_products_notifications_remove.gif', sprintf($osC_Language->get('box_product_notifications_remove'), $osC_Product->getTitle()))) . '</div>' . osc_link_object(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), osc_get_all_get_params(array('action')) . '&action=notify_remove', 'AUTO'), sprintf($osC_Language->get('box_product_notifications_remove'), $osC_Product->getTitle()));
} else {
$this->_content = '<div style="float: left; width: 55px;">' . osc_link_object(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), osc_get_all_get_params(array('action')) . '&action=notify_add', 'AUTO'), osc_image(DIR_WS_IMAGES . 'box_products_notifications.gif', sprintf($osC_Language->get('box_product_notifications_add'), $osC_Product->getTitle()))) . '</div>' . osc_link_object(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), osc_get_all_get_params(array('action')) . '&action=notify_add', 'AUTO'), sprintf($osC_Language->get('box_product_notifications_add'), $osC_Product->getTitle()));
}
$this->_content .= '<div style="clear: both;"></div>';
}
} else {
$this->_content = '<div style="float: left; width: 55px;">' . osc_link_object(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), osc_get_all_get_params(array('action')) . '&action=notify_add', 'AUTO'), osc_image(DIR_WS_IMAGES . 'box_products_notifications.gif', sprintf($osC_Language->get('box_product_notifications_add'), $osC_Product->getTitle()))) . '</div>' . osc_link_object(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), osc_get_all_get_params(array('action')) . '&action=notify_add', 'AUTO'), sprintf($osC_Language->get('box_product_notifications_add'), $osC_Product->getTitle())) . '<div style="clear: both;"></div>';
}
}
}
示例4: initialize
function initialize()
{
global $osC_Database, $osC_Language, $osC_Product, $osC_Image;
if (isset($osC_Product)) {
$Qorders = $osC_Database->query('select p.products_id, pd.products_name, pd.products_keyword, i.image from :table_orders_products opa, :table_orders_products opb, :table_orders o, :table_products p left join :table_products_images i on (p.products_id = i.products_id and i.default_flag = :default_flag), :table_products_description pd where opa.products_id = :products_id and opa.orders_id = opb.orders_id and opb.products_id != :products_id and opb.products_id = p.products_id and opb.orders_id = o.orders_id and p.products_status = 1 and p.products_id = pd.products_id and pd.language_id = :language_id group by p.products_id order by o.date_purchased desc limit :limit');
$Qorders->bindTable(':table_orders_products', TABLE_ORDERS_PRODUCTS);
$Qorders->bindTable(':table_orders_products', TABLE_ORDERS_PRODUCTS);
$Qorders->bindTable(':table_orders', TABLE_ORDERS);
$Qorders->bindTable(':table_products', TABLE_PRODUCTS);
$Qorders->bindTable(':table_products_images', TABLE_PRODUCTS_IMAGES);
$Qorders->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
$Qorders->bindInt(':default_flag', 1);
$Qorders->bindInt(':products_id', $osC_Product->getID());
$Qorders->bindInt(':products_id', $osC_Product->getID());
$Qorders->bindInt(':language_id', $osC_Language->getID());
$Qorders->bindInt(':limit', MODULE_CONTENT_ALSO_PURCHASED_MAX_DISPLAY);
if (MODULE_CONTENT_ALSO_PURCHASED_PRODUCTS_CACHE > 0) {
$Qorders->setCache('also_purchased-' . $osC_Product->getID(), MODULE_CONTENT_ALSO_PURCHASED_PRODUCTS_CACHE);
}
$Qorders->execute();
if ($Qorders->numberOfRows() >= MODULE_CONTENT_ALSO_PURCHASED_MIN_DISPLAY) {
$this->_content = '<div style="overflow: auto;">';
while ($Qorders->next()) {
$this->_content .= '<span style="width: 33%; float: left; text-align: center;">';
if (osc_empty($Qorders->value('image')) === false) {
$this->_content .= osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qorders->value('products_id')), $osC_Image->show($Qorders->value('image'), $Qorders->value('products_name'))) . '<br />';
}
$this->_content .= osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qorders->value('products_id')), $Qorders->value('products_name')) . '</span>';
}
$this->_content .= '</div>';
}
$Qorders->freeResult();
}
}
示例5: initialize
function initialize()
{
global $osC_Cache, $osC_Database, $osC_Services, $osC_Currencies, $osC_Specials, $osC_Language, $osC_Image;
$this->_title_link = osc_href_link(FILENAME_PRODUCTS, 'new');
$data = array();
if (BOX_WHATS_NEW_CACHE > 0 && $osC_Cache->read('box-whats_new-' . $osC_Language->getCode() . '-' . $osC_Currencies->getCode(), BOX_WHATS_NEW_CACHE)) {
$data = $osC_Cache->getCache();
} else {
$Qnew = $osC_Database->query('select products_id from :table_products where products_status = :products_status order by products_date_added desc limit :max_random_select_new');
$Qnew->bindTable(':table_products', TABLE_PRODUCTS);
$Qnew->bindInt(':products_status', 1);
$Qnew->bindInt(':max_random_select_new', BOX_WHATS_NEW_RANDOM_SELECT);
$Qnew->executeRandomMulti();
if ($Qnew->numberOfRows()) {
$osC_Product = new osC_Product($Qnew->valueInt('products_id'));
$data = $osC_Product->getData();
$data['display_price'] = $osC_Product->getPriceFormated(true);
$data['display_image'] = $osC_Product->getImage();
}
$osC_Cache->write($data);
}
if (!empty($data)) {
$this->_content = '';
if (!empty($data['display_image'])) {
$this->_content .= osc_link_object(osc_href_link(FILENAME_PRODUCTS, $data['keyword']), $osC_Image->show($data['display_image'], $data['name'])) . '<br />';
}
$this->_content .= osc_link_object(osc_href_link(FILENAME_PRODUCTS, $data['keyword']), $data['name']) . '<br />' . $data['display_price'];
}
}
示例6: getOutput
function getOutput()
{
global $osC_Product;
if (!empty($osC_Product)) {
return osc_link_object(osc_href_link(FILENAME_PRODUCTS, 'tell_a_friend&' . $osC_Product->getID()), $this->getIcon());
}
}
示例7: initialize
function initialize()
{
global $osC_Cache, $osC_Database, $osC_Services, $osC_Currencies, $osC_Specials, $osC_Language, $osC_Image;
$this->_title_link = osc_href_link(FILENAME_PRODUCTS, 'new');
if (BOX_WHATS_NEW_CACHE > 0 && $osC_Cache->read('box-whats_new-' . $osC_Language->getCode() . '-' . $osC_Currencies->getCode(), BOX_WHATS_NEW_CACHE)) {
$data = $osC_Cache->getCache();
} else {
$data = array();
$Qnew = $osC_Database->query('select p.products_id, p.products_tax_class_id, p.products_price, pd.products_name, pd.products_keyword, i.image from :table_products p left join :table_products_images i on (p.products_id = i.products_id and i.default_flag = :default_flag), :table_products_description pd where p.products_status = 1 and p.products_id = pd.products_id and pd.language_id = :language_id order by p.products_date_added desc limit :max_random_select_new');
$Qnew->bindTable(':table_products', TABLE_PRODUCTS);
$Qnew->bindTable(':table_products_images', TABLE_PRODUCTS_IMAGES);
$Qnew->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
$Qnew->bindInt(':default_flag', 1);
$Qnew->bindInt(':language_id', $osC_Language->getID());
$Qnew->bindInt(':max_random_select_new', BOX_WHATS_NEW_RANDOM_SELECT);
$Qnew->executeRandomMulti();
if ($Qnew->numberOfRows()) {
$data = $Qnew->toArray();
$osC_Product = new osC_Product($Qnew->valueInt('products_id'));
$data['products_price'] = $osC_Product->getPriceFormated(true);
}
$osC_Cache->write('box-whats_new-' . $osC_Language->getCode() . '-' . $osC_Currencies->getCode(), $data);
}
if (empty($data) === false) {
$this->_content = '';
if (empty($data['image']) === false) {
$this->_content .= osc_link_object(osc_href_link(FILENAME_PRODUCTS, $data['products_id']), $osC_Image->show($data['image'], $data['products_name'])) . '<br />';
}
$this->_content .= '<span>' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $data['products_id']), $data['products_name']) . '</span><br /><span class="productPrice">' . $data['products_price'] . '</span>';
}
}
示例8: __construct
public function __construct()
{
Registry::get('Language')->loadIniFile('modules/Dashboard/Customers.php');
$this->_title = OSCOM::getDef('admin_indexmodules_customers_title');
$this->_title_link = OSCOM::getLink(null, 'Customers');
if (Access::hasAccess(OSCOM::getSite(), 'Customers')) {
$this->_data = '<table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable">' . ' <thead>' . ' <tr>' . ' <th>' . OSCOM::getDef('admin_indexmodules_customers_table_heading_customers') . '</th>' . ' <th>' . OSCOM::getDef('admin_indexmodules_customers_table_heading_date') . '</th>' . ' <th>' . OSCOM::getDef('admin_indexmodules_customers_table_heading_status') . '</th>' . ' </tr>' . ' </thead>' . ' <tbody>';
$Qcustomers = Registry::get('Database')->query('select customers_id, customers_gender, customers_lastname, customers_firstname, customers_status, date_account_created from :table_customers order by date_account_created desc limit 6');
$Qcustomers->execute();
$counter = 0;
while ($Qcustomers->next()) {
$customer_icon = osc_icon('people.png');
if (ACCOUNT_GENDER > -1) {
switch ($Qcustomers->value('customers_gender')) {
case 'm':
$customer_icon = osc_icon('user_male.png');
break;
case 'f':
$customer_icon = osc_icon('user_female.png');
break;
}
}
$this->_data .= ' <tr onmouseover="$(this).addClass(\'mouseOver\');" onmouseout="$(this).removeClass(\'mouseOver\');"' . ($counter % 2 ? ' class="alt"' : '') . '>' . ' <td>' . osc_link_object(OSCOM::getLink(null, 'Customers', 'cID=' . $Qcustomers->valueInt('customers_id') . '&action=save'), $customer_icon . ' ' . $Qcustomers->valueProtected('customers_firstname') . ' ' . $Qcustomers->valueProtected('customers_lastname')) . '</td>' . ' <td>' . $Qcustomers->value('date_account_created') . '</td>' . ' <td align="center">' . osc_icon($Qcustomers->valueInt('customers_status') === 1 ? 'checkbox_ticked.gif' : 'checkbox_crossed.gif', null, null) . '</td>' . ' </tr>';
$counter++;
}
$this->_data .= ' </tbody>' . '</table>';
}
}
示例9: initialize
function initialize()
{
global $osC_Language, $osC_Template, $osC_ShoppingCart;
$steps = array();
if ($osC_ShoppingCart->getContentType() != 'virtual') {
$steps[] = array('title' => $osC_Language->get('box_ordering_steps_delivery'), 'code' => 'shipping', 'active' => $osC_Template->getModule() == 'shipping' || $osC_Template->getModule() == 'shipping_address' ? true : false);
}
$steps[] = array('title' => $osC_Language->get('box_ordering_steps_payment'), 'code' => 'payment', 'active' => $osC_Template->getModule() == 'payment' || $osC_Template->getModule() == 'payment_address' ? true : false);
$steps[] = array('title' => $osC_Language->get('box_ordering_steps_confirmation'), 'code' => 'confirmation', 'active' => $osC_Template->getModule() == 'confirmation' ? true : false);
$steps[] = array('title' => $osC_Language->get('box_ordering_steps_complete'), 'active' => $osC_Template->getModule() == 'success' ? true : false);
$content = osc_image('templates/' . $osC_Template->getCode() . '/images/icons/32x32/checkout_preparing_to_ship.gif') . '<br />';
$counter = 0;
foreach ($steps as $step) {
$counter++;
$content .= '<span style="white-space: nowrap;"> ' . osc_image('templates/' . $osC_Template->getCode() . '/images/icons/24x24/checkout_' . $counter . ($step['active'] === true ? '_on' : '') . '.gif', $step['title'], 24, 24, 'align="absmiddle"');
if (isset($step['code'])) {
$content .= osc_link_object(osc_href_link(FILENAME_CHECKOUT, $step['code'], 'SSL'), $step['title'], 'class="boxCheckoutTrail' . ($step['active'] === true ? 'Active' : '') . '"');
} else {
$content .= '<span class="boxCheckoutTrail' . ($step['active'] === true ? 'Active' : '') . '">' . $step['title'] . '</span>';
}
$content .= '</span><br />';
}
$content .= osc_image('templates/' . $osC_Template->getCode() . '/images/icons/32x32/checkout_ready_to_ship.gif');
$this->_content = $content;
}
示例10: initialize
function initialize()
{
global $osC_Database, $osC_Language, $osC_Currencies;
$Qupcoming = $osC_Database->query('select p.products_id, p.products_price, p.products_tax_class_id, p.products_date_available as date_expected, pd.products_name, pd.products_keyword, s.specials_new_products_price, i.image from :table_products p left join :table_products_images i on (p.products_id = i.products_id and i.default_flag = :default_flag) left join :table_specials s on (p.products_id = s.products_id and s.status = 1), :table_products_description pd where to_days(p.products_date_available) >= to_days(now()) and p.products_status = :products_status and p.products_id = pd.products_id and pd.language_id = :language_id order by p.products_date_available limit :max_display_upcoming_products');
$Qupcoming->bindTable(':table_products', TABLE_PRODUCTS);
$Qupcoming->bindTable(':table_products_images', TABLE_PRODUCTS_IMAGES);
$Qupcoming->bindTable(':table_specials', TABLE_SPECIALS);
$Qupcoming->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
$Qupcoming->bindInt(':default_flag', 1);
$Qupcoming->bindInt(':products_status', 1);
$Qupcoming->bindInt(':language_id', $osC_Language->getID());
$Qupcoming->bindInt(':max_display_upcoming_products', MODULE_CONTENT_UPCOMING_PRODUCTS_MAX_DISPLAY);
if (MODULE_CONTENT_UPCOMING_PRODUCTS_CACHE > 0) {
$Qupcoming->setCache('upcoming_products-' . $osC_Language->getCode() . '-' . $osC_Currencies->getCode(), MODULE_CONTENT_UPCOMING_PRODUCTS_CACHE);
}
$Qupcoming->execute();
if ($Qupcoming->numberOfRows() > 0) {
$this->_content = '<ol style="list-style: none;">';
while ($Qupcoming->next()) {
$this->_content .= '<li>' . osC_DateTime::getLong($Qupcoming->value('date_expected')) . ': ' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qupcoming->value('products_id')), $Qupcoming->value('products_name')) . ' ';
if (osc_empty($Qupcoming->value('specials_new_products_price'))) {
$this->_content .= '(' . $osC_Currencies->displayPrice($Qupcoming->value('products_price'), $Qupcoming->valueInt('products_tax_class_id')) . ')';
} else {
$this->_content .= '(<s>' . $osC_Currencies->displayPrice($Qupcoming->value('products_price'), $Qupcoming->valueInt('products_tax_class_id')) . '</s> <span class="productSpecialPrice">' . $osC_Currencies->displayPrice($Qupcoming->value('specials_new_products_price'), $Qupcoming->valueInt('products_tax_class_id')) . '</span>)';
}
$this->_content .= '</li>';
}
$this->_content .= '</ol>';
}
$Qupcoming->freeResult();
}
示例11: initialize
function initialize()
{
global $osC_Database, $osC_Services, $osC_Language, $osC_Currencies, $osC_Image, $osC_Specials, $current_category_id;
if ($current_category_id < 1) {
$Qproducts = $osC_Database->query('select p.products_id, p.products_tax_class_id, p.products_price, pd.products_name, pd.products_keyword, pf.sort_order, i.image from :table_products p left join :table_products_images i on (p.products_id = i.products_id and i.default_flag = :default_flag), :table_products_description pd, :table_products_frontpage pf where p.products_status = 1 and p.products_id = pd.products_id and pd.products_id = pf.products_id and pd.language_id = :language_id order by pf.sort_order limit :max_display_feature_products');
} else {
$Qproducts = $osC_Database->query('select distinct p.products_id, p.products_tax_class_id, p.products_price, pd.products_name, pf.sort_order, pd.products_keyword, i.image from :table_products p left join :table_products_images i on (p.products_id = i.products_id and i.default_flag = :default_flag), :table_products_description pd, :table_products_to_categories p2c, :table_categories c, :table_products_frontpage pf where c.parent_id = :parent_id and c.categories_id = p2c.categories_id and p2c.products_id = p.products_id and p.products_id = pf.products_id and p.products_status = 1 and p.products_id = pd.products_id and pd.language_id = :language_id order by pf.sort_order limit :max_display_feature_products');
$Qproducts->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
$Qproducts->bindTable(':table_categories', TABLE_CATEGORIES);
$Qproducts->bindInt(':parent_id', $current_category_id);
}
$Qproducts->bindTable(':table_products', TABLE_PRODUCTS);
$Qproducts->bindTable(':table_products_images', TABLE_PRODUCTS_IMAGES);
$Qproducts->bindTable(':table_products_frontpage', TABLE_PRODUCTS_FRONTPAGE);
$Qproducts->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
$Qproducts->bindInt(':default_flag', 1);
$Qproducts->bindInt(':language_id', $osC_Language->getID());
$Qproducts->bindInt(':max_display_feature_products', MODULE_CONTENT_FEATURE_PRODUCTS_MAX_DISPLAY);
$Qproducts->setCache('feature-products-' . $osC_Language->getCode() . '-' . $osC_Currencies->getCode() . '-' . $current_category_id);
$Qproducts->execute();
if ($Qproducts->numberOfRows()) {
$this->_content = '<div style="overflow: auto; height: 100%;">';
$i = 0;
while ($Qproducts->next()) {
if ($i % 3 == 0 && $i != 0) {
$this->_content .= '<div style="clear:both"></div>';
}
$osC_Product = new osC_Product($Qproducts->valueInt('products_id'));
$this->_content .= '<span style="width: 32%; float: left; text-align: center; padding: 2px;">' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qproducts->value('products_id')), $osC_Image->show($Qproducts->value('image'), $Qproducts->value('products_name'))) . '<br />' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qproducts->value('products_id')), $Qproducts->value('products_name')) . '<br />' . $osC_Product->getPriceFormated(true) . '</span>';
$i++;
}
$this->_content .= '</div>';
}
$Qproducts->freeResult();
}
示例12: initialize
function initialize()
{
global $osC_Database, $osC_Cache, $osC_Language, $osC_Currencies, $osC_Image, $current_category_id;
$data = array();
if (MODULE_CONTENT_NEW_PRODUCTS_CACHE > 0 && $osC_Cache->read('new_products-' . $osC_Language->getCode() . '-' . $osC_Currencies->getCode() . '-' . $current_category_id, MODULE_CONTENT_NEW_PRODUCTS_CACHE)) {
$data = $osC_Cache->getCache();
} else {
if ($current_category_id < 1) {
$Qproducts = $osC_Database->query('select products_id from :table_products where products_status = :products_status and parent_id is null order by products_date_added desc limit :max_display_new_products');
} else {
$Qproducts = $osC_Database->query('select distinct p2c.products_id from :table_products p, :table_products_to_categories p2c, :table_categories c where c.parent_id = :category_parent_id and c.categories_id = p2c.categories_id and p2c.products_id = p.products_id and p.products_status = :products_status and p.parent_id is null order by p.products_date_added desc limit :max_display_new_products');
$Qproducts->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
$Qproducts->bindTable(':table_categories', TABLE_CATEGORIES);
$Qproducts->bindInt(':category_parent_id', $current_category_id);
}
$Qproducts->bindTable(':table_products', TABLE_PRODUCTS);
$Qproducts->bindInt(':products_status', 1);
$Qproducts->bindInt(':max_display_new_products', MODULE_CONTENT_NEW_PRODUCTS_MAX_DISPLAY);
$Qproducts->execute();
while ($Qproducts->next()) {
$osC_Product = new osC_Product($Qproducts->valueInt('products_id'));
$data[$osC_Product->getID()] = $osC_Product->getData();
$data[$osC_Product->getID()]['display_price'] = $osC_Product->getPriceFormated(true);
$data[$osC_Product->getID()]['display_image'] = $osC_Product->getImage();
}
$osC_Cache->write($data);
}
if (!empty($data)) {
$this->_content = '<div style="overflow: auto; height: 100%;">';
foreach ($data as $product) {
$this->_content .= '<span style="width: 33%; float: left; text-align: center;">' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $product['keyword']), $osC_Image->show($product['display_image'], $product['name'])) . '<br />' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $product['keyword']), $product['name']) . '<br />' . $product['display_price'] . '</span>';
}
$this->_content .= '</div>';
}
}
示例13: initialize
function initialize()
{
global $osC_Database, $osC_Language, $osC_Product;
if (isset($osC_Product) && is_a($osC_Product, 'osC_Product')) {
$Qmanufacturer = $osC_Database->query('select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image, mi.manufacturers_url from :table_manufacturers m left join :table_manufacturers_info mi on (m.manufacturers_id = mi.manufacturers_id and mi.languages_id = :languages_id), :table_products p where p.products_id = :products_id and p.manufacturers_id = m.manufacturers_id');
$Qmanufacturer->bindTable(':table_manufacturers', TABLE_MANUFACTURERS);
$Qmanufacturer->bindTable(':table_manufacturers_info', TABLE_MANUFACTURERS_INFO);
$Qmanufacturer->bindTable(':table_products', TABLE_PRODUCTS);
$Qmanufacturer->bindInt(':languages_id', $osC_Language->getID());
$Qmanufacturer->bindInt(':products_id', $osC_Product->getID());
$Qmanufacturer->execute();
if ($Qmanufacturer->numberOfRows()) {
$this->_content = '';
if (!osc_empty($Qmanufacturer->value('manufacturers_image'))) {
$this->_content .= '<div style="text-align: center;">' . osc_link_object(osc_href_link(FILENAME_DEFAULT, 'manufacturers=' . $Qmanufacturer->valueInt('manufacturers_id')), osc_image(DIR_WS_IMAGES . 'manufacturers/' . $Qmanufacturer->value('manufacturers_image'), $Qmanufacturer->value('manufacturers_name'))) . '</div>';
}
$this->_content .= '<ol style="list-style: none; margin: 0; padding: 0;">';
if (!osc_empty($Qmanufacturer->value('manufacturers_url'))) {
$this->_content .= '<li>' . osc_link_object(osc_href_link(FILENAME_REDIRECT, 'action=manufacturer&manufacturers_id=' . $Qmanufacturer->valueInt('manufacturers_id')), sprintf($osC_Language->get('box_manufacturer_info_website'), $Qmanufacturer->value('manufacturers_name')), 'target="_blank"') . '</li>';
}
$this->_content .= '<li>' . osc_link_object(osc_href_link(FILENAME_DEFAULT, 'manufacturers=' . $Qmanufacturer->valueInt('manufacturers_id')), $osC_Language->get('box_manufacturer_info_products')) . '</li>';
$this->_content .= '</ol>';
}
}
}
示例14: initialize
function initialize()
{
global $osC_Language, $osC_Template, $toC_Compare_Products;
if ($toC_Compare_Products->hasContents()) {
$osC_Template->addStyleSheet('ext/multibox/multibox.css');
$osC_Template->addJavascriptFilename('ext/multibox/Overlay.js');
$osC_Template->addJavascriptFilename('ext/multibox/MultiBox.js');
$this->_content = '<ul>';
foreach ($toC_Compare_Products->getProducts() as $products_id) {
$osC_Product = new osC_Product($products_id);
$this->_content .= '<li>' . osc_link_object(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), $products_id . '&' . osc_get_all_get_params(array('action')) . '&action=compare_products_remove'), osc_draw_image_button('button_delete_icon.png', $osC_Language->get('button_delete')), 'style="float: right; margin: 0 3px 1px 3px"') . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $products_id), $osC_Product->getTitle()) . '</li>';
}
$this->_content .= '</ul>';
$this->_content .= '<p>' . '<span style="float: right">' . osc_link_object(osc_href_link(FILENAME_JSON, 'module=products&action=compare_products'), osc_draw_image_button('small_compare_now.png', $osC_Language->get('button_compare_now')), 'class="multibox" rel="width:800,height:400,ajax:true"') . '</span>' . osc_link_object(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), osc_get_all_get_params(array('action')) . '&action=compare_products_clear'), osc_draw_image_button('small_clear.png', $osC_Language->get('button_clear'))) . ' ' . '</p>';
$js .= '<script type="text/javascript">
window.addEvent("domready",function() {
var overlay = new Overlay();
var box = new MultiBox(\'multibox\', {
overlay: overlay
});
});
</script>';
$this->_content .= "\n" . $js;
}
}
示例15: initialize
function initialize()
{
global $osC_Database, $osC_Services, $osC_Language, $osC_Currencies, $osC_Image, $osC_Specials, $current_category_id;
if ($current_category_id < 1) {
$Qnewproducts = $osC_Database->query('select p.products_id, p.products_tax_class_id, p.products_price, pd.products_name, pd.products_keyword, i.image from :table_products p left join :table_products_images i on (p.products_id = i.products_id and i.default_flag = :default_flag), :table_products_description pd where p.products_status = 1 and p.products_id = pd.products_id and pd.language_id = :language_id order by p.products_date_added desc limit :max_display_new_products');
} else {
$Qnewproducts = $osC_Database->query('select distinct p.products_id, p.products_tax_class_id, p.products_price, pd.products_name, pd.products_keyword, i.image from :table_products p left join :table_products_images i on (p.products_id = i.products_id and i.default_flag = :default_flag), :table_products_description pd, :table_products_to_categories p2c, :table_categories c where c.parent_id = :parent_id and c.categories_id = p2c.categories_id and p2c.products_id = p.products_id and p.products_status = 1 and p.products_id = pd.products_id and pd.language_id = :language_id order by p.products_date_added desc limit :max_display_new_products');
$Qnewproducts->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
$Qnewproducts->bindTable(':table_categories', TABLE_CATEGORIES);
$Qnewproducts->bindInt(':parent_id', $current_category_id);
}
$Qnewproducts->bindTable(':table_products', TABLE_PRODUCTS);
$Qnewproducts->bindTable(':table_products_images', TABLE_PRODUCTS_IMAGES);
$Qnewproducts->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
$Qnewproducts->bindInt(':default_flag', 1);
$Qnewproducts->bindInt(':language_id', $osC_Language->getID());
$Qnewproducts->bindInt(':max_display_new_products', MODULE_CONTENT_NEW_PRODUCTS_MAX_DISPLAY);
if (MODULE_CONTENT_NEW_PRODUCTS_CACHE > 0) {
$Qnewproducts->setCache('new_products-' . $osC_Language->getCode() . '-' . $osC_Currencies->getCode() . '-' . $current_category_id, MODULE_CONTENT_NEW_PRODUCTS_CACHE);
}
$Qnewproducts->execute();
if ($Qnewproducts->numberOfRows()) {
$i = 0;
while ($Qnewproducts->next()) {
if ($i % 3 == 0 && $i != 0) {
$this->_content .= '<div style="clear:both"></div>';
}
$product = new osC_Product($Qnewproducts->valueInt('products_id'));
$this->_content .= '<div style="margin-top: 10px; float:left; width: 33%; text-align: center">' . '<span style="display:block; height: 32px; text-align: center">' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qnewproducts->value('products_id')), $Qnewproducts->value('products_name')) . '</span>' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qnewproducts->value('products_id')), $osC_Image->show($Qnewproducts->value('image'), $Qnewproducts->value('products_name')), 'id="productImage' . $Qnewproducts->value('products_id') . '"') . '<span style="display:block; padding: 3px; text-align: center">' . $product->getPriceFormated(true) . '</span>' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qnewproducts->valueInt('products_id') . '&action=cart_add'), osc_draw_image_button('button_add_to_cart.png', $osC_Language->get('button_add_to_cart'), 'class="ajaxAddToCart" id="ac_newproductsmodule_' . $Qnewproducts->value('products_id') . '"')) . '</div>';
$i++;
}
$this->_content .= '<div style="clear:both"></div>';
}
$Qnewproducts->freeResult();
}