Commit 835f0606 authored by Vadim's avatar Vadim

Version 2.7.6

* Исправлены мелкие ошибки
parent 11b0b353
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
Plugin Name: Bg Az-Counter Plugin Name: Bg Az-Counter
Plugin URI: https://bogaiskov.ru Plugin URI: https://bogaiskov.ru
Description: Подсчет количества посещений страниц на базе stat.azbyka.ru Description: Подсчет количества посещений страниц на базе stat.azbyka.ru
Version: 2.7.5 Version: 2.7.6
Author: VBog Author: VBog
Author URI: https://bogaiskov.ru Author URI: https://bogaiskov.ru
License: GPL2 License: GPL2
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
if ( !defined('ABSPATH') ) { if ( !defined('ABSPATH') ) {
die( 'Sorry, you are not allowed to access this page directly.' ); die( 'Sorry, you are not allowed to access this page directly.' );
} }
define('BG_COUNTER_VERSION', '2.7.5'); define('BG_COUNTER_VERSION', '2.7.6');
define('BG_COUNTER_LOG', dirname(__FILE__ ).'/bg_counter.log'); define('BG_COUNTER_LOG', dirname(__FILE__ ).'/bg_counter.log');
define('BG_COUNTER_STAT_COUNTERS','https://stat.azbyka.ru/counters'); define('BG_COUNTER_STAT_COUNTERS','https://stat.azbyka.ru/counters');
......
...@@ -61,6 +61,7 @@ function getPopularPosts ($limit, $offset=0, $number=false) { ...@@ -61,6 +61,7 @@ function getPopularPosts ($limit, $offset=0, $number=false) {
if (!$id) continue; if (!$id) continue;
$post = get_post($id); $post = get_post($id);
if (!$post) continue; if (!$post) continue;
if ($post->post_status != 'publish') continue;
$title = $post->post_title; $title = $post->post_title;
$link = '<a href="'. get_permalink($post).'" title="'.$title.'" data-ID="'.$p->id.'" data-type="'.$p->type.'" data-value="'.$p->value.'" data-status="'.$post->post_status.'">'.$title.'</a>'; $link = '<a href="'. get_permalink($post).'" title="'.$title.'" data-ID="'.$p->id.'" data-type="'.$p->type.'" data-value="'.$p->value.'" data-status="'.$post->post_status.'">'.$title.'</a>';
$quote .= '<li>'.$link.' <span class="bg-az-count">'.bg_counter_number_format($p->value).'</span></li>'. PHP_EOL; $quote .= '<li>'.$link.' <span class="bg-az-count">'.bg_counter_number_format($p->value).'</span></li>'. PHP_EOL;
...@@ -269,8 +270,8 @@ function bg_counter_number_format ($num) { ...@@ -269,8 +270,8 @@ function bg_counter_number_format ($num) {
$num = round($num/1000000.0, 0)."&nbsp;млн."; $num = round($num/1000000.0, 0)."&nbsp;млн.";
else else
$num = round($num/1000000.0, 1)."&nbsp;млн."; $num = round($num/1000000.0, 1)."&nbsp;млн.";
} elseif ($num > 10000.0) { } elseif ($num > 1000.0) {
if ($num > 100000.0) if ($num > 10000.0)
$num = round($num/1000.0, 0)."&nbsp;тыс."; $num = round($num/1000.0, 0)."&nbsp;тыс.";
else else
$num = round($num/1000.0, 1)."&nbsp;тыс."; $num = round($num/1000.0, 1)."&nbsp;тыс.";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment