diff --git a/plugins/rainlab/blog/components/Posts.php b/plugins/rainlab/blog/components/Posts.php index 4ad11c144..2515c7e12 100644 --- a/plugins/rainlab/blog/components/Posts.php +++ b/plugins/rainlab/blog/components/Posts.php @@ -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 diff --git a/plugins/tps/reklama/controllers/StatisticsController.php b/plugins/tps/reklama/controllers/StatisticsController.php index 035ba3c09..bb8273969 100644 --- a/plugins/tps/reklama/controllers/StatisticsController.php +++ b/plugins/tps/reklama/controllers/StatisticsController.php @@ -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')]; } diff --git a/plugins/tps/reklama/controllers/statisticscontroller/_linechart.htm b/plugins/tps/reklama/controllers/statisticscontroller/_linechart.htm index 63908d331..19c98671f 100644 --- a/plugins/tps/reklama/controllers/statisticscontroller/_linechart.htm +++ b/plugins/tps/reklama/controllers/statisticscontroller/_linechart.htm @@ -8,14 +8,17 @@ google.charts.setOnLoadCallback(drawLineChart_=$id?>); function drawLineChart_=$id?>(){ + // var all = 20; + + var data = google.visualization.arrayToDataTable([ ['date', 'views', 'clicks',], where('item_id',$id) as $stats):?> - ['=date_format(date_create($stats->date),'m/d')?>', =$stats->view?>,=$stats->click?>], + ['=date_format(date_create($stats->date),'m/d')?>', =$stats->view?>, =$stats->click?>], ]); var options = { - title: '=$reklam?>', + title: '=$reklam?> =$count_view?>', curveType: 'function', legend: { position: 'bottom' } }; diff --git a/themes/modern2/layouts/new/master-inside.htm b/themes/modern2/layouts/new/master-inside.htm index 71ec773f6..953ffa481 100644 --- a/themes/modern2/layouts/new/master-inside.htm +++ b/themes/modern2/layouts/new/master-inside.htm @@ -19,7 +19,7 @@ default = 0
- + {% partial 'new/head' %} {% component 'SeoCmsPage' %} {% styles %} @@ -32,29 +32,29 @@ default = 0 - - - + + +