protected function index($setting) { $this->language->load('module/news_latest'); $this->data['heading_title'] = $this->language->get('heading_title'); $this->data['button_cart'] = $this->language->get('button_cart'); $this->load->model('catalog/news'); $this->load->model('tool/image'); $this->data['news'] = array(); $data = array('sort' => 'n.date_added', 'order' => 'DESC', 'start' => 0, 'limit' => $setting['limit']); $results = $this->model_catalog_news->getNewss($data); foreach ($results as $result) { $width = ''; $height = ''; if ($result['image']) { $image = $this->model_tool_image->onesize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height')); } else { $firstImgnews = catchFirstImage(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')); if ($firstImgnews == 'no_image.jpg') { $image = $this->model_tool_image->onesize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height')); } else { $image = $firstImgnews; $width = 'width="' . $this->config->get('config_image_product_width') . '"'; $height = 'height="' . $this->config->get('config_image_product_height') . '"'; } } $this->data['news'][] = array('news_id' => $result['news_id'], 'thumb' => $image, 'name' => $result['name'], 'date_added' => date('D, ' . $this->language->get('date_format_short'), strtotime($result['date_added'])), 'width' => $width, 'height' => $height, 'viewed' => sprintf($this->language->get('text_viewed'), (int) $result['viewed']), 'href' => $this->url->link('news/news', 'news_id=' . $result['news_id'])); } if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/news_latest.tpl')) { $this->template = $this->config->get('config_template') . '/template/module/news_latest.tpl'; } else { $this->template = 'default/template/module/news_latest.tpl'; } $this->render(); }
protected function index($setting) { $this->language->load('module/news_latest'); $this->data['heading_title'] = $this->language->get('heading_title'); $this->data['button_cart'] = $this->language->get('button_cart'); $this->load->model('catalog/news'); $this->load->model('tool/image'); $this->load->model('catalog/common_menu'); $this->data['news'] = array(); $attr = array('limit' => 5, 'image_width' => 80, 'image_height' => 80); $setting = array_merge($setting, $attr); $check_news = $this->model_catalog_news->checkDisplay($setting['id'], $setting['type']); $link = explode('/', $_SERVER['REQUEST_URI']); $keyword = $link[1]; $check_category = $this->model_catalog_common_menu->checkAliasCat($keyword); if (isset($check_category['query'])) { $key_word = explode('=', $check_category['query']); $category_id = explode($key_word[0] . '=', $check_category['query']); if (isset($check_news['category']) && $category_id[1] == $check_news['category']) { $data = array('sort' => 'n.date_added', 'order' => 'DESC', 'start' => 0, 'limit' => $setting['limit']); $results = $this->model_catalog_news->getNewss($data); foreach ($results as $result) { $width = ''; $height = ''; if ($result['image']) { $image = $this->model_tool_image->onesize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height')); } else { $firstImgnews = catchFirstImage(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')); if ($firstImgnews == 'no_image.jpg') { $image = $this->model_tool_image->onesize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height')); } else { $image = $firstImgnews; $width = 'width="' . $this->config->get('config_image_product_width') . '"'; $height = 'height="' . $this->config->get('config_image_product_height') . '"'; } } $this->data['news'][] = array('news_id' => $result['news_id'], 'thumb' => $image, 'name' => $result['name'], 'date_added' => date('D, ' . $this->language->get('date_format_short'), strtotime($result['date_added'])), 'width' => $width, 'height' => $height, 'viewed' => sprintf($this->language->get('text_viewed'), (int) $result['viewed']), 'href' => $this->url->link('news/news', 'news_id=' . $result['news_id'])); } if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/common_news.tpl')) { $this->template = $this->config->get('config_template') . '/template/module/common_news.tpl'; } $this->render(); } } }
<div class="content-full"> <div class="content-poster"> <h1><?php echo get_the_title(); ?> </h1> <?php if (has_post_thumbnail()) { the_post_thumbnail('full'); } else { ?> <img src="<?php echo catchFirstImage(); ?> " title="<?php the_title(); ?> " alt="<?php the_title(); ?> " /> <?php } ?> <?php if (get_field('dl_from_site')) {
public function index() { $this->load->model('catalog/news_category'); $this->language->load('news/all'); $this->language->load('news/news'); $this->load->model('catalog/news'); $this->load->model('catalog/news_comment'); $this->load->model('tool/image'); if (isset($this->request->get['page'])) { $page = $this->request->get['page']; } else { $page = 1; } if (isset($this->request->get['limit'])) { $limit = $this->request->get['limit']; } else { $limit = $this->config->get('config_catalog_limit'); } $this->data['breadcrumbs'] = array(); $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home'), 'separator' => false); $data = array('sort' => 'n.date_added', 'order' => 'DESC', 'start' => ($page - 1) * $limit, 'limit' => $limit); $news_total = $this->model_catalog_news->getTotalNewss($data); if ($news_total > 0) { $this->document->setTitle($this->language->get('text_news')); $this->document->setDescription($this->language->get('text_description')); $this->document->setKeywords($this->language->get('text_keywords')); $this->document->addLink($this->url->link('news/all'), 'canonical'); $this->data['heading_title'] = $this->language->get('text_news'); $this->data['text_news'] = $this->language->get('text_news'); $this->data['text_h1'] = $this->language->get('text_h1'); $this->data['text_sendnews'] = $this->language->get('text_sendnews'); $this->data['text_empty'] = $this->language->get('text_empty'); $this->data['text_display'] = $this->language->get('text_display'); $this->data['text_limit'] = $this->language->get('text_limit'); $this->data['text_post_on'] = $this->language->get('text_post_on'); $this->data['text_viewed'] = $this->language->get('text_viewed'); $this->data['sendnews'] = $this->url->link('news/send'); $this->data['button_continue'] = $this->language->get('button_continue'); $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_news'), 'href' => $this->url->link('news/all'), 'separator' => $this->language->get('text_separator')); $url = ''; if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $this->data['news'] = array(); $results = $this->model_catalog_news->getNewss($data); foreach ($results as $result) { $width = ''; $height = ''; if ($result['image']) { $image = $this->model_tool_image->onesize($result['image'], $this->config->get('config_image_thumb_width'), $this->config->get('config_image_thumb_height')); } else { $firstImgnews = catchFirstImage(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')); if ($firstImgnews == 'no_image.jpg') { $image = $this->model_tool_image->onesize('no_image.jpg', $this->config->get('config_image_thumb_width'), $this->config->get('config_image_thumb_height')); } else { $image = $firstImgnews; $width = 'width="' . $this->config->get('config_image_thumb_width') . '"'; $height = 'height="' . $this->config->get('config_image_thumb_height') . '"'; } } if (empty($result['short_description'])) { $short_description = cutString(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 90, true); //$short_description = substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, 500).' ...'; } else { $short_description = nl2br($result['short_description']); } $count_comment = $this->model_catalog_news_comment->getTotalCommentsByNewsId($result['news_id']); $comment = sprintf($this->language->get('text_comment'), (int) $count_comment); $this->data['news'][] = array('news_id' => $result['news_id'], 'thumb' => $image, 'name' => $result['name'], 'short_description' => $short_description, 'date_added' => date('D, ' . $this->language->get('date_format_short'), strtotime($result['date_added'])), 'comment' => $comment, 'width' => $width, 'height' => $height, 'viewed' => sprintf($this->language->get('text_viewed'), (int) $result['viewed']), 'href' => $this->url->link('news/news', '&news_id=' . $result['news_id'])); } $url = ''; if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $url = ''; $this->data['limits'] = array(); $this->data['limits'][] = array('text' => $this->config->get('config_catalog_limit'), 'value' => $this->config->get('config_catalog_limit'), 'href' => $this->url->link('news/all', $url . '&limit=' . $this->config->get('config_catalog_limit'))); $this->data['limits'][] = array('text' => 25, 'value' => 25, 'href' => $this->url->link('news/all', $url . '&limit=25')); $this->data['limits'][] = array('text' => 50, 'value' => 50, 'href' => $this->url->link('news/all', $url . '&limit=50')); $this->data['limits'][] = array('text' => 75, 'value' => 75, 'href' => $this->url->link('news/all', $url . '&limit=75')); $this->data['limits'][] = array('text' => 100, 'value' => 100, 'href' => $this->url->link('news/all', $url . '&limit=100')); $url = ''; if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $pagination = new Pagination(); $pagination->total = $news_total; $pagination->page = $page; $pagination->limit = $limit; $pagination->text = $this->language->get('text_pagination'); $pagination->url = $this->url->link('news/all', $url . '&page={page}'); $this->data['pagination'] = $pagination->render(); $this->data['limit'] = $limit; $this->data['continue'] = $this->url->link('common/home'); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/news/all.tpl')) { $this->template = $this->config->get('config_template') . '/template/news/all.tpl'; } else { $this->template = 'default/template/news/all.tpl'; } $this->children = array('common/column_left', 'common/column_right', 'common/content_top', 'common/content_bottom', 'common/footer', 'common/header'); $this->response->setOutput($this->render()); } else { $url = ''; if (isset($this->request->get['news_category_id'])) { $url .= '&news_category_id=' . $this->request->get['news_category_id']; } if (isset($this->request->get['page'])) { $url .= '&page=' . $this->request->get['page']; } if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_error'), 'href' => $this->url->link('news/all', $url), 'separator' => $this->language->get('text_separator')); $this->document->setTitle($this->language->get('text_error')); $this->data['heading_title'] = $this->language->get('text_error'); $this->data['text_error'] = $this->language->get('text_error'); $this->data['button_continue'] = $this->language->get('button_continue'); $this->data['continue'] = $this->url->link('common/home'); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/error/not_found.tpl')) { $this->template = $this->config->get('config_template') . '/template/error/not_found.tpl'; } else { $this->template = 'default/template/error/not_found.tpl'; } $this->children = array('common/column_left', 'common/column_right', 'common/content_top', 'common/content_bottom', 'common/footer', 'common/header'); $this->response->setOutput($this->render()); } }
protected function index($setting) { static $module = 0; $this->language->load('module/featured_bottom'); $this->data['entry_price'] = $this->language->get('entry_price'); $this->data['entry_duration'] = $this->language->get('entry_duration'); $this->data['entry_departure'] = $this->language->get('entry_departure'); $this->data['entry_location_from'] = $this->language->get('entry_location_from'); $this->data['entry_transport'] = $this->language->get('entry_transport'); $this->data['entry_start_time'] = $this->language->get('entry_start_time'); $this->data['entry_schedule'] = $this->language->get('entry_schedule'); $this->data['heading_title'] = $this->language->get('heading_title'); $this->data['button_cart'] = $this->language->get('button_cart'); $this->load->model('catalog/product'); $this->load->model('tool/image'); $this->document->addScript('catalog/view/javascript/jquery/tabs.js'); $this->document->addScript('catalog/view/javascript/jquery/jquery.jcarousel.min.js'); if (file_exists('catalog/view/theme/' . $this->config->get('config_template') . '/stylesheet/carousel.css')) { $this->document->addStyle('catalog/view/theme/' . $this->config->get('config_template') . '/stylesheet/carousel.css'); } else { $this->document->addStyle('catalog/view/theme/default/stylesheet/carousel.css'); } if (empty($setting['limit'])) { $setting['limit'] = 5; } $this->data['text_category_featured_bottom'] = $this->config->get('featured_bottom_text_product'); $this->data['text_category_featured_bottom1'] = $this->config->get('featured_bottom_text_product1'); //featured_bottom_product $this->data['products'] = array(); $products = explode(',', $this->config->get('featured_bottom_product')); $products = array_slice($products, 0, (int) $setting['limit']); foreach ($products as $product_id) { $product_info = $this->model_catalog_product->getProduct($product_id); if ($product_info) { if ($product_info['image']) { $image = $this->model_tool_image->onesize($product_info['image'], $setting['image_width'], $setting['image_height']); } else { $image = false; } if ($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $price = false; } if ((double) $product_info['special']) { $special = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $special = false; } if ($this->config->get('config_review_status')) { $rating = $product_info['rating']; } else { $rating = false; } if (isset($product_info['custom_link'])) { $custom_link = '&path=' . $product_info['custom_link']; } $this->data['products'][] = array('product_id' => $product_info['product_id'], 'thumb' => $image, 'model' => $product_info['model'], 'name' => $product_info['name'], 'start_time' => $product_info['start_time'], 'departure' => $product_info['departure'], 'location_from' => $product_info['location_from'], 'transport' => $product_info['transport'], 'duration' => $product_info['duration'], 'schedule' => $product_info['schedule'], 'price' => $price, 'special' => $special, 'rating' => $rating, 'reviews' => sprintf($this->language->get('text_reviews'), (int) $product_info['reviews']), 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $product_info['product_id'])); } } //featured_bottom_product1 $this->data['products1'] = array(); $products1 = explode(',', $this->config->get('featured_bottom_product1')); $products1 = array_slice($products1, 0, (int) $setting['limit']); foreach ($products1 as $product_id) { $product_info = $this->model_catalog_product->getProduct($product_id); if ($product_info) { if ($product_info['image']) { $image = $this->model_tool_image->onesize($product_info['image'], $setting['image_width'], $setting['image_height']); } else { $image = false; } if ($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price') && $product_info['price'] != 0) { $price = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $price = false; } if ((double) $product_info['special']) { $special = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $special = false; } if ($this->config->get('config_review_status')) { $rating = $product_info['rating']; } else { $rating = false; } if (isset($product_info['custom_link'])) { $custom_link = '&path=' . $product_info['custom_link']; } $this->data['products1'][] = array('product_id' => $product_info['product_id'], 'thumb' => $image, 'model' => $product_info['model'], 'name' => $product_info['name'], 'start_time' => $product_info['start_time'], 'departure' => $product_info['departure'], 'location_from' => $product_info['location_from'], 'transport' => $product_info['transport'], 'duration' => $product_info['duration'], 'schedule' => $product_info['schedule'], 'price' => $price, 'special' => $special, 'rating' => $rating, 'reviews' => sprintf($this->language->get('text_reviews'), (int) $product_info['reviews']), 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $product_info['product_id'])); } } $this->load->model('catalog/news'); $this->load->model('catalog/news_comment'); $this->data['news'] = array(); $data = array('sort' => 'n.date_added', 'order' => 'DESC', 'start' => 0, 'limit' => 10); $results = $this->model_catalog_news->getNewss($data); $count = 0; foreach ($results as $result) { $width = ''; $height = ''; if ($result['image']) { $image = $this->model_tool_image->onesize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height')); } else { $firstImgnews = catchFirstImage(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')); if ($firstImgnews == 'no_image.jpg') { $image = $this->model_tool_image->onesize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height')); } else { $image = $firstImgnews; $width = 'width="' . $this->config->get('config_image_product_width') . '"'; $height = 'height="' . $this->config->get('config_image_product_height') . '"'; } } if (empty($result['short_description'])) { $short_description = cutString(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 45); } else { $short_description = cutString(nl2br($result['short_description']), 45); } $count_comment = $this->model_catalog_news_comment->getTotalCommentsByNewsId($result['news_id']); $comment = sprintf($this->language->get('text_comment'), (int) $count_comment); $this->data['news'][] = array('news_id' => $result['news_id'], 'thumb' => $image, 'name' => $count > 1 ? cutString($result['name'], 10) : $result['name'], 'full_name' => $result['name'], 'short_description' => $short_description, 'date_added' => date('D, ' . $this->language->get('date_format_short'), strtotime($result['date_added'])), 'comment' => $comment, 'width' => $width, 'height' => $height, 'viewed' => sprintf($this->language->get('text_viewed'), (int) $result['viewed']), 'href' => $this->url->link('news/news', 'news_id=' . $result['news_id'])); $count++; } $this->data['module'] = $module++; if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/featured_bottom.tpl')) { $this->template = $this->config->get('config_template') . '/template/module/featured_bottom.tpl'; } else { $this->template = 'default/template/module/featured_bottom.tpl'; } $this->render(); }