Beispiel #1
0
 function isExternalReferrer(&$request)
 {
     if ($referrer = $request->get('HTTP_REFERER')) {
         $home = SCRIPT_NAME;
         // was SERVER_URL, check sister wiki's: same host but other other script url
         if (substr(strtolower($referrer), 0, strlen($home)) == strtolower($home)) {
             return false;
         }
         require_once "lib/ExternalReferrer.php";
         $se = new SearchEngines();
         return $se->parseSearchQuery($referrer);
     }
     return false;
 }
Beispiel #2
0
 public function createHead()
 {
     $head = new Head();
     $head->addChild($this->getTitleTag());
     $head->addChild("\n            <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>\n            <meta name='viewport' content='width=device-width, initial-scale=1'>\n            <meta name='robots' content='index, follow'>\n            <meta http-equiv='X-UA-Compatible' content='IE=edge' />\n\t\t\t<link rel='stylesheet' type='text/css' href='/src/front/style/style.css'/>\n            <link rel='stylesheet' type='text/css' href='/src/front/style/line-items.css'/>\n            <link rel='stylesheet' type='text/css' href='/src/front/style/style-less.css' title='main'/>\n            <link rel='stylesheet' type='text/css' href='/src/front/style/animate-animo.min.css'/>\n            <link rel='shortcut icon' href='images/system/favicon.ico' type='image/x-icon'/>\n            <script type='text/javascript' src='/src/front/js/ext/jquery-2.1.4.min.js'></script>\n            <script type='text/javascript' src='/src/front/js/ext/jquery.actual.min.js'></script>\n            <script type='text/javascript' src='/src/front/js/ext/jquery.imageloader.js'></script>\n            <script type='text/javascript' src='/src/front/js/ext/require.js'></script>\n            <script>\n              require(['/src/front/js/require.config.js'], function(){\n                require(['./components/components.module'])\n              });\n            </script>\n            <script type='text/javascript' src='/src/front/js/ext/animo.min.js'></script>\n            <script type='text/javascript' src='/src/front/js/custom.js'></script>\n            <script type='text/javascript' src='/src/front/js/v-utils.js'></script>\n            <script type='text/javascript' src='/src/front/js/changePage.js'></script>\n            <script type='text/javascript' src='/src/front/js/preview.js'></script>\n            <script type='text/javascript' src='/src/front/js/utils.js'></script>\n            <script type='text/javascript' src='/src/front/js/components/vCore-imageGallery.js'></script>\n            <script type='text/javascript' src='/src/front/js/components/vCore-popup.js'></script>\n            <script type='text/javascript' src='/src/front/js/components/vCore-imageZoom.js'></script>\n            <script type='text/javascript' src='/src/front/js/components/vCore-effects.js'></script>\n            ");
     $head->addChild(SearchEngines::getGoogleAnalyticScript());
     $head->addChild(SearchEngines::getYandexMetricScript());
     return $head;
 }
 /**
  * Sets an array containing the text for this stat.
  * The indexes should match the indexes in the array returned by
  * {@link #getNumberArray}.
  *
  * This method overwrites the implemention in the super class to provide
  * transformation from internal to display text.
  *
  * @public
  * @version 0.0.1
  * @since 0.0.1
  * @return void
  * @param $engineIds the text array for this stat.
  */
 function setTextArray($engineIds)
 {
     $engines = new SearchEngines();
     $text =& $this->siteGenerator->newElement("text");
     $text->setParagraph(0);
     /*Don't put the text in a paragraphw*/
     $urlWrapper =& $this->siteGenerator->newElement("urlWrapper");
     //Translate the engine ids to urls and names.
     $urlForViewing = $this->siteGenerator->isUrlsForViewing();
     for ($i = 0; $i < sizeof($engineIds); $i++) {
         $engText = "";
         $engineUrls = $engines->getUrls($engineIds[$i]);
         $engineNames = $engines->getNames($engineIds[$i]);
         for ($n = 0; $n < sizeof($engineUrls); $n++) {
             $text->setText($engineNames[$n]);
             $urlWrapper->setWrapped($text);
             $urlWrapper->setTitle($engineUrls[$n]);
             if (!$urlForViewing) {
                 $url = "redir.php?url=" . urlencode($engineUrls[$n]);
             } else {
                 $url = $engineUrls[$n];
             }
             $urlWrapper->setUrl($url);
             if ($n > 0) {
                 $engText .= " / ";
             }
             $engText .= $urlWrapper->getCode();
         }
         /*End for $n...*/
         $engineIds[$i] = $engText;
     }
     /*End for $i...*/
     //Now set the values in the super class method
     GraphStatGenerator::setTextArray($engineIds);
 }
