Skip to content

Commit

Permalink
update 2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
CB9TOIIIA committed Sep 16, 2016
1 parent 1b7e836 commit b85c21a
Show file tree
Hide file tree
Showing 5 changed files with 123 additions and 36 deletions.
12 changes: 10 additions & 2 deletions assets/css/metrika.css
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ margin: 12px; }
.sweet-alert p ul li:nth-child(odd) { background: #EFEFEF; }
.sweet-alert p ul li:nth-child(even) { background: white; }
.tagsstat .zebra { display: inline-flex; flex-wrap: wrap; width: 98%; height: 250px; flex-direction: column; list-style: none; padding: 0;}
.tagsstat.country .zebra { height: 100px !important; } .tagsstat .zebra li { max-width: 430px; padding: 5px; margin-right: 5px; } .tagsstat .zebra li:nth-child(odd) { background: #EFEFEF; } .tagsstat .zebra li:nth-child(even) { background: white; }
.tagsstat.country .zebra { height: 100px !important; } .tagsstat .zebra li { width: 390px; padding: 5px; margin-right: 5px; } .tagsstat .zebra li:nth-child(odd) { background: #EFEFEF; } .tagsstat .zebra li:nth-child(even) { background: white; }
.zebratable {width: 98%; margin: 0 auto;}
.zebratable td {padding: 5px;}
.zebratable tr.upper {font-weight: bold;}
Expand Down Expand Up @@ -996,8 +996,16 @@ hr {clear: both !important}
border-radius: 2px;
box-shadow: 0px 0px 3px #ccc; color: #fff;
}

.visitorsvis {
background-color: #FE6161;
padding: 50px; text-align: center;
border-radius: 2px;
box-shadow: 0px 0px 3px #ccc; color: #fff;
}

.countview,.globvisitors {
font-size: 5em;
font-size: 4em;
font-weight: bold;
}
.textstat {
Expand Down
2 changes: 1 addition & 1 deletion myjbzoostat.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<authorUrl>http://cb9t.ru</authorUrl>
<copyright></copyright>
<license></license>
<version>2.2</version>
<version>2.3</version>
<description>MyJBZooStat - это компонент статистики и менеджер системы комментирования Disqus.</description>
<creationDate>28 June 2016</creationDate>
<administration>
Expand Down
33 changes: 29 additions & 4 deletions views/articles/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@
$document->addScript(JUri::root().'administrator/components/com_myjbzoostat/assets/js/sort.js');
$document->addScript(JUri::root().'administrator/components/com_myjbzoostat/assets/js/chart.js');

$document->addStyleSheet(JUri::root().'administrator/components/com_myjbzoostat/assets/css/jquery.dataTables.min.css');

$document->addScript(JUri::root().'administrator/components/com_myjbzoostat/assets/js/jquery.dataTables.min.js');
//JUST DO IT $this->app ----> $app

echo '
<script type="text/javascript">
jQuery(document).ready(function($) {
$("#myTable").DataTable({language:{url:"/administrator/components/com_myjbzoostat/assets/js/Russian.json"}});
});
</script>';

//JUST DO IT 😹 $this->app ----> $app
?>

Expand Down Expand Up @@ -307,13 +319,26 @@ function rdate($param, $time=0) {
echo "<hr>";
echo "<div class='allinfoabout'>";
echo "<p><big><big>Глобальная статистика публикаций: </big></big></p>";
echo "<div class='tagsstat mounth'><ul class='zebra'>";
foreach ($datearraydate as $valtagdate => $valuecount ) {

echo $datearraydate[] = '<li>'.$valtagdate. ' ('. $valuecount.')</li>';
echo "<table id='myTable' class='zebratable'>";
echo "<thead>";
echo "<tr class='upper'>";
echo "<td>Дата <img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABmUlEQVQ4T6WTPUgcURDHZ2bX7w+0VLCwFPQu4e27AxvPpLIQrQWtBFNoZ2NiJxj7NFGsBC2vsNFC9JLO213Wvc7OQrRUBA3q2xlZYWEjZj3M697Mm9/M/OcNwn8eTMeXSiX76ub2lxCu17zqVto3WCzmLJHFsFqdSdv/AiilGgzSgyB8rbnu9+ShUqrnUeAUiToIaS1wj5cS35uAONggHYJwPyA1AYAIwrckQSbgOVjoiIF7iHAHAL8A8zYQTQnIcs3zVjMBecfZY5Zhy6IxBhhBgdXb66vm9q6uDQGcJoTRTMCg1n3E3Fvz/eOc1ksxwBZu9H0/yms9Gbpu+U0NErFeAB7rFrEuwAfHmTjxvF2llJ0eY95xChRF50EQXPyzgpzWn1HgAAA2zJ+7Bbul9T7+BxZixZhonyz6HbrueGYLea1XQGBZIthEC2YB5CezTBHQJYn5lFlB0mMCie8ifI9CZ0lwbKtLxI+Fwg9mmWfhG5t5IM5cl4jp5RhSqkzGrIRhGKTtOacwgyxz3Z1tI5VKxbw6xvds9hPRaxT6nhWaoAAAAABJRU5ErkJggg=='></td>";
echo "<td>Кол-во статей <img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABmUlEQVQ4T6WTPUgcURDHZ2bX7w+0VLCwFPQu4e27AxvPpLIQrQWtBFNoZ2NiJxj7NFGsBC2vsNFC9JLO213Wvc7OQrRUBA3q2xlZYWEjZj3M697Mm9/M/OcNwn8eTMeXSiX76ub2lxCu17zqVto3WCzmLJHFsFqdSdv/AiilGgzSgyB8rbnu9+ShUqrnUeAUiToIaS1wj5cS35uAONggHYJwPyA1AYAIwrckQSbgOVjoiIF7iHAHAL8A8zYQTQnIcs3zVjMBecfZY5Zhy6IxBhhBgdXb66vm9q6uDQGcJoTRTMCg1n3E3Fvz/eOc1ksxwBZu9H0/yms9Gbpu+U0NErFeAB7rFrEuwAfHmTjxvF2llJ0eY95xChRF50EQXPyzgpzWn1HgAAA2zJ+7Bbul9T7+BxZixZhonyz6HbrueGYLea1XQGBZIthEC2YB5CezTBHQJYn5lFlB0mMCie8ifI9CZ0lwbKtLxI+Fwg9mmWfhG5t5IM5cl4jp5RhSqkzGrIRhGKTtOacwgyxz3Z1tI5VKxbw6xvds9hPRaxT6nhWaoAAAAABJRU5ErkJggg=='></td>";
echo "</tr>";
echo "</thead>";
echo "<tbody>";

foreach ($datearraydate as $valtagdate => $valuecount ) {
echo "<tr>";
echo "<td>";
echo $datearraydate[] = ''.$valtagdate. '</td><td>'. $valuecount.'</td>';
echo "</tr>";

}
echo "</ul></div>";

echo "</tbody>";
echo "</table>";

?>

Expand Down
37 changes: 28 additions & 9 deletions views/autors/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,21 @@
<?php
require_once JPATH_ADMINISTRATOR . '/components/com_myjbzoostat/elements/paramsetc.php';
$document->addStyleSheet(JUri::root().'administrator/components/com_myjbzoostat/assets/css/autors.css');

$document->addStyleSheet(JUri::root().'administrator/components/com_myjbzoostat/assets/css/jquery.dataTables.min.css');

$document->addScript(JUri::root().'administrator/components/com_myjbzoostat/assets/js/jquery.dataTables.min.js');
//JUST DO IT $this->app ----> $app

echo '
<script type="text/javascript">
jQuery(document).ready(function($) {
$("#myTable").DataTable({language:{url:"/administrator/components/com_myjbzoostat/assets/js/Russian.json"}});
});
</script>';

?>
<style>
</style>


<div class="item-page">

Expand Down Expand Up @@ -103,26 +114,34 @@

//dump($itemIdsResultnameauth,1,'tagsArrayauthors');

echo "<div class='tagsstat'>";
echo "<ul class='zebra'>";
echo "<table id='myTable' class='zebratable'>";
echo "<thead>";
echo "<tr class='upper'>";
echo "<td>ID <img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABmUlEQVQ4T6WTPUgcURDHZ2bX7w+0VLCwFPQu4e27AxvPpLIQrQWtBFNoZ2NiJxj7NFGsBC2vsNFC9JLO213Wvc7OQrRUBA3q2xlZYWEjZj3M697Mm9/M/OcNwn8eTMeXSiX76ub2lxCu17zqVto3WCzmLJHFsFqdSdv/AiilGgzSgyB8rbnu9+ShUqrnUeAUiToIaS1wj5cS35uAONggHYJwPyA1AYAIwrckQSbgOVjoiIF7iHAHAL8A8zYQTQnIcs3zVjMBecfZY5Zhy6IxBhhBgdXb66vm9q6uDQGcJoTRTMCg1n3E3Fvz/eOc1ksxwBZu9H0/yms9Gbpu+U0NErFeAB7rFrEuwAfHmTjxvF2llJ0eY95xChRF50EQXPyzgpzWn1HgAAA2zJ+7Bbul9T7+BxZixZhonyz6HbrueGYLea1XQGBZIthEC2YB5CezTBHQJYn5lFlB0mMCie8ifI9CZ0lwbKtLxI+Fwg9mmWfhG5t5IM5cl4jp5RhSqkzGrIRhGKTtOacwgyxz3Z1tI5VKxbw6xvds9hPRaxT6nhWaoAAAAABJRU5ErkJggg=='></td>";
echo "<td>Имя автора <img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABmUlEQVQ4T6WTPUgcURDHZ2bX7w+0VLCwFPQu4e27AxvPpLIQrQWtBFNoZ2NiJxj7NFGsBC2vsNFC9JLO213Wvc7OQrRUBA3q2xlZYWEjZj3M697Mm9/M/OcNwn8eTMeXSiX76ub2lxCu17zqVto3WCzmLJHFsFqdSdv/AiilGgzSgyB8rbnu9+ShUqrnUeAUiToIaS1wj5cS35uAONggHYJwPyA1AYAIwrckQSbgOVjoiIF7iHAHAL8A8zYQTQnIcs3zVjMBecfZY5Zhy6IxBhhBgdXb66vm9q6uDQGcJoTRTMCg1n3E3Fvz/eOc1ksxwBZu9H0/yms9Gbpu+U0NErFeAB7rFrEuwAfHmTjxvF2llJ0eY95xChRF50EQXPyzgpzWn1HgAAA2zJ+7Bbul9T7+BxZixZhonyz6HbrueGYLea1XQGBZIthEC2YB5CezTBHQJYn5lFlB0mMCie8ifI9CZ0lwbKtLxI+Fwg9mmWfhG5t5IM5cl4jp5RhSqkzGrIRhGKTtOacwgyxz3Z1tI5VKxbw6xvds9hPRaxT6nhWaoAAAAABJRU5ErkJggg=='></td>";
echo "</tr>";
echo "</thead>";
echo "<tbody>";
$myautp = 0;
foreach ($itemIdsResultnameauth as $created_byas ) {
// dump($created_byas,1,'tagsArrayauthors');
$created_bycreated = $created_byas->created_by;
$created_byname = $created_byas->name;

$myautp++;
$monthdate = date("Y-m");
echo '<li><form style="display:none" action="/administrator/index.php?option=com_myjbzoostat&view=auhorsprofile" name="a'.$created_bycreated.'" method="post" >';
echo '<tr><td>'.$myautp.'</td><td>
<form style="display:none" action="/administrator/index.php?option=com_myjbzoostat&view=auhorsprofile" name="a'.$created_bycreated.'" method="post" >';
echo $authcreatedx[] = '
<input type="hidden" name="authorids" value="'.$created_bycreated.'" />
<input type="hidden" name="monthdate" value="'.$monthdate.'" />
</form> <a class="test-submit" href="/administrator/index.php?option=com_myjbzoostat&view=auhorsprofile" OnClick="a'.$created_bycreated.'.submit();return false;">'.$created_byname.'</a> </li>';
</form><a class="test-submit" href="/administrator/index.php?option=com_myjbzoostat&view=auhorsprofile" OnClick="a'.$created_bycreated.'.submit();return false;">'.$created_byname.'</a></td></tr>';
// echo $itemIdsResultnameauth[] = '<option value="'.$created_by.'">'.$name.'</option>';

}
echo "</ul>";
echo "</div>";
echo "</tbody>";
echo "</table>";

endif;

Expand Down
75 changes: 55 additions & 20 deletions views/index/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,23 @@
$datageo = json_decode($responcegeo);


$urlexfree = 'http://api-metrika.yandex.ru/stat/traffic/summary.json?id='.$counter_id;

$urlexfree .= '&date1='.$ModDate1;

$urlexfree .= '&date2='.$ModDate2;

// $urlexfree .= '&group='.$date_group;

$urlexfree .= '&per_page=500';

$urlexfree .= '&oauth_token='.$app_token;

$responceurlfree = MetrikaHelper::open_http($urlexfree, $method);

$dataurlfree = json_decode($responceurlfree);


$urlgeotree = 'http://api-metrika.yandex.ru/stat/geo.json?id='.$counter_id;

$urlgeotree .= '&date1='.$ModDate1;
Expand Down Expand Up @@ -832,23 +849,25 @@ function bd_nice_number($n) {



if ($datageo) {
if ($dataurlfree) {



$datebegin = $datageo->date1;
$datebegin = $dataurlfree->date1;

$datebegin = date("d.m.Y", strtotime($datebegin));

$dateend = $datageo->date2;
$dateend = $dataurlfree->date2;

$dateend = date("d.m.Y", strtotime($dateend));

//total

$globalpageviews = $datageo->totals->page_views;
$globalpageviews = $dataurlfree->totals->page_views;

$globalvisits = $dataurlfree->totals->visits;

$globalvisits = $datageo->totals->visits;
$globalvisitors = $dataurlfree->totals->visitors;



Expand All @@ -870,18 +889,13 @@ function bd_nice_number($n) {
$daytosql = date('Ymd');



echo "<span class='span6'>";



echo "<div class='pageview'>";

$globalgv = bd_nice_number($globalpageviews);

$globalvis = bd_nice_number($globalvisits);

if (preg_match('/тыс/',$globalgv,$matchs) || preg_match('/тыс/',$globalvis,$matchs) ) {
$globalvisitor = bd_nice_number($globalvisitors);

if (preg_match('/тыс/',$globalgv,$matchs) || preg_match('/тыс/',$globalvis,$matchs) || preg_match('/тыс/',$globalvisitor,$matchs) ) {

$globalgv = str_replace('.',' млн. ',$globalgv);

Expand All @@ -891,35 +905,56 @@ function bd_nice_number($n) {

$globalvis = $globalvis.'.';

$globalvisitor = str_replace('.',' млн. ',$globalvisitor);

$globalvisitor = $globalvisitor.'.';

$globalvisitor = str_replace('тыc млн. .','тыc.', $globalvisitor);


}

echo "<span title='{$globalpageviews}' class='countview'>{$globalgv}</span>";
echo "<span class='span4'>";



echo "<div class='pageview'>";

echo "<span title='{$globalpageviews}' class='countview'>{$globalgv}</span>";

echo "<span class='textstat'>Просмотров страниц</span>";

echo "</div>";

echo "</span>";


echo "</span>";


echo "<span class='span4'>";


echo "<div class='visitors'>";

echo "<span class='span6'>";
echo "<span title='{$globalvisits}' class='globvisitors'>{$globalvis}</span>";

echo "<span class='textstat'>Визитов</span>";

echo "</div>";

echo "<div class='visitors'>";

echo "<span title='{$globalvisits}' class='globvisitors'>{$globalvis}</span>";

echo "<span class='textstat'>Визитов (посетителей)</span>";
echo "</span>";


echo "<span class='span4'>";


echo "<div class='visitorsvis'>";

echo "<span title='{$globalvisitors}' class='globvisitors'>{$globalvisitor}</span>";

echo "<span class='textstat'>Посетителей</span>";

echo "</div>";

Expand Down Expand Up @@ -1441,7 +1476,7 @@ function bd_nice_number($n) {

echo "</ul>";

echo "<span class='allinfo span12 center'> <span class='span4'> <b> <img src='{$eyed}' /> Визиты:</b> Суммарное количество визитов. </span> <span class='span4'><b> <img src='{$usersd}' /> Посетители:</b> Количество уникальных посетителей. </span> <span class='span4'><b> <img src='{$oneuserd}' /> Просмотры:</b> Число просмотров страниц на сайте за отчетный период. </span></span>";
echo "<span class='allinfo span12 center'> <span class='span4'> <b> <img src='{$eyed}' /> Просмотры :</b> Число просмотров страниц на сайте за отчетный период. </span> <span class='span4'><b> <img src='{$usersd}' /> Визиты:</b> Суммарное количество визитов. </span> <span class='span4'><b> <img src='{$oneuserd}' /> Посетители:</b> Количество уникальных посетителей.</span></span>";



Expand Down

0 comments on commit b85c21a

Please sign in to comment.