Skip to content

Commit

Permalink
add YandexSearchPhrase
Browse files Browse the repository at this point in the history
add YandexSearchPhrase
  • Loading branch information
CB9TOIIIA committed Feb 13, 2017
1 parent 1973381 commit 42503ad
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 5 deletions.
2 changes: 1 addition & 1 deletion assets/css/sort.css
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ b > big { text-transform: uppercase; }
display: inline-block; width: 95%;
}
.uk-panel .minismall {
font-size: 14px !important; color: #101010 !important;
font-size: 1em !important; color: #101010 !important;
}
.uk-panel-box {
margin-bottom: 10px !important;
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.5.15</version>
<version>2.5.16</version>
<description><![CDATA[MyJBZooStat - это компонент статистики и менеджер системы комментирования Disqus.<br><br><iframe frameborder='0' allowtransparency='true' scrolling='no' src='https://tpv.sr/1QoBNn1/' width='510' height='300'></iframe>]]> </description>
<creationDate>28 June 2016</creationDate>
<administration>
Expand Down
4 changes: 2 additions & 2 deletions updatemyjbzoostat.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<description>MyJBZooStat</description>
<element>com_myjbzoostat</element>
<type>component</type>
<version>2.5.15</version>
<version>2.5.16</version>
<infourl title="MyJBZooStat">
https://github.com/CB9TOIIIA/MyJBZooStat/
</infourl>
<downloads>
<downloadurl type="full" format="zip"><![CDATA[https://github.com/CB9TOIIIA/MyJBZooStat/releases/download/2.5.15/com_myjbzoostat_stable_2.5.15.zip]]></downloadurl>
<downloadurl type="full" format="zip"><![CDATA[https://github.com/CB9TOIIIA/MyJBZooStat/releases/download/2.5.16/com_myjbzoostat_stable_2.5.16.zip]]></downloadurl>
</downloads>
<maintainer/>
<maintainerurl/>
Expand Down
54 changes: 53 additions & 1 deletion views/checkoneurl/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,13 @@
});
</script>';

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

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

?>
Expand Down Expand Up @@ -280,7 +287,21 @@
// dump($ResponceApiYandexexternalReferer,0,'ResponceApiYandexexternalReferer');
// dump($DataResponceApiYandexexternalReferer,0,'DataResponceApiYandexexternalReferer');

//переходы с фразы
$ApiYandexSearchPhrase = 'https://api-metrika.yandex.ru/stat/v1/data?id='.$counter_id;
$ApiYandexSearchPhrase .= '&oauth_token='.$app_token;
$ApiYandexSearchPhrase .= '&preset=traffic&dimensions=ym:s:<attribution>SearchPhrase&group=day&sort=ym:s:<attribution>SearchPhrase&metrics=ym:s:visits,ym:s:users,ym:s:pageviews';
$ApiYandexSearchPhrase .= '&date1='.$date1;
$ApiYandexSearchPhrase .= '&date2='.$date2;
$ApiYandexSearchPhrase .= '&limit=10000';
$ApiYandexSearchPhrase .= '&filters=(ym:pv:URL=*%27'.$myurltosite.'%27)';
$ResponceApiYandexSearchPhrase = MetrikaHelper::open_http($ApiYandexSearchPhrase, $method);
$DataResponceApiYandexSearchPhrase = json_decode($ResponceApiYandexSearchPhrase);

$CountYandexSearchPhrase = count($DataResponceApiYandexSearchPhrase->data);

// dump($ResponceApiYandexSearchPhrase,0,'ResponceApiYandexSearchPhrase');
// dump($DataResponceApiYandexSearchPhrase,0,'DataResponceApiYandexSearchPhrase');


$ApiYandexisRobot = 'https://api-metrika.yandex.ru/stat/v1/data?id='.$counter_id;
Expand Down Expand Up @@ -348,7 +369,7 @@ function nice_num($n) {
<?php echo "<p class='uk-text-bold'>Статистика по URL: " . "<a target='_blank' href=".strip_tags(trim($myurltosite)).">" .strip_tags(trim($myurltosite)). "</a></p>";?>
</div>
</div>

<br>
<?php endif; ?>

<div class="ct-chart"></div>
Expand Down Expand Up @@ -529,6 +550,37 @@ function nice_num($n) {
endif;
?>

<br>
<br>

<?php
if(count($DataResponceApiYandexSearchPhrase->data) > 1) :
echo "<h2 class='uk-text-bold uk-text-center'>Переходы по фразам</h2>";
echo "<table id='myTable3454' 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><td>Визиты <img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABmUlEQVQ4T6WTPUgcURDHZ2bX7w+0VLCwFPQu4e27AxvPpLIQrQWtBFNoZ2NiJxj7NFGsBC2vsNFC9JLO213Wvc7OQrRUBA3q2xlZYWEjZj3M697Mm9/M/OcNwn8eTMeXSiX76ub2lxCu17zqVto3WCzmLJHFsFqdSdv/AiilGgzSgyB8rbnu9+ShUqrnUeAUiToIaS1wj5cS35uAONggHYJwPyA1AYAIwrckQSbgOVjoiIF7iHAHAL8A8zYQTQnIcs3zVjMBecfZY5Zhy6IxBhhBgdXb66vm9q6uDQGcJoTRTMCg1n3E3Fvz/eOc1ksxwBZu9H0/yms9Gbpu+U0NErFeAB7rFrEuwAfHmTjxvF2llJ0eY95xChRF50EQXPyzgpzWn1HgAAA2zJ+7Bbul9T7+BxZixZhonyz6HbrueGYLea1XQGBZIthEC2YB5CezTBHQJYn5lFlB0mMCie8ifI9CZ0lwbKtLxI+Fwg9mmWfhG5t5IM5cl4jp5RhSqkzGrIRhGKTtOacwgyxz3Z1tI5VKxbw6xvds9hPRaxT6nhWaoAAAAABJRU5ErkJggg=='></td><td>Посетители <img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABmUlEQVQ4T6WTPUgcURDHZ2bX7w+0VLCwFPQu4e27AxvPpLIQrQWtBFNoZ2NiJxj7NFGsBC2vsNFC9JLO213Wvc7OQrRUBA3q2xlZYWEjZj3M697Mm9/M/OcNwn8eTMeXSiX76ub2lxCu17zqVto3WCzmLJHFsFqdSdv/AiilGgzSgyB8rbnu9+ShUqrnUeAUiToIaS1wj5cS35uAONggHYJwPyA1AYAIwrckQSbgOVjoiIF7iHAHAL8A8zYQTQnIcs3zVjMBecfZY5Zhy6IxBhhBgdXb66vm9q6uDQGcJoTRTMCg1n3E3Fvz/eOc1ksxwBZu9H0/yms9Gbpu+U0NErFeAB7rFrEuwAfHmTjxvF2llJ0eY95xChRF50EQXPyzgpzWn1HgAAA2zJ+7Bbul9T7+BxZixZhonyz6HbrueGYLea1XQGBZIthEC2YB5CezTBHQJYn5lFlB0mMCie8ifI9CZ0lwbKtLxI+Fwg9mmWfhG5t5IM5cl4jp5RhSqkzGrIRhGKTtOacwgyxz3Z1tI5VKxbw6xvds9hPRaxT6nhWaoAAAAABJRU5ErkJggg=='></td><td>Просмотры <img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABmUlEQVQ4T6WTPUgcURDHZ2bX7w+0VLCwFPQu4e27AxvPpLIQrQWtBFNoZ2NiJxj7NFGsBC2vsNFC9JLO213Wvc7OQrRUBA3q2xlZYWEjZj3M697Mm9/M/OcNwn8eTMeXSiX76ub2lxCu17zqVto3WCzmLJHFsFqdSdv/AiilGgzSgyB8rbnu9+ShUqrnUeAUiToIaS1wj5cS35uAONggHYJwPyA1AYAIwrckQSbgOVjoiIF7iHAHAL8A8zYQTQnIcs3zVjMBecfZY5Zhy6IxBhhBgdXb66vm9q6uDQGcJoTRTMCg1n3E3Fvz/eOc1ksxwBZu9H0/yms9Gbpu+U0NErFeAB7rFrEuwAfHmTjxvF2llJ0eY95xChRF50EQXPyzgpzWn1HgAAA2zJ+7Bbul9T7+BxZixZhonyz6HbrueGYLea1XQGBZIthEC2YB5CezTBHQJYn5lFlB0mMCie8ifI9CZ0lwbKtLxI+Fwg9mmWfhG5t5IM5cl4jp5RhSqkzGrIRhGKTtOacwgyxz3Z1tI5VKxbw6xvds9hPRaxT6nhWaoAAAAABJRU5ErkJggg=='></td></tr>";
echo "</thead>";
echo "<tbody>";

for ($i=0; $i < $CountYandexSearchPhrase ; $i++) {

$YandexSearchPhraseName = $DataResponceApiYandexSearchPhrase->data[$i]->dimensions['0']->name;
$YandexSearchPhraseMetrics = $DataResponceApiYandexSearchPhrase->data[$i]->metrics;

echo "<tr>";
echo "<td>" .$YandexSearchPhraseName. "</td>";
echo "<td>" . $YandexSearchPhraseMetrics['0']. "</td>";
echo "<td>" . $YandexSearchPhraseMetrics['1']. "</td>";
echo "<td>" . $YandexSearchPhraseMetrics['2']. "</td>";
echo "</tr>";
}

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

<br>
<br>
<?php if($myurltosite): ?>
Expand Down

0 comments on commit 42503ad

Please sign in to comment.