server_comit

This commit is contained in:
root 2021-10-09 06:25:40 +00:00
parent e983f1bfc8
commit fab918dcc5
27 changed files with 510 additions and 56 deletions

View File

@ -0,0 +1,2 @@
B02E62150D94D4149311592085CC0231645F70C26BF4CDD49383B04E24A3935B
comodoca.com

View File

@ -369,6 +369,10 @@ class SmallContactForm extends ComponentBase
$validator->valid();
$this->validationMessages = $validator->messages();
$this->setPostData($validator->messages());
if(empty($this->post['gapja'] or $this->post['gapja'] !='anti-spam')){
$errors[] ='Gapja must be filled with valid data';
}
if($validator->failed() or count($errors)){

View File

@ -6,6 +6,7 @@ use Cms\Classes\Page;
use Cms\Classes\ComponentBase;
use RainLab\Blog\Models\Post as BlogPost;
use RainLab\Blog\Models\Category as BlogCategory;
use Carbon\Carbon;
class RssFeed extends ComponentBase
{
@ -77,9 +78,19 @@ class RssFeed extends ComponentBase
'default' => 'blog/post',
'group' => 'rainlab.blog::lang.settings.group_links',
],
'source' => [
'title' => 'Source',
'description' => 'Source google, yandex',
'type' => 'dropdown',
'default' => 'google',
]
];
}
public function getSourceOptions(){
return ['google'=>'google','yandex'=>'yandex'];
}
public function getBlogPageOptions()
{
return Page::sortBy('baseFileName')->lists('baseFileName', 'baseFileName');
@ -105,7 +116,7 @@ class RssFeed extends ComponentBase
{
$this->prepareVars();
$xmlFeed = $this->renderPartial('@default');
$xmlFeed = $this->renderPartial('@'.($this->property('source')=='yandex'?'yandex':'default'));
return Response::make($xmlFeed, '200')->header('Content-Type', 'text/xml');
}
@ -116,9 +127,12 @@ class RssFeed extends ComponentBase
$this->postPage = $this->page['postPage'] = $this->property('postPage');
$this->category = $this->page['category'] = $this->loadCategory();
$this->posts = $this->page['posts'] = $this->listPosts();
$this->page['language'] = \App::getLocale();
$this->page['link'] = $this->pageUrl($this->blogPage);
$this->page['rssLink'] = $this->currentPageUrl();
//Carbon::setLocale('en');
}
protected function listPosts()

View File

@ -1,21 +1 @@
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
<title>{{ this.page.meta_title ?: this.page.title }}</title>
<link>{{ link }}</link>
<description>{{ this.page.meta_description ?: this.page.description }}</description>
<atom:link href="{{ rssLink }}" rel="self" type="application/rss+xml" />
{% for post in posts %}
<item>
<title>{{ post.title }}</title>
<link>{{ post.url }}</link>
<guid isPermaLink='true' >{{ post.url }}</guid>
<pubDate>{{ post.published_at.toRfc2822String }}</pubDate>
<description><![CDATA[<img src="{{post.featured_image|media_cdn}}">{{ post.summary|raw}} ]]></description>
<content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/">
<![CDATA[ {{post.content_html|raw}} ]]>
</content:encoded>
</item>
{% endfor %}
</channel>
</rss>
{% partial __SELF__ ~ "::"~ __SELF__.property('source') %}

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:media="http://search.yahoo.com/mrss/">
<channel>
<title>{{ this.page.meta_title ?: this.page.title }}{% if category %}:{{category.name}}{% endif %}</title>
<link>{{ link }}</link>
<description>{{ this.page.meta_description ?: this.page.description }}</description>
<atom:link href="{{ rssLink }}" rel="self" type="application/rss+xml" />
<language>{{language}}</language>
{% for post in posts %}
<item>
<title>{{ post.title }}</title>
<link>{{ post.url }}</link>
<guid isPermaLink='true' >{{ post.url }}</guid>
<pubDate>{{ post.rss_date }}</pubDate>
<description><![CDATA[<img src="{{post.featured_image|media_cdn}}">{{ post.summary|raw}} ]]></description>
<enclosure
url="{{post.featured_image|media_cdn}}"
type="image/jpeg"/>
<content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/">
<![CDATA[ {{post.content_html|raw}} ]]>
</content:encoded>
</item>
{% endfor %}
</channel>
</rss>

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:yandex="http://news.yandex.ru"
xmlns:media="http://search.yahoo.com/mrss/">
<channel>
<title>{{ this.page.meta_title ?: this.page.title }}{% if category %}:{{category.name}}{% endif %}</title>
<link>{{ link }}</link>
<description>{{ this.page.meta_description ?: this.page.description }}</description>
<atom:link href="{{ rssLink }}" rel="self" type="application/rss+xml" />
<language>{{language}}</language>
{% for post in posts %}
<item>
<title>{{ post.title }}</title>
<link>{{ post.url }}</link>
<guid isPermaLink='true' >{{ post.url }}</guid>
<pubDate>{{post.rss_date}}</pubDate>
<description><![CDATA[<img src="{{post.featured_image|media_cdn}}">{{ post.summary|raw}} ]]></description>
<enclosure
url="{{post.featured_image|media_cdn}}"
type="image/jpeg"/>
<yandex:full-text><![CDATA[ {{post.content_html|raw}} ]]></yandex:full-text>
</item>
{% endfor %}
</channel>
</rss>

