Example #1
0
 function osC_Index_Manufacturers()
 {
     global $osC_Services, $osC_Language, $osC_Breadcrumb, $osC_Manufacturer;
     $this->_page_title = sprintf($osC_Language->get('index_heading'), STORE_NAME);
     if (is_numeric($_GET[$this->_module])) {
         include 'includes/classes/manufacturer.php';
         $osC_Manufacturer = new osC_Manufacturer($_GET[$this->_module]);
         if ($osC_Services->isStarted('breadcrumb')) {
             $osC_Breadcrumb->add($osC_Manufacturer->getTitle(), osc_href_link(FILENAME_DEFAULT, $this->_module . '=' . $_GET[$this->_module]));
         }
         $this->_page_title = $osC_Manufacturer->getTitle();
         $this->_page_image = 'manufacturers/' . $osC_Manufacturer->getImage();
         $this->_process();
     } else {
         $this->_page_contents = 'index.php';
     }
 }
 function osC_Index_Manufacturers()
 {
     global $osC_Services, $osC_Language, $breadcrumb, $osC_Manufacturer;
     $this->_page_title = sprintf($osC_Language->get('index_heading'), STORE_NAME);
     if (is_numeric($_GET[$this->_module])) {
         include 'includes/classes/manufacturer.php';
         $osC_Manufacturer = new osC_Manufacturer($_GET[$this->_module]);
         if ($osC_Services->isStarted('breadcrumb')) {
             $breadcrumb->add($osC_Manufacturer->getTitle(), osc_href_link(FILENAME_DEFAULT, $this->_module . '=' . $_GET[$this->_module]));
         }
         $this->_page_title = $osC_Manufacturer->getTitle();
         $this->_page_image = 'manufacturers/' . $osC_Manufacturer->getImage();
         $page_title = $osC_Manufacturer->getPageTitle();
         if (!empty($page_title)) {
             $this->setMetaPageTitle($page_title);
         }
         $meta_keywords = $osC_Manufacturer->getMetaKeywords();
         if (!empty($meta_keywords)) {
             $this->addPageTags('keywords', $meta_keywords);
         }
         $meta_description = $osC_Manufacturer->getMetaDescription();
         if (!empty($meta_description)) {
             $this->addPageTags('description', $meta_description);
         }
         $this->_process();
     } else {
         $this->_page_contents = 'index.php';
     }
 }
Example #3
0
 function osC_Products_Products()
 {
     global $osC_Database, $osC_Services, $osC_Session, $osC_Language, $breadcrumb, $cPath, $cPath_array, $osC_Manufacturer, $osC_Product;
     if (empty($_GET) === false) {
         $id = false;
         // PHP < 5.0.2; array_slice() does not preserve keys and will not work with numerical key values, so foreach() is used
         foreach ($_GET as $key => $value) {
             if ((ereg('^[0-9]+(_?([0-9]+:?[0-9]+)+(;?([0-9]+:?[0-9]+)+)*)*$', $key) || ereg('^[a-zA-Z0-9 -_]*$', $key)) && $key != $osC_Session->getName()) {
                 $id = $key;
             }
             break;
         }
         if (strpos($id, '_') !== false) {
             $id = str_replace('_', '#', $id);
         }
         if ($id !== false && osC_Product::checkEntry($id)) {
             $osC_Product = new osC_Product($id);
             $osC_Product->incrementCounter();
             $this->_page_title = $osC_Product->getTitle();
             $this->addPageTags('keywords', $osC_Product->getTitle());
             $this->addPageTags('keywords', $osC_Product->getSKU());
             if ($osC_Product->hasPageTitle()) {
                 $this->setMetaPageTitle($osC_Product->getPageTitle());
             }
             if ($osC_Product->hasTags()) {
                 $this->addPageTags('keywords', $osC_Product->getTags());
             }
             if ($osC_Product->hasMetaKeywords()) {
                 $this->addPageTags('keywords', $osC_Product->getMetaKeywords());
             }
             if ($osC_Product->hasMetaDescription()) {
                 $this->addPageTags('description', $osC_Product->getMetaDescription());
             }
             osC_Services_category_path::process($osC_Product->getCategoryID());
             if (isset($_GET['manufacturers']) && empty($_GET['manufacturers']) === false) {
                 require_once 'includes/classes/manufacturer.php';
                 $osC_Manufacturer = new osC_Manufacturer($_GET['manufacturers']);
                 if ($osC_Services->isStarted('breadcrumb')) {
                     $breadcrumb->add($osC_Manufacturer->getTitle(), osc_href_link(FILENAME_DEFAULT, 'manufacturers=' . $_GET['manufacturers']));
                     $breadcrumb->add($osC_Product->getTitle(), osc_href_link(FILENAME_PRODUCTS, $osC_Product->getID()));
                 }
                 //Using rel=”canonical” links to remove the duplication - same product info page
                 //To fix the bug - [#123] Two Different SEO link for one product
                 if (isset($osC_Services) && $osC_Services->isStarted('sefu')) {
                     $this->_add_canonical($osC_Product->getID());
                 }
             } else {
                 if ($osC_Services->isStarted('breadcrumb')) {
                     $Qcategories = $osC_Database->query('select categories_id, categories_name from :table_categories_description where categories_id in (:categories_id) and language_id = :language_id');
                     $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);
                     $Qcategories->bindRaw(':categories_id', implode(',', $cPath_array));
                     $Qcategories->bindInt(':language_id', $osC_Language->getID());
                     $Qcategories->execute();
                     $categories = array();
                     while ($Qcategories->next()) {
                         $categories[$Qcategories->value('categories_id')] = $Qcategories->valueProtected('categories_name');
                     }
                     $Qcategories->freeResult();
                     for ($i = 0, $n = sizeof($cPath_array); $i < $n; $i++) {
                         $breadcrumb->add($categories[$cPath_array[$i]], osc_href_link(FILENAME_DEFAULT, 'cPath=' . implode('_', array_slice($cPath_array, 0, $i + 1))));
                     }
                     $breadcrumb->add($osC_Product->getTitle(), osc_href_link(FILENAME_PRODUCTS, $osC_Product->getID()));
                 }
             }
             $this->addStyleSheet('ext/mojozoom/mojozoom.css');
             $this->addStyleSheet('templates/' . $this->getCode() . '/javascript/milkbox/milkbox.css');
         } else {
             $this->_page_title = $osC_Language->get('product_not_found_heading');
             $this->_page_contents = 'info_not_found.php';
         }
     } else {
         $this->_page_title = $osC_Language->get('product_not_found_heading');
         $this->_page_contents = 'info_not_found.php';
     }
 }
Example #4
0
 function getManufacturer()
 {
     if (!class_exists('osC_Manufacturer')) {
         include 'includes/classes/manufacturer.php';
     }
     $osC_Manufacturer = new osC_Manufacturer($this->_data['manufacturers_id']);
     return $osC_Manufacturer->getTitle();
 }