0byt3m1n1
Path:
/
data
/
17
/
1
/
18
/
11
/
1670011
/
user
/
1801231
/
htdocs
/
marketting
/
system
/
application
/
models
/
[
Home
]
File: sitemap_model.php
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); /* | ------------------------------------------------------------------------- | COPYRIGHT NOTICE | Copyright 2008 JROX Technologies, Inc. All Rights Reserved. | ------------------------------------------------------------------------- | This script may be only used and modified in accordance to the license | agreement attached (license.txt) except where expressly noted within | commented areas of the code body. This copyright notice and the | comments above and below must remain intact at all times. By using this | code you agree to indemnify JROX Technologies, Inc, its corporate agents | and affiliates from any liability that might arise from its use. | | Selling the code for this program without prior written consent is | expressly forbidden and in violation of Domestic and International | copyright laws. | | ------------------------------------------------------------------------- | FILENAME - sitemap_model.php | ------------------------------------------------------------------------- | | This model handles the generation of the XML sitemap | */ class Sitemap_Model extends Model { function _get_site_records($type = '', $limit = 50000, $offset = 0) { $data = ''; switch ($type) { case 'products': $sql = 'SELECT product_id, product_name, date_modified FROM ' . $this->db->dbprefix('products') . ' WHERE product_status = \'1\' LIMIT ' . $offset . ', ' . $limit; break; case 'product_categories': $sql = 'SELECT category_id, category_name FROM ' . $this->db->dbprefix('products_categories') . ' LIMIT ' . $offset . ', ' . $limit; break; case 'content_articles': $sql = 'SELECT article_id, content_title, date_published as date_modified FROM ' . $this->db->dbprefix('content_articles') . ' WHERE status = \'1\' AND article_id != \'1\' LIMIT ' . $offset . ', ' . $limit; break; case 'content_categories': $sql = 'SELECT category_id, category_name FROM ' . $this->db->dbprefix('content_categories') . ' WHERE category_id != \'5\' AND category_id != \'6\' LIMIT ' . $offset . ', ' . $limit; break; case 'faq_articles': $sql = 'SELECT article_id, content_title, date_published as date_modified FROM ' . $this->db->dbprefix('faq_articles') . ' WHERE status = \'1\' LIMIT ' . $offset . ', ' . $limit; break; case 'faq_categories': $sql = 'SELECT category_id, category_name FROM ' . $this->db->dbprefix('faq_categories') . ' LIMIT ' . $offset . ', ' . $limit; break; case 'profiles': case 'affiliates': $sql = 'SELECT member_id, username, updated_on as date_modified FROM ' . $this->db->dbprefix('members') . ' WHERE status = \'1\' LIMIT ' . $offset . ', ' . $limit; break; } $query = $this->db->query($sql); $data = $query->result_array(); return $data; } function _generate_site_links($type = '') { $data = $this->_get_site_records($type); $links = array(); foreach ($data as $k => $v) { switch ($type) { case 'products': $opt['link'] = base_url() . PRODUCTS_ROUTE . '/details/' . $v['product_id'] . '/' . url_title($v['product_name'], $this->config->item('jrox_url_separator')); $opt['date_modified'] = date('Y-m-d', $v['date_modified']); array_push($links, $opt); break; case 'product_categories': $opt['link'] = base_url() . CATEGORIES_ROUTE . '/' . $v['category_id'] . '/' . url_title($v['category_name'], $this->config->item('jrox_url_separator')); $opt['date_modified'] = date('Y-m-d'); array_push($links, $opt); break; case 'content_articles': $opt['link'] = base_url() . CONTENT_ROUTE . '/article/' . $v['article_id'] . '/' . url_title($v['content_title'], $this->config->item('jrox_url_separator')); $opt['date_modified'] = date('Y-m-d', $v['date_modified']); array_push($links, $opt); break; case 'content_categories': $opt['link'] = base_url() . CONTENT_ROUTE . '/view/category_id/' . $v['category_id']; $opt['date_modified'] = date('Y-m-d'); array_push($links, $opt); break; case 'faq_articles': $opt['link'] = base_url() . FAQ_ROUTE . '/article/' . $v['article_id'] . '/' . url_title($v['content_title'], $this->config->item('jrox_url_separator')); $opt['date_modified'] = date('Y-m-d', $v['date_modified']); array_push($links, $opt); break; case 'faq_categories': $opt['link'] = base_url() . FAQ_ROUTE . '/view/category_id/' . $v['category_id']; $opt['date_modified'] = date('Y-m-d'); array_push($links, $opt); break; case 'profiles': $opt['link'] = base_url() . PROFILE_ROUTE . '/' . $v['username']; $opt['date_modified'] = date('Y-m-d', $v['date_modified']); array_push($links, $opt); break; case 'affiliates': $opt['link'] = base_url() . AFFILIATE_ROUTE . '/' . $v['username']; $opt['date_modified'] = date('Y-m-d', $v['date_modified']); array_push($links, $opt); break; } } return $links; } } ?>