View File

@ -472,6 +472,12 @@ class Post extends Model
else
$this->attributes['id_en'] = $value;
}
public function getRssDateAttribute(){
setlocale(LC_TIME, 'en');
Carbon::setLocale('en');
return Carbon::parse($this->published_at)->format('D, d M Y H:i:s O');//Sun, 29 Sep 2002 19:59:01 +0300
}
//
// Next / Previous
//

View File

@ -5,7 +5,7 @@ use Cms\Classes\Controller;
use RainLab\Sitemap\Models\Definition;
use Illuminate\Database\Eloquent\ModelNotFoundException as ModelNotFound;
Route::get('sitemap.xml', function()
Route::get('{locale}/sitemap.xml', function()
{
$themeActive = Theme::getActiveTheme()->getDirName();

View File

@ -116,12 +116,12 @@ class Plugin extends PluginBase
if ($obj->count() > 0) {
$row = $obj->first();
if (!$views) {
$views = $row->views + rand(1,10);;
$views = $row->views + rand(1,5);;
}
$obj->update(['views' => $views]);
} else {
if (!$views) {
$views = rand(1,10);
$views = rand(1,5);
}
Db::table($this->table_views)->insert([
'post_id' => $post->getKey(),

View File

@ -111,6 +111,7 @@ class Popular extends ComponentBase
}
$query = $query->orderBy('views', 'DESC')
->where('published_at','>=',\Carbon\Carbon::now()->addMonth(-1))
->limit($this->postsLimit)
;

View File

@ -461,4 +461,5 @@
'toughdeveloper\\imageresizer\\Plugin' => 'plugins/toughdeveloper/imageresizer/Plugin.php',
'ToughDeveloper\\ImageResizer\\Classes\\Image' => 'plugins/toughdeveloper/imageresizer/classes/Image.php',
'ToughDeveloper\\ImageResizer\\Models\\Settings' => 'plugins/toughdeveloper/imageresizer/models/Settings.php',
'Rainlab\\Blog\\Models\\Category' => 'plugins/rainlab/blog/models/Category.php',
);

View File

@ -0,0 +1,139 @@
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
html {
font-size: 62.5%;
}
body {
font-family: 'Roboto', sans-serif;
}
.right_top-up {
max-width: 42.3rem;
width: 100%;
}
.right_top-title {
display: flex;
justify-content: space-between;
align-items: center;
}
.right_top-title-text {
width: 17rem;
font-size: 2rem;
font-weight: bold;
}
.right_top-line {
border: 0.01rem solid rgba(0, 0, 0, 15%);
max-width: 33%;
width: 100%;
height: 0;
}
.right_top-content-top {
display: flex;
justify-content: space-between;
margin-top: 3rem;
}
.right_top-content-sphere {
text-align: center;
padding: 0.6rem 0;
color: #fff;
background: #FD4C24;
max-width: 11.7rem;
width: 100%;
font-size: 1.4rem;
font-weight: bold;
margin-bottom: 1rem;
border: none;
}
.right-top-content-date {
display: flex;
align-items: center;
margin-bottom: 1rem;
}
.date,
.time {
color: #a2a2a2;
font-size: 1.4rem;
}
.date {
margin-right: 2.5rem;
position: relative;
}
.date::after {
display: inline-block;
width: 0.4rem;
height: 0.4rem;
content: "";
border: none;
background: #a2a2a2;
transform: rotate(45deg) translateY(-50%);
position: absolute;
top: 50%;
right: -23%;
}
.right_top-content-bottom {
margin-bottom: 1.5rem;
}
.right_top-content:last-child{
margin-bottom: 4rem;
}
.right_top-content-bottom-text {
text-decoration: none;
color: #000;
font-size: 1.6rem;
font-weight: bold;
}
.hr-line {
width: 100%;
border: 0.01rem solid rgba(0, 0, 0, 15%);
}
/* .hr-line:last-child{
display: none; */
}
@media screen and (min-width: 1400px){
.right_top-line{
max-width: 47%;
}
}
/* ========================================== */
.right_top-title-text-2 {
width: 9.4rem;
}
.right_top-line-2 {
max-width: 40%;
width: 100%;
}
.additional {
text-decoration: none;
color: rgba(0, 0, 0, 30%);
font-size: 1.4rem;
margin-left: 2.1rem;
}
.right-top-content-date-2 {
margin-top: 5rem;
}

View File

@ -6,7 +6,6 @@ is_hidden = 0
navigation_hidden = 0
meta_title = "О нас"
meta_description = "russian"
meta_keywords = "ru ru ru"
robot_index = "index"
robot_follow = "nofollow"
==
@ -16,7 +15,7 @@ robot_follow = "nofollow"
<p class="about__para">Сайт ORIENT.tm новый игрок на информационном рынке Туркменистана.</p>
<p class="about__para">Индивидуальное предприятие «Media Turkmen» первое негосударственное информационное агентство в Туркменистане, зарегистрированное в официальных органах страны в апреле 2017 года. Оно включает в себя два подразделения, работающие под одним брендом: сайт ORIENT и продакшн-студию, которые создают новостной, фото, видео и рекламный контент.</p>
<p class="about__para">Хозяйственное общество «Media Turkmen» первое негосударственное информационное агентство в Туркменистане, зарегистрированное в официальных органах страны в апреле 2017 года. Оно включает в себя два подразделения, работающие под одним брендом: сайт ORIENT и продакшн-студию, которые создают новостной, фото, видео и рекламный контент.</p>
<p class="about__para">Команда ORIENT это, в основном, молодые журналисты, выпускники туркменских и зарубежных вузов. Информационное агентство «Media Turkmen» также привлекает к сотрудничеству опытных журналистов, которые проводят мастер-классы и семинары для повышения квалификации команды.</p>

View File

@ -1,5 +1,10 @@
[SeoBlogPost]
post = "post"
[adverts]
code = "samsung"
type = "slider"
random = 0
==
<!DOCTYPE html>
<html lang="{{activeLocale}}">
@ -8,6 +13,9 @@ post = "post"
{% partial 'head' %}
</head>
<body>
<div class="main__banner" style="margin-bottom: 0;">
{% component 'adverts'%}
</div>
{% partial 'header' %}
<!-- main start
================================================ -->

View File

@ -2,6 +2,11 @@
forceUrl = 1
[SeoCmsPage]
[adverts]
code = "samsung"
type = "slider"
random = 0
==
<!DOCTYPE html>
<html lang="{{activeLocale}}">
@ -11,6 +16,9 @@ forceUrl = 1
{% partial 'head' %}
</head>
<body>
<div class="main__banner" style="margin-bottom: 0;">
{% component 'adverts'%}
</div>
{% partial 'header' %}
<!-- main start
================================================ -->

View File

@ -6,6 +6,11 @@ forceUrl = 1
[staticPage]
useContent = 1
default = 0
[adverts]
code = "samsung"
type = "slider"
random = 0
==
<!DOCTYPE html>
<html lang="{{activeLocale}}">
@ -14,6 +19,9 @@ default = 0
{% partial 'head' %}
</head>
<body>
<div class="main__banner" style="margin-bottom: 0;">
{% component 'adverts'%}
</div>
{% partial 'header' %}
<section class="main mr-top-bot">

View File

@ -7,6 +7,11 @@ forceUrl = 1
code = "media"
type = "carousel"
random = 0
[adverts]
code = "samsung"
type = "slider"
random = 0
==
<!DOCTYPE html>
<html lang="{{activeLocale}}">
@ -15,7 +20,9 @@ random = 0
{% partial 'head' %}
</head>
<body>
<div class="main__banner" style="margin-bottom: 0;">
{% component 'adverts'%}
</div>
{% partial 'header' %}
{% page %}
<div class="partner">

View File

@ -6,6 +6,11 @@ forceUrl = 1
[staticPage]
useContent = 1
default = 0
[adverts]
code = "samsung"
type = "slider"
random = 0
==
<!DOCTYPE html>
<html lang="{{activeLocale}}">
@ -14,6 +19,9 @@ default = 0
{% partial 'head' %}
</head>
<body>
<div class="main__banner" style="margin-bottom: 0;">
{% component 'adverts'%}
</div>
{% partial 'header' %}
<section class="main mr-top-bot">
<main class="auto__container">

View File

@ -18,8 +18,13 @@ items:
isExternal: '0'
-
title: Разделы
nesting: null
type: header
url: null
code: ''
reference: null
cmsPage: null
replace: null
viewBag:
locale:
en:
@ -30,18 +35,120 @@ items:
isExternal: '0'
items:
-
title: 'New menu item'
nesting: null
type: all-blog-categories
title: События
nesting: 0
type: blog-category
url: null
code: ''
reference: null
reference: '9'
cmsPage: category
replace: 1
replace: 0
viewBag:
locale:
en:
title: ''
title: Events
url: ''
isHidden: '0'
cssClass: ''
isExternal: '0'
-
title: Общество
nesting: 0
type: blog-category
url: null
code: ''
reference: '12'
cmsPage: category
replace: 0
viewBag:
locale:
en:
title: Social
url: ''
isHidden: '0'
cssClass: ''
isExternal: '0'
-
title: Экономика
nesting: 0
type: blog-category
url: null
code: ''
reference: '5'
cmsPage: category
replace: 0
viewBag:
locale:
en:
title: Economy
url: ''
isHidden: '0'
cssClass: ''
isExternal: '0'
-
title: Культура
nesting: 0
type: blog-category
url: null
code: ''
reference: '8'
cmsPage: category
replace: 0
viewBag:
locale:
en:
title: Culture
url: ''
isHidden: '0'
cssClass: ''
isExternal: '0'
-
title: Экомир
nesting: 0
type: blog-category
url: null
code: ''
reference: '13'
cmsPage: category
replace: 0
viewBag:
locale:
en:
title: Eco-world
url: ''
isHidden: '0'
cssClass: ''
isExternal: '0'
-
title: Спорт
nesting: 0
type: blog-category
url: null
code: ''
reference: '10'
cmsPage: category
replace: 0
viewBag:
locale:
en:
title: Sport
url: ''
isHidden: '0'
cssClass: ''
isExternal: '0'
-
title: Технологии
nesting: 0
type: blog-category
url: null
code: ''
reference: '11'
cmsPage: category
replace: 0
viewBag:
locale:
en:
title: Science
url: ''
isHidden: '0'
cssClass: ''
@ -58,7 +165,7 @@ items:
viewBag:
locale:
en:
title: Photo
title: Photos
url: ''
isHidden: '0'
cssClass: ''
@ -80,6 +187,39 @@ items:
isHidden: '0'
cssClass: ''
isExternal: '0'
-
title: Тендеры
nesting: 0
type: blog-category
url: null
code: ''
reference: '795'
cmsPage: category
replace: 0
viewBag:
locale:
en:
title: Tenders
url: ''
isHidden: '0'
cssClass: ''
isExternal: '0'
-
title: Объявления
nesting: 0
type: blog-category
code: ''
reference: '796'
cmsPage: category
replace: 0
viewBag:
locale:
en:
title: Announcements
url: ''
isHidden: '0'
cssClass: ''
isExternal: '0'
-
title: 'Static Pages(About and Contact)'
nesting: null

View File

@ -1,10 +1,13 @@
title = "Page not found (404)"
url = "/404"
layout = "cms"
is_hidden = 0
robot_index = "index"
robot_follow = "follow"
==
<div class="jumbotron">
<div class="container">
<h1>Page not found</h1>
<p>We're sorry, but the page you requested cannot be found.</p>
<h1>{{'Page not found'|_}}</h1>
<p>{{'We are sorry, but the page you requested cannot be found.'|_}}</p>
</div>
</div>
</div>

View File

@ -6,14 +6,15 @@ is_hidden = 0
robot_index = "index"
robot_follow = "follow"
[viewBag]
localeMeta_title[en] = "Orient news rss feed"
localeMeta_description[en] = "ORIENT.TM is designed for prompt delivery of interesting and relevant news in a convenient format."
[blogRssFeed]
categoryFilter = "{{ :category }}"
sortOrder = "published_at desc"
postsPerPage = 20
blogPage = "index"
postPage = "post"
[viewBag]
localeMeta_title[en] = "Orient news rss feed"
localeMeta_description[en] = "ORIENT.TM is designed for prompt delivery of interesting and relevant news in a convenient format."
source = "google"
==

View File

@ -1,11 +1,11 @@
title = "Главная"
url = "/"
layout = "master"
meta_title = "Последние актуальные новости Туркменистана и мира"
meta_description = "Главные и свежие новости Туркменистана за сегодня. Последние актуальные политические, экономические новости в
meta_title = "Новости Туркменистана и мира"
meta_description = "Новости Туркменистана за сегодня. Последние актуальные политические, экономические новости в
Туркменистане."
is_hidden = 0
seo_keywords = "Новости Туркменистана, последние новости Туркменистана, Туркменистан, Turkmenistan news, latest news of Turkmenistan, president of Turkmenistan, Türkmenistanyň sonky habarlary, täzelikler, syyýasy habarlar."
seo_keywords = "Новости Туркменистана, последние новости Туркменистана, Туркменистан, Turkmenistan news, latest news of Turkmenistan, president of Turkmenistan, Türkmenistanyň sonky habarlary, täzelikler, syýasy habarlar."
robot_index = "index"
robot_follow = "follow"
@ -138,6 +138,8 @@ random = 0
<div class="main__sidebar">
{% partial 'sidebar__cards' %}
{% component 'right_top' css_class= 'main__sidebar-adv' %}
{% partial 'popular-posts' %}
{% partial 'tenders' %}
{% partial 'tags' %}
{% component 'right_middle' css_class = 'main__sidebar-adv' %}
{% partial 'calendar' %}
@ -153,4 +155,4 @@ random = 0
================================================ -->
<!-- main end
================================================ -->
================================================ -->

View File

@ -1,11 +1,17 @@
title = "rss"
url = "/rss/:category?"
meta_title = "Ориент Новости Туркменистана и мира"
meta_description = "Новости Туркменистана за сегодня. Последние актуальные политические, экономические новости в
Туркменистане."
is_hidden = 0
seo_keywords = "Turkmenistan, news"
robot_index = "index"
robot_follow = "follow"
[viewBag]
localeUrl[en] = "/rss/:category?"
localeMeta_title[en] = "Orient. All main news of Turkmenistan today."
localeMeta_description[en] = "The main and latest news of politics of Turkmenistan for today"
[blogRssFeed]
categoryFilter = "{{ :category }}"
@ -13,4 +19,5 @@ sortOrder = "published_at desc"
postsPerPage = 20
blogPage = "index"
postPage = "post"
source = "yandex"
==

View File

@ -8,10 +8,13 @@
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap" rel="stylesheet">
{% styles %}
<link href="{{ ['assets/css/main.css']|theme }}" rel="stylesheet">
<link href="{{ ['assets/css/style.css']|theme }}" rel="stylesheet">
<link rel="icon" href="{{'assets/images/icon/cropped-cropped-orienticon-32x32.png'|theme}}" sizes="32x32">
<link rel="icon" href="{{'assets/images/icon/cropped-cropped-orienticon-192x192.png'|theme}}" sizes="192x192">
<link rel="apple-touch-icon-precomposed" href="{{'assets/images/icon/cropped-cropped-orienticon-180x180.png'|theme}}">
<meta name="msapplication-TileImage" content="{{'assets/images/icon/cropped-cropped-orienticon-270x270.png'|theme}}">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="google-site-verification2" content="GEfDQ_LMP4ly0tTnTcuX2Kr7WKri-Ql89FDLmYAKJXg" />
<meta name="google-site-verification" content="WtxIxLTZ6EPLwx5WVCYCbGEAVDFOJzu-TM_OOdx5klY" />

View File

@ -2,15 +2,7 @@
[staticMenu]
code = "top-menu"
[adverts]
code = "samsung"
type = "single"
random = 0
==
<div class="main__banner" style="margin-bottom: 0;">
{% component 'adverts'%}
</div>
<!-- header start
================================================-->
<header class="header">

View File

@ -0,0 +1,32 @@
description = "popular-posts"
[popularPosts]
postsLimit = 10
noPostsMessage = "No posts found"
postPage = "post"
[viewBag]
==
<div id="right_top-up" class="right_top-up">
<div class="right_top-title">
<h2 class="right_top-title-text">{{'Самое читаемое'|_}}</h2>
<div class="right_top-line"></div>
</div>
{% for post in posts %}
<div class="right_top-content">
<div class="right_top-content-top">
<h4 class="right_top-content-sphere">{{ post.categories.first.name }}</h4>
<div class="right-top-content-date">
<span class="date">{{ post.published_at| date('d.m.Y')}}</span>
<span class="time">{{post.published_at|date('H:i')}}</span>
</div>
</div>
<div class="right_top-content-bottom">
<a href="{{postPage|page({slug:post.slug,id:post.id})}}" class="right_top-content-bottom-text">
{{post.title}}
</a>
</div>
<div class="hr-line"></div>
</div>
{% endfor %}
</div>

View File

@ -0,0 +1,37 @@
[blogPosts]
pageNumber = "{{ :page }}"
categoryFilter = "tendery"
postsPerPage = 5
noPostsMessage = "No posts found"
sortOrder = "published_at desc"
categoryPage = "category"
postPage = "post"
[viewBag]
==
{% set posts = blogPosts.posts %}
<div id="right_top-up" class="right_top-up">
<div class="right_top-title">
<h2 class="right_top-title-text right_top-title-text-2">{{category.name}}</h2>
<div class="right_top-line right_top-line-2"></div>
<a href="{{'category'|page({slug:category.slug})}}" class="additional">{{'page.more'|_}}</a>
</div>
{% for post in posts %}
<div class="right_top-content">
<div class="right_top-content-top">
<div class="right-top-content-date right-top-content-date-2">
<span class="date">{{ post.published_at| date('d.m.Y')}}</span>
<span class="time">{{post.published_at|date('H:i')}}</span>
</div>
</div>
<div class="right_top-content-bottom">
<a href="{{postPage|page({slug:post.slug,id:post.id})}}" class="right_top-content-bottom-text">
{{ post.title }}
</a>
</div>
<div class="hr-line"></div>
</div>
{% endfor %}
</div>