Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
bg-az-counter
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
azbyka_bg
bg-az-counter
Commits
f75eab89
Commit
f75eab89
authored
Apr 05, 2019
by
Vadim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Version 2.1.1
Исправил ошибку: не отображался запрет на повторное голосование при обновлении страницы.
parent
e5347e53
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
bg_az-counter.php
bg_az-counter.php
+2
-2
rating.php
inc/rating.php
+1
-2
rating.js
js/rating.js
+2
-1
No files found.
bg_az-counter.php
View file @
f75eab89
...
@@ -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.1
Version: 2.1
.1
Author: VBog
Author: VBog
Author URI: https://bogaiskov.ru
Author URI: https://bogaiskov.ru
License: GPL2
License: GPL2
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,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.1'
);
define
(
'BG_COUNTER_VERSION'
,
'2.1
.1
'
);
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'
);
...
...
inc/rating.php
View file @
f75eab89
...
@@ -62,13 +62,12 @@ function bg_az_counter_rating($type, $id) {
...
@@ -62,13 +62,12 @@ function bg_az_counter_rating($type, $id) {
error_log
(
PHP_EOL
.
date
(
"Y-m-d H:i:s "
,
time
())
.
" ITEM-SCORE. Сервер вернул ответ неудачи:
\n
"
.
$json
,
3
,
BG_COUNTER_LOG
);
error_log
(
PHP_EOL
.
date
(
"Y-m-d H:i:s "
,
time
())
.
" ITEM-SCORE. Сервер вернул ответ неудачи:
\n
"
.
$json
,
3
,
BG_COUNTER_LOG
);
$score
=
0
;
$score
=
0
;
$votes
=
0
;
$votes
=
0
;
$alreadyVoted
=
false
;
}
else
{
}
else
{
$data
=
$response
->
data
;
$data
=
$response
->
data
;
$score
=
number_format
((
float
)
$data
->
score
,
1
,
','
,
''
);
$score
=
number_format
((
float
)
$data
->
score
,
1
,
','
,
''
);
$votes
=
$data
->
votes
;
$votes
=
$data
->
votes
;
$alreadyVoted
=
$data
->
alreadyVoted
;
}
}
$alreadyVoted
=
'false'
;
// Сервер голосовать не должен!!!
$txt_votes
=
bg_counter_txt_votes
(
$votes
);
$txt_votes
=
bg_counter_txt_votes
(
$votes
);
echo
<<<HTML
echo
<<<HTML
...
...
js/rating.js
View file @
f75eab89
...
@@ -107,7 +107,8 @@ function getRate(type, id) {
...
@@ -107,7 +107,8 @@ function getRate(type, id) {
jQuery
(
'#bg_counter_votes'
).
html
(
response
.
data
.
votes
);
jQuery
(
'#bg_counter_votes'
).
html
(
response
.
data
.
votes
);
jQuery
(
'#bg_counter_votes_txt'
).
html
(
txt_votes
);
jQuery
(
'#bg_counter_votes_txt'
).
html
(
txt_votes
);
jQuery
(
'#bg_counter_score'
).
html
(
start_rate_index
);
jQuery
(
'#bg_counter_score'
).
html
(
start_rate_index
);
iniRatingState
(
start_rate_index
,
response
.
data
.
alreadyVoted
);
rating_voted
=
response
.
data
.
alreadyVoted
;
iniRatingState
(
start_rate_index
,
rating_voted
);
}
else
{
}
else
{
if
(
bg_counter
.
debug
)
console
.
log
(
'GET REQUEST: '
+
request
+
' ERROR: '
+
response
.
error
);
if
(
bg_counter
.
debug
)
console
.
log
(
'GET REQUEST: '
+
request
+
' ERROR: '
+
response
.
error
);
jQuery
(
'#bg_counter_votes'
).
html
(
'0'
);
jQuery
(
'#bg_counter_votes'
).
html
(
'0'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment