$description = $item['description']
.(isset($item['category_title']) ? ', '.$item['category_title'] : '')
.(isset($item['city_name']) ? ', '.$item['city_name'] : '');
$this->setPageDescription($description);
/**
* Determine the mobile operating system.
* This function returns one of 'iOS', 'Android', 'Windows Phone', or 'unknown'.
*
* @returns {String}
*/
function getMobileOperatingSystem() {
var userAgent = navigator.userAgent || navigator.vendor || window.opera;
// Windows Phone must come first because its UA also contains "Android"
if (/windows phone/i.test(userAgent)) {
return "Windows Phone";
}
if (/android/i.test(userAgent)) {
return "Android";
}
// iOS detection from: http://stackoverflow.com/a/9039885/177710
if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
return "iOS";
}
return "unknown";
}
base.start_interval = function(){
//Clear out any existing interval
clearInterval(base.ticker);
base.ticker = setInterval(function() {
base.$el.find('li:last').detach().prependTo(base.$el).css('marginTop', '-' + base.options.row_height);
base.$el.find('li:first').animate({
marginTop: '0px',
}, base.options.speed, function () {
base.reset_interval();
});
}, base.options.interval);
}
if ($user->is_logged) {
if ($_SERVER['REQUEST_URI'] == '/page-1' || $_SERVER['REQUEST_URI'] == '/page-2') {
// пользователь авторизован и запрашивает page-1 или page-2
}
} else {
if ($_SERVER['REQUEST_URI'] == '/' || $_SERVER['REQUEST_URI'] == '/index.php' || $_SERVER['REQUEST_URI'] == '/page-3') {
// Пользователь не авторизован и запрашивает /, index.php или page-3
}
}
if (mb_substr($_SERVER['REQUEST_URI'], 0, 15) == '/category/item/') {
$this->addMainCSS("templates/{$this->name}/css/item.css");
}
if (mb_substr($_SERVER['REQUEST_URI'], 0, 15) == '/category/item/' && mb_strlen($_SERVER['REQUEST_URI']) > 15) {
$this->addMainCSS("templates/{$this->name}/css/item.css");
}