A PHP Error was encountered
Severity: Notice
Message: Only variable references should be returned by reference
Filename: core/Common.php
Line Number: 257
class Site_model extends CI_Model{
function __construct() {
parent::__construct();
$this->load->library('user_agent');
}
function get_menu($page = NULL, $data = NULL) {
/* ************************* */
$menu = array(
'home' => array('name'=>'Home', 'url'=>''),
'oferta' => array('name'=>'Oferta'),
'realizacje' => array('name'=>'Realizacje'),
'kontakt' => array('name'=>'Kontakt'),
);
/* ************************* */
foreach ($menu as $k => $v) {
if (!(isset($menu[$k]['url']))) $menu[$k]['url'] = $k.".html";
if ($page == $k) $menu[$k]['class'] = "selected";
}
return $menu;
}
function get_seo($page, $data) {
$seo_array = array(
'home' => array(
'h1' => 'Home',
'title' => 'Home',
'description' => '',
'keywords' => ''),
'404' => array(
'h1' => 'Błąd 404 – Brak strony o podanym adresie',
'title' => 'Błąd 404 – Brak strony o podanym adresie',
'description' => '',
'keywords' => ''),
'oferta' => array(
'h1' => 'Oferta',
'title' => 'Oferta',
'description' => '',
'keywords' => ''),
'realizacje' => array(
'h1' => 'Realizacje',
'title' => 'Realizacje',
'description' => '',
'keywords' => ''),
'kontakt' => array(
'h1' => 'Kontakt',
'title' => 'Kontakt',
'description' => '',
'keywords' => ''),
);
$extra = "ASUMPT";
$seo = array(
'h1' => isset($seo_array[$page]) ? $seo_array[$page]['h1'] : $page,
'seo_title' => "$extra – ".(isset($seo_array[$page]) ? $seo_array[$page]['title'] : $page)."",
'seo_description' => (isset($seo_array[$page]) ? $seo_array[$page]['description'] : $page),
'seo_keywords' => (isset($seo_array[$page]) ? $seo_array[$page]['keywords'] : $page)
);
return $seo;
}
function capitalize($str) {
$str = mb_strtolower($str, 'utf-8');
$words = explode(' ', $str);
foreach ($words as $k=>$word) {
$words[$k] = mb_strtoupper(mb_substr($word, 0, 1, 'utf-8'),'utf-8')
.mb_substr($word, 1, mb_strlen($word,'utf-8')-1, 'utf-8');
}
return implode(' ',$words);
}
function clear_plc($str){
return str_replace(
array('ą', 'ć', 'ę', 'ł', 'ń', 'ó', 'ś', 'ż', 'ź', 'Ą', 'Ć', 'Ę', 'Ł', 'Ń', 'Ó', 'Ś', 'Ż', 'Ź'),
array('a', 'c', 'e', 'l', 'n', 'o', 's', 'z', 'z', 'A', 'C', 'E', 'L', 'N', 'O', 'S', 'Z', 'Z'), $str);
}
public function retrieve_remote_file_size($url){
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, TRUE);
curl_setopt($ch, CURLOPT_NOBODY, TRUE);
$data = curl_exec($ch);
$size = curl_getinfo($ch, CURLINFO_CONTENT_LENGTH_DOWNLOAD);
curl_close($ch);
return $size;
}
public function is_old_browser() {
$browser = $this->agent->browser();
$version = (int)substr($v = $this->agent->version(),0,strpos($v, "."));
return (($browser == 'Internet Explorer') && ($version < 8));
}
public function headers_expire($expires) {
if (gettype($expires) == "string") {
$t = array(
'never' => 60*60*24*365*2,
'always' => 0,
'seconds' => 1,
'second' => 1,
'minutes' => 60,
'minute' => 60,
'hours' => 60*60,
'hour' => 60*60,
'days' => 60*60*24,
'day' => 60*60*24,
'weeks' => 60*60*24*7,
'week' => 60*60*24*7,
'months' => 60*60*24*31,
'month' => 60*60*24*31,
'years' => 60*60*24*365,
'year' => 60*60*24*365,
);
if (isset($t[$expires])) {
$expires = $t[$expires];
} else {
$e = explode(" ", $expires);
$expires = $e[0] * $t[$e[1]];
}
}
if ($expires) {
header("Pragma: public");
header("Cache-Control: maxage=".$expires);
header('Expires: '.gmdate('D, d M Y H:i:s', time()+$expires).' GMT');
} else {
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
}
}
public function get_captcha() {
require_once($this->config->item('recaptcha_path').'/recaptchalib.php');
$publickey = $this->config->item('recaptcha_publickey');
return recaptcha_get_html($publickey);
}
public function get_sitemap_xml() {
date_default_timezone_set('Europe/Warsaw');
$lastmod = date('Y-m-d'); #SET TODAY
$xml = "";
#menu
$menu = $this->get_menu("offers");
foreach ($menu as $m) {
$xml .= '