server {
server_name site.com www.site.com;
root /path/to_you/site_dir;
location ~ /user/$ {
deny all;
access_log off;
log_not_found off;
}
location ~ \.php$ {
...
fastcgi_param USER_SUBDOMAIN "_MAIN_";
...
}
}
server {
server_name "~^(?<user_subdomain>[a-z0-9_-]{2,20})\.site\.com$";
root /path/to_you/site_dir;
location ~ /assets/$ {
alias /path/to_you/site_dir/user/$user_subdomain/
}
location ~ \.php$ {
...
fastcgi_param USER_SUBDOMAIN $user_subdomain;
...
}
}
http://visya.site.com/assets
/path/to_you/site_dir/user/visya/
<!-- html -->
<img src="main.png" id="mainImg">
<img src="" data-src="notmain1.png" class="notmain">
<img src="" data-src="notmain2.png" class="notmain">
<img src="" data-src="notmain3.png" class="notmain">
/*** javascript ***/
$("#mainImg").load(function() {
$(".notmain").attr('src', function() {
return $(this).attr("data-src");
});
});
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>title</title>
<style>
.message {
margin: 50px;
padding: 50px;
border: 3px double #333;
background: #eee;
text-align: center;
color: #333
}
</style>
<script language="javascript">
setTimeout(function() {
document.getElementById('message').remove();
}, 5000);
</script>
</head>
<body>
<h3 id='message' class='message'>
Ваше письмо успешно отправлено!
</h3>
</body>
</html>
if ($category->isNewRecord && empty($category->pid)) {
if ($category->saveNode()) $categorySaved = true;
}
elseif ($category->isNewRecord && !empty($category->pid)) {
$rootCategory = Categories::model()->findByPk($category->pid);
if ($category->appendTo($rootCategory) && $category->saveNode()) $categorySaved = true;
}
elseif (!$category->isNewRecord && empty($category->pid) && !$category->isRoot()) {
if ($category->moveAsRoot() && $category->saveNode()) $categorySaved = true;
}
elseif (!$category->isNewRecord && !empty($category->pid)) {
$rootCategory = Categories::model()->findByPk($category->pid);
if ($category->moveAsFirst($rootCategory) && $category->saveNode()) $categorySaved = true;
}