latest news
This commit is contained in:
parent
3e5891a5af
commit
fd1448175f
|
|
@ -230,14 +230,17 @@ class Posts extends ComponentBase
|
|||
|
||||
$featured = $this->property('featured') ? $this->property('featured')=='yes':null;
|
||||
$morque = $this->property('morque') ? $this->property('morque')=='yes':null;
|
||||
|
||||
$posts = BlogPost::with(['categories'])->listFrontEnd([
|
||||
// dump($this->property('typePost'));
|
||||
$filters = [
|
||||
'page' => $this->property('pageNumber'),
|
||||
'sort' => $this->property('sortOrder'),
|
||||
'perPage' => $this->property('postsPerPage'),
|
||||
'featured' => $featured,
|
||||
'morque' => $morque,
|
||||
'typePost' => empty($this->property('typePost')) ? null : $this->property('typePost'),
|
||||
// 'typePost' => empty($this->property('typePost')) ? null : $this->property('typePost'),
|
||||
// 'typePost' => empty($this->property('typePost')) ? null : is_array($this->property('typePost'))
|
||||
// ? $this->property('typePost')
|
||||
// : preg_split('/,\s*/', $this->property('typePost'), -1, PREG_SPLIT_NO_EMPTY),
|
||||
'postGroup' => empty($this->property('categoryGroup')) ? null : $this->property('categoryGroup'),
|
||||
'search' => trim(input('q')),
|
||||
'category' => $category,
|
||||
|
|
@ -249,7 +252,15 @@ class Posts extends ComponentBase
|
|||
'exceptCategories' => is_array($this->property('exceptCategories'))
|
||||
? $this->property('exceptCategories')
|
||||
: preg_split('/,\s*/', $this->property('exceptCategories'), -1, PREG_SPLIT_NO_EMPTY),
|
||||
]);
|
||||
];
|
||||
|
||||
if(!empty($this->property('typePost'))){
|
||||
$filters["typePost"] = is_array($this->property('typePost'))
|
||||
? $this->property('typePost')
|
||||
: preg_split('/,\s*/', $this->property('typePost'), -1, PREG_SPLIT_NO_EMPTY);
|
||||
}
|
||||
|
||||
$posts = BlogPost::with(['categories'])->listFrontEnd($filters);
|
||||
//dd($this->property('categoryGroup'));
|
||||
/*
|
||||
* Add a "url" helper attribute for linking to each post and category
|
||||
|
|
|
|||
|
|
@ -92,6 +92,9 @@ class StatisticsController extends Controller
|
|||
|
||||
$this->vars['reklam_stats'] = $stats->get();
|
||||
|
||||
dd($stats->get());
|
||||
$this->vars['count_view'] = 30;
|
||||
|
||||
return ['#linechart' => $this->makePartial('linechart')];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,9 @@
|
|||
google.charts.setOnLoadCallback(drawLineChart_<?=$id?>);
|
||||
|
||||
function drawLineChart_<?=$id?>(){
|
||||
// var all = 20;
|
||||
|
||||
|
||||
var data = google.visualization.arrayToDataTable([
|
||||
['date', 'views', 'clicks',],
|
||||
<?php foreach($reklam_stats->where('item_id',$id) as $stats):?>
|
||||
|
|
@ -15,7 +18,7 @@
|
|||
<?php endforeach; ?>
|
||||
]);
|
||||
var options = {
|
||||
title: '<?=$reklam?>',
|
||||
title: '<?=$reklam?> <?=$count_view?>',
|
||||
curveType: 'function',
|
||||
legend: { position: 'bottom' }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -121,8 +121,8 @@ default = 0
|
|||
<script src="{{ 'assets/new/scripts/swiper/swiper-bundle.min.js'|theme}}"></script>
|
||||
<script src="{{ 'assets/new/copy.js'|theme}}"></script>
|
||||
|
||||
{% scripts %}
|
||||
{% framework extras %}
|
||||
{% scripts %}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,30 +2,16 @@
|
|||
|
||||
[blogPosts]
|
||||
pageNumber = "{{ :page }}"
|
||||
typePost = "turkmenistan"
|
||||
typePost = "turkmenistan, world"
|
||||
postsPerPage = 10
|
||||
noPostsMessage = "No posts found"
|
||||
sortOrder = "created_at desc"
|
||||
categoryPage = 404
|
||||
postPage = 404
|
||||
|
||||
[blogPosts blogPosts2]
|
||||
pageNumber = "{{ :page }}"
|
||||
typePost = "world"
|
||||
postsPerPage = 10
|
||||
noPostsMessage = "No posts found"
|
||||
sortOrder = "created_at desc"
|
||||
categoryPage = 404
|
||||
postPage = 404
|
||||
==
|
||||
<?php
|
||||
function onStart(){
|
||||
$this["merged"]=$this["blogPosts"]."qq";
|
||||
}
|
||||
?>
|
||||
==
|
||||
|
||||
{% set posts = blogPosts.posts %}
|
||||
{% set posts_world = blogPosts2.posts %}
|
||||
|
||||
|
||||
<!-- ASIDE MOBILE ============-->
|
||||
|
|
@ -35,13 +21,13 @@ function onStart(){
|
|||
<h2 class="aside-mobile-header">{{ 'page.latest_news'|_ }}</h2>
|
||||
<ul class="aside-mobile-items">
|
||||
|
||||
|
||||
{% for post in posts %}
|
||||
|
||||
<li>
|
||||
<a href="{{'new/newPost'|page({id:post.id,slug:post.slug})}}">
|
||||
<div class="time">{{post.published_at|date('H:i')}}</div>
|
||||
<p class="content">
|
||||
{{merged}}
|
||||
{{ post.title }}
|
||||
</p>
|
||||
</a>
|
||||
|
|
|
|||
Loading…
Reference in New Issue