Beispiel #4
0
function isExternalReferrer(&$request)
{
    if ($referrer = $request->get('HTTP_REFERER')) {
        $home = SERVER_URL;
        // SERVER_URL or SCRIPT_NAME, if we want to check sister wiki's also
        if (string_starts_with(strtolower($referrer), strtolower($home))) {
            return false;
        }
        require_once "lib/ExternalReferrer.php";
        $se = new SearchEngines();
        return $se->parseSearchQuery($referrer);
    }
    //if (DEBUG) return array('query' => 'wiki');
    return false;
}
Beispiel #5
0
 public function index()
 {
     // Init variables
     $data = array();
     $breadcrumbs = array();
     $product_info = array();
     $categories = array();
     // Check dependencies
     if (!isset($this->request->get['product_id']) || !($product_info = $this->model_catalog_product->getProduct((int) $this->request->get['product_id'], $this->language->getId(), $this->auth->getId(), ORDER_APPROVED_STATUS_ID))) {
         $this->security_log->write('Try to get product file without product_id parameter' . isset($this->request->get['product_id']) ? (int) $this->request->get['product_id'] : false);
         $this->response->redirect($this->url->link('error/not_found'));
     }
     // Check product status
     switch ($product_info->status) {
         case 'blocked':
             $this->response->redirect($this->url->link('error/not_found'));
             break;
         case 'disabled':
             $this->response->redirect($this->url->link('error/not_found'));
             break;
         default:
     }
     // Add product hit exclude owner's and search bot hits
     if (!$this->auth->isLogged() && !SearchEngines::isBot($this->request->getUserAgent()) || $this->auth->isLogged() && $product_info->user_id != $this->auth->getId()) {
         $this->model_catalog_product->addProductView($product_info->product_id);
     }
     // Misc
     $data['color_labels'] = array('label-default', 'label-primary', 'label-success', 'label-warning', 'label-danger', 'label-info', 'label-default', 'label-primary', 'label-success', 'label-warning', 'label-danger', 'label-info', 'label-default', 'label-primary', 'label-success', 'label-warning', 'label-danger', 'label-info');
     // Breadcrumbs
     $parent_category_id = $product_info->category_id;
     do {
         $parent_category_info = $this->model_catalog_category->getCategory($parent_category_id, $this->language->getId());
         if ($parent_category_info) {
             $parent_category_id = $parent_category_info->parent_category_id;
             $breadcrumbs[] = array('name' => $parent_category_info->title, 'href' => $this->url->link('catalog/category', 'category_id=' . $parent_category_info->category_id), 'active' => false);
             $categories[] = $parent_category_info->title;
         }
     } while ($parent_category_id);
     $breadcrumbs[] = array('name' => tt('Home'), 'href' => $this->url->link('common/home'), 'active' => false);
     array_multisort($breadcrumbs, SORT_ASC, SORT_NUMERIC);
     $breadcrumbs[] = array('name' => $product_info->title, 'href' => $this->url->link('catalog/product', 'product_id=' . $product_info->product_id), 'active' => true);
     // Product data
     $data['product_id'] = $product_info->product_id;
     $data['product_title'] = $product_info->title;
     $data['product_username'] = $product_info->username;
     $data['product_sales'] = $product_info->sales;
     $data['product_status'] = $product_info->status;
     $data['product_is_self'] = $product_info->user_id == $this->auth->getId() ? true : false;
     $data['user_is_logged'] = $this->auth->isLogged() ? true : false;
     $data['verified'] = $product_info->verified;
     $image_info = $this->model_catalog_product->getProductImageInfo($product_info->main_product_image_id);
     $data['product_image_url'] = $this->cache->image($product_info->main_product_image_id, $product_info->user_id, 350, 1000, $image_info->watermark, false, true);
     $data['product_image_orig_url'] = $this->cache->image($product_info->main_product_image_id, $product_info->user_id, 570, 1000, $image_info->watermark, false, true);
     $data['product_image_id'] = $product_info->main_product_image_id;
     switch ($product_info->order_status_id) {
         case ORDER_APPROVED_STATUS_ID:
             $data['product_order_status'] = 'approved';
             break;
         case ORDER_PROCESSED_STATUS_ID:
             $data['product_order_status'] = 'processed';
             break;
         default:
             $data['product_order_status'] = $product_info->user_id == $this->auth->getId() ? 'approved' : false;
     }
     $data['product_demo'] = $product_info->main_product_demo_id ? true : false;
     $data['product_favorites'] = $product_info->favorites ? $product_info->favorites : false;
     $data['product_favorite'] = $product_info->favorite;
     $data['product_description'] = nl2br($product_info->description);
     $data['product_href_view'] = $this->url->link('catalog/product', 'product_id=' . $product_info->product_id);
     $data['product_href_download'] = $this->url->link('catalog/product/download', 'product_id=' . $product_info->product_id);
     $data['product_href_demo'] = $this->url->link('catalog/product/demo', 'product_demo_id=' . $product_info->main_product_demo_id);
     $data['product_href_user'] = $this->url->link('catalog/search', 'user_id=' . $product_info->user_id);
     $data['product_date_added'] = date(tt('d.m.Y'), strtotime($product_info->date_added));
     $data['product_date_modified'] = date(tt('d.m.Y'), strtotime($product_info->date_modified));
     $data['product_demos'] = array();
     foreach ($this->model_catalog_product->getProductDemos($product_info->product_id, $this->language->getId()) as $demo) {
         if (!$demo->main) {
             $data['product_demos'][] = array('title' => $demo->title, 'url' => $this->url->link('catalog/product/demo', 'product_demo_id=' . $demo->product_demo_id));
         }
     }
     $data['product_images'] = array();
     foreach ($this->model_catalog_product->getProductImages($product_info->product_id, $this->language->getId()) as $image) {
         if (!$image->main) {
             $data['product_images'][] = array('title' => $image->title, 'preview' => $this->cache->image($image->product_image_id, $product_info->user_id, 50, 50), 'original' => $this->cache->image($image->product_image_id, $product_info->user_id, 570, 1000, $image->watermark, false, true));
         }
     }
     $data['product_videos'] = array();
     foreach ($this->model_catalog_product->getProductVideos($product_info->product_id, $this->language->getId()) as $video) {
         $data['product_videos'][] = array('title' => $video->title, 'ogg' => $this->cache->video($video->product_video_id, $product_info->user_id, 'ogv', false, $video->reduce ? PRODUCT_VIDEO_REDUCED_QUALITY : PRODUCT_VIDEO_QUALITY), 'mp4' => $this->cache->video($video->product_video_id, $product_info->user_id, 'mp4', false, $video->reduce ? PRODUCT_VIDEO_REDUCED_QUALITY : PRODUCT_VIDEO_QUALITY));
     }
     $data['product_audios'] = array();
     foreach ($this->model_catalog_product->getProductAudios($product_info->product_id, $this->language->getId()) as $audio) {
         $data['product_audios'][] = array('title' => $audio->title, 'ogg' => $this->cache->audio($audio->product_audio_id, $product_info->user_id, 'oga', false, $audio->cut ? PRODUCT_AUDIO_CUT_TIME : 0), 'mp3' => $this->cache->audio($audio->product_audio_id, $product_info->user_id, 'mp3', false, $audio->cut ? PRODUCT_AUDIO_CUT_TIME : 0));
     }
     $meta_tags = array();
     $data['product_tags'] = array();
     foreach ($this->model_catalog_product->getProductTags($product_info->product_id, $this->language->getId()) as $tag) {
         $meta_tags[] = $tag->name;
         $data['product_tags'][] = array('name' => $tag->name, 'url' => $this->url->link('catalog/search', 'q=' . urlencode($tag->name)));
     }
     // Prepare special counter
     if ($product_info->special_date_end) {
         $special_left_seconds = strtotime($product_info->special_date_end) - time();
         $special_left_minutes = floor($special_left_seconds / 60);
         $special_left_hours = floor($special_left_minutes / 60);
         $special_left_days = floor($special_left_hours / 24);
         if ($special_left_minutes < 60) {
             $special_expires = sprintf(tt('%s %s left'), $special_left_minutes, plural($special_left_minutes, array(tt('minute'), tt('minutes'), tt('minutes '))));
         } else {
             if ($special_left_hours < 24) {
                 $special_expires = sprintf(tt('%s %s left'), $special_left_hours, plural($special_left_hours, array(tt('hour'), tt('hours'), tt('hours '))));
             } else {
                 $special_expires = sprintf(tt('%s %s left'), $special_left_days, plural($special_left_days, array(tt('day'), tt('days'), tt('days '))));
             }
         }
     } else {
         $special_expires = false;
     }
     $data['product_special_expires'] = $special_expires;
     $data['product_special_regular_price'] = $product_info->special_regular_price > 0 ? $this->currency->format($product_info->special_regular_price, $product_info->currency_id) : 0;
     $data['product_special_exclusive_price'] = $product_info->special_exclusive_price > 0 ? $this->currency->format($product_info->special_exclusive_price, $product_info->currency_id) : 0;
     $data['product_regular_price'] = $this->currency->format($product_info->regular_price, $product_info->currency_id);
     $data['product_exclusive_price'] = $this->currency->format($product_info->exclusive_price, $product_info->currency_id);
     $data['product_has_regular_price'] = $product_info->regular_price > 0 ? true : false;
     $data['product_has_exclusive_price'] = $product_info->exclusive_price > 0 ? true : false;
     $data['product_has_special_regular_price'] = $product_info->special_regular_price > 0 ? true : false;
     $data['product_has_special_exclusive_price'] = $product_info->special_exclusive_price > 0 ? true : false;
     $data['license_form_action'] = $this->url->link('catalog/product', 'product_id=' . $product_info->product_id);
     $data['current_license_code'] = 'regular';
     $data['regular'] = true;
     $data['exclusive'] = 0 == $product_info->regular_price && 0 == $product_info->special_regular_price ? true : false;
     if ('POST' == $this->request->getRequestMethod()) {
         switch ($this->request->post['license']) {
             case 'exclusive':
                 $data['regular'] = false;
                 $data['exclusive'] = true;
                 $data['current_license_code'] = 'exclusive';
                 break;
             default:
                 $data['regular'] = true;
                 $data['exclusive'] = false;
         }
     }
     // Get license conditions
     $licenses = $this->model_common_license->getLicenses($this->language->getId());
     $data['licenses'] = array();
     foreach ($licenses as $license) {
         // Get license conditions
         $license_conditions = $this->model_common_license->getLicenseConditions($license->license_id, $this->language->getId());
         $conditions = array();
         foreach ($license_conditions as $license_condition) {
             if ($license_condition->optional) {
                 $condition = sprintf($license_condition->condition, $this->model_catalog_product->getLicenseConditionValue($product_info->product_id, $license_condition->license_condition_id) ? tt('may') : tt('shall not'));
                 $conditions[$license_condition->license_condition_id] = highlight_license_condition($condition, tt('may'), tt('shall not'));
             } else {
                 $conditions[$license_condition->license_condition_id] = highlight_license_condition($license_condition->condition, tt('may'), tt('shall not'));
             }
         }
         // Merge
         if ($license->code == $data['current_license_code']) {
             $data['licenses'][$license->license_id] = array('name' => $license->name . ' ' . tt('License'), 'description' => $license->description, 'conditions' => $conditions);
         }
     }
     // Add meta-tags
     $this->document->setTitle(sprintf(tt('%s Buy with BitCoin'), $product_info->title) . ' | ' . implode(' ', $categories));
     $this->document->setDescription(sprintf(tt('Royalty-free %s %s by %s with BitCoin. %s. Buy with BTC easy - Download instantly!'), $categories[0], $product_info->title, $product_info->username, FilterMeta::description($product_info->description, 100), implode(' and ', $categories)));
     $this->document->setKeywords(sprintf(tt('bitsybay, bitcoin, btc, indie, marketplace, store, buy, sell, royalty-free, %s, %s, %s'), $product_info->username, strtolower(implode(', ', $categories)), implode(', ', $meta_tags)));
     // Add schema
     $this->document->addSchema('Product', 'name', $product_info->title);
     $this->document->addSchema('Product', 'description', FilterMeta::description($product_info->description));
     $this->document->addSchema('Product', 'category', $categories[0]);
     $this->document->addSchema('Product', 'image', $data['product_image_orig_url']);
     $this->document->addSchema('Offer', 'seller', $product_info->username);
     $this->document->addSchema('Offer', 'category', $categories[0]);
     $this->document->addSchema('Offer', 'availability', 'in_stock');
     $this->document->addSchema('Offer', 'priceCurrency', $this->currency->getCode());
     $this->document->addSchema('Offer', 'price', $product_info->special_regular_price > 0 ? $product_info->special_regular_price : $product_info->regular_price);
     // Add Open Graph
     $this->document->addOpenGraph('og:site_name', PROJECT_NAME);
     $this->document->addOpenGraph('og:type', 'product');
     $this->document->addOpenGraph('og:url', $this->url->getCurrentLink());
     $this->document->addOpenGraph('og:name', $product_info->title);
     $this->document->addOpenGraph('og:brand', $product_info->username);
     $this->document->addOpenGraph('og:image', $data['product_image_orig_url']);
     $this->document->addOpenGraph('og:description', FilterMeta::description($product_info->description));
     $this->document->addOpenGraph('og:updated_time', $product_info->date_modified);
     $this->document->addOpenGraph('product:original_price:amount', $product_info->special_regular_price > 0 ? $product_info->special_regular_price : $product_info->regular_price);
     $this->document->addOpenGraph('product:original_price:currency', $this->currency->getCode());
     $this->document->addOpenGraph('product:availability', 'instock');
     $this->document->addOpenGraph('product:category', $categories[0]);
     // Load layout
     $data['title'] = $product_info->title;
     $data['alert_warning'] = $this->load->controller('common/alert/warning');
     $data['alert_success'] = $this->load->controller('common/alert/success');
     $data['alert_danger'] = $this->load->controller('common/alert/danger');
     $data['footer'] = $this->load->controller('common/footer');
     $data['header'] = $this->load->controller('common/header');
     $data['module_breadcrumbs'] = $this->load->controller('module/breadcrumbs', $breadcrumbs);
     // Renter the template
     $this->response->setOutput($this->load->view('catalog/product.tpl', $data));
 }
