first commit
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
class ModelDesignBanner extends Model {
|
||||
public function getBanner($banner_id) {
|
||||
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "banner b LEFT JOIN " . DB_PREFIX . "banner_image bi ON (b.banner_id = bi.banner_id) WHERE b.banner_id = '" . (int)$banner_id . "' AND b.status = '1' AND bi.language_id = '" . (int)$this->config->get('config_language_id') . "' ORDER BY bi.sort_order ASC");
|
||||
return $query->rows;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
class ModelDesignLayout extends Model {
|
||||
public function getLayout($route) {
|
||||
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "layout_route WHERE '" . $this->db->escape($route) . "' LIKE route AND store_id = '" . (int)$this->config->get('config_store_id') . "' ORDER BY route DESC LIMIT 1");
|
||||
|
||||
if ($query->num_rows) {
|
||||
return (int)$query->row['layout_id'];
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public function getLayoutModules($layout_id, $position) {
|
||||
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "layout_module WHERE layout_id = '" . (int)$layout_id . "' AND position = '" . $this->db->escape($position) . "' ORDER BY sort_order");
|
||||
|
||||
return $query->rows;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
class ModelDesignTheme extends Model {
|
||||
public function getTheme($route, $theme) {
|
||||
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "theme WHERE store_id = '" . (int)$this->config->get('config_store_id') . "' AND theme = '" . $this->db->escape($theme) . "' AND route = '" . $this->db->escape($route) . "'");
|
||||
|
||||
return $query->row;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
class ModelDesignTranslation extends Model {
|
||||
public function getTranslations($route) {
|
||||
$language_code = !empty($this->session->data['language']) ? $this->session->data['language'] : $this->config->get('config_language');
|
||||
|
||||
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "translation WHERE store_id = '" . (int)$this->config->get('config_store_id') . "' AND language_id = '" . (int)$this->config->get('config_language_id') . "' AND (route = '" . $this->db->escape($route) . "' OR route = '" . $this->db->escape($language_code) . "')");
|
||||
|
||||
return $query->rows;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user