Beispiel #6
0
 public function index()
 {
     // Init variables
     $data = array();
     $breadcrumbs = array();
     $product_info = array();
     $categories = array();
     // Check dependencies
     if (!isset($this->request->get['product_id']) || !($product_info = $this->model_catalog_product->getProduct((int) $this->request->get['product_id'], $this->auth->getId(), ORDER_APPROVED_STATUS_ID))) {
         $this->security_log->write('Try to get product file without product_id parameter');
         $this->response->redirect($this->url->link('error/not_found'));
     }
     // Check product status
     switch ($product_info->status) {
         case 'blocked':
             $this->response->redirect($this->url->link('error/not_found'));
             break;
         case 'disabled':
             $this->response->redirect($this->url->link('error/not_found'));
             break;
         default:
     }
     // Add product hit exclude owner's and search bot hits
     if (!$this->auth->isLogged() && !SearchEngines::isBot($this->request->getUserAgent()) || $this->auth->isLogged() && $product_info->user_id != $this->auth->getId()) {
         $this->model_catalog_product->addProductView($product_info->product_id);
     }
     // Misc
     $data['color_labels'] = array('label-default', 'label-primary', 'label-success', 'label-warning', 'label-danger', 'label-info', 'label-default', 'label-primary', 'label-success', 'label-warning', 'label-danger', 'label-info', 'label-default', 'label-primary', 'label-success', 'label-warning', 'label-danger', 'label-info');
     // Breadcrumbs
     $parent_category_id = $product_info->category_id;
     do {
         $parent_category_info = $this->model_catalog_category->getCategory($parent_category_id, $this->language->getId());
         if ($parent_category_info) {
             $parent_category_id = $parent_category_info->parent_category_id;
             $breadcrumbs[] = array('name' => $parent_category_info->title, 'href' => $this->url->link('catalog/category', 'category_id=' . $parent_category_info->category_id, 'SSL'), 'active' => false);
             $categories[] = $parent_category_info->title;
         }
     } while ($parent_category_id);
     $breadcrumbs[] = array('name' => tt('Home'), 'href' => $this->url->link('common/home'), 'active' => false);
     array_multisort($breadcrumbs, SORT_ASC, SORT_NUMERIC);
     $breadcrumbs[] = array('name' => $product_info->title, 'href' => $this->url->link('catalog/product', 'product_id=' . $product_info->product_id), 'active' => true);
     // Product data
     $data['product_id'] = $product_info->product_id;
     $data['product_title'] = $product_info->title;
     $data['product_username'] = $product_info->username;
     $data['product_sales'] = $product_info->sales;
     $data['product_status'] = $product_info->status;
     $data['product_is_self'] = $product_info->user_id == $this->auth->getId() ? true : false;
     $data['user_is_logged'] = $this->auth->isLogged() ? true : false;
     $image_info = $this->model_catalog_product->getProductImageInfo($product_info->main_product_image_id);
     $data['product_image_url'] = $this->cache->image($product_info->main_product_image_id, $product_info->user_id, 350, 350, $image_info->watermark);
     $data['product_image_orig_url'] = $this->cache->image($product_info->main_product_image_id, $product_info->user_id, 570, 570, $image_info->watermark);
     $data['product_image_id'] = $product_info->main_product_image_id;
     switch ($product_info->order_status_id) {
         case ORDER_APPROVED_STATUS_ID:
             $data['product_order_status'] = 'approved';
             break;
         case ORDER_PROCESSED_STATUS_ID:
             $data['product_order_status'] = 'processed';
             break;
         default:
             $data['product_order_status'] = $product_info->user_id == $this->auth->getId() ? 'approved' : false;
     }
     $data['product_demo'] = $product_info->main_product_demo_id ? true : false;
     $data['product_favorites'] = $product_info->favorites ? $product_info->favorites : false;
     $data['product_favorite'] = $product_info->favorite;
     $data['product_description'] = nl2br($product_info->description);
     $data['product_license_title'] = $product_info->license_title;
     $data['product_license_description'] = nl2br($product_info->license_description);
     $data['product_href_view'] = $this->url->link('catalog/product', 'product_id=' . $product_info->product_id);
     $data['product_href_download'] = $this->url->link('catalog/product/download', 'product_id=' . $product_info->product_id);
     $data['product_href_demo'] = $this->url->link('catalog/product/demo', 'product_demo_id=' . $product_info->main_product_demo_id);
     $data['product_href_user'] = $this->url->link('catalog/search', 'user_id=' . $product_info->user_id);
     $data['product_date_added'] = date(DATE_FORMAT_DEFAULT, strtotime($product_info->date_added));
     $data['product_date_modified'] = date(DATE_FORMAT_DEFAULT, strtotime($product_info->date_modified));
     $data['product_demos'] = array();
     foreach ($this->model_catalog_product->getProductDemos($product_info->product_id, $this->language->getId()) as $demo) {
         if (!$demo->main) {
             $data['product_demos'][] = array('title' => $demo->title, 'url' => $this->url->link('catalog/product/demo', 'product_demo_id=' . $demo->product_demo_id));
         }
     }
     $data['product_images'] = array();
     foreach ($this->model_catalog_product->getProductImages($product_info->product_id, $this->language->getId()) as $image) {
         if (!$image->main) {
             $data['product_images'][] = array('title' => $image->title, 'preview' => $this->cache->image($image->product_image_id, $product_info->user_id, 50, 50), 'original' => $this->cache->image($image->product_image_id, $product_info->user_id, 570, 570, $image->watermark));
         }
     }
     $data['product_videos'] = array();
     foreach ($this->model_catalog_product->getProductVideos($product_info->product_id, $this->language->getId()) as $video) {
         $data['product_videos'][] = array('title' => $video->title, 'url' => $video->iframe_url . $video->id);
     }
     $data['product_tags'] = array();
     foreach ($this->model_catalog_product->getProductTags($product_info->product_id, $this->language->getId()) as $tag) {
         $data['product_tags'][] = array('name' => $tag->name, 'url' => $this->url->link('catalog/search', 'q=' . urlencode($tag->name)));
     }
     // Prepare special counter
     if ($product_info->special_date_end) {
         $special_left_seconds = strtotime($product_info->special_date_end) - time();
         $special_left_minutes = floor($special_left_seconds / 60);
         $special_left_hours = floor($special_left_minutes / 60);
         $special_left_days = floor($special_left_hours / 24);
         if ($special_left_minutes < 60) {
             $special_expires = sprintf(tt('%s %s left'), $special_left_minutes, plural($special_left_minutes, array(tt('minute'), tt('minutes'), tt('minutes'))));
         } else {
             if ($special_left_hours < 24) {
                 $special_expires = sprintf(tt('%s %s left'), $special_left_hours, plural($special_left_hours, array(tt('hour'), tt('hours'), tt('hours'))));
             } else {
                 $special_expires = sprintf(tt('%s %s left'), $special_left_days, plural($special_left_days, array(tt('day'), tt('days'), tt('days'))));
             }
         }
     } else {
         $special_expires = false;
     }
     $data['product_special_expires'] = $special_expires;
     $data['product_special_regular_price'] = $product_info->special_regular_price > 0 ? $this->currency->format($product_info->special_regular_price, $product_info->currency_id) : 0;
     $data['product_special_exclusive_price'] = $product_info->special_exclusive_price > 0 ? $this->currency->format($product_info->special_exclusive_price, $product_info->currency_id) : 0;
     $data['product_regular_price'] = $this->currency->format($product_info->regular_price, $product_info->currency_id);
     $data['product_exclusive_price'] = $this->currency->format($product_info->exclusive_price, $product_info->currency_id);
     $data['product_has_regular_price'] = $product_info->regular_price > 0 ? true : false;
     $data['product_has_exclusive_price'] = $product_info->exclusive_price > 0 ? true : false;
     $data['product_has_special_regular_price'] = $product_info->special_regular_price > 0 ? true : false;
     $data['product_has_special_exclusive_price'] = $product_info->special_exclusive_price > 0 ? true : false;
     $data['license_form_action'] = $this->url->link('catalog/product', 'product_id=' . $product_info->product_id);
     $data['regular'] = true;
     $data['exclusive'] = 0 == $product_info->regular_price && 0 == $product_info->special_regular_price ? true : false;
     if ('POST' == $this->request->getRequestMethod()) {
         switch ($this->request->post['license']) {
             case 'exclusive':
                 $data['regular'] = false;
                 $data['exclusive'] = true;
                 break;
             default:
                 $data['regular'] = true;
                 $data['exclusive'] = false;
         }
     }
     // Create SEO titles
     array_multisort($categories, SORT_ASC, SORT_NUMERIC);
     $this->document->setTitle(sprintf(tt('Buy %s with BitCoin'), $product_info->title) . ' | ' . implode(' ', $categories));
     // Load layout
     $data['title'] = $product_info->title;
     $data['alert_warning'] = $this->load->controller('common/alert/warning');
     $data['alert_success'] = $this->load->controller('common/alert/success');
     $data['alert_danger'] = $this->load->controller('common/alert/danger');
     $data['footer'] = $this->load->controller('common/footer');
     $data['header'] = $this->load->controller('common/header');
     $data['module_breadcrumbs'] = $this->load->controller('module/breadcrumbs', $breadcrumbs);
     // Renter the template
     $this->response->setOutput($this->load->view('catalog/product.tpl', $data));
 }