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
2dbbcf7a
Commit
2dbbcf7a
authored
Apr 03, 2019
by
Vadim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Version 2.0.1
Readme и забытый шорт-код [bg_counter_post_rating]
parent
4000262c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
1 deletion
+15
-1
README.md
README.md
+0
-0
bg_az-counter.php
bg_az-counter.php
+1
-1
rating.php
inc/rating.php
+14
-0
No files found.
README.md
View file @
2dbbcf7a
This diff is collapsed.
Click to expand it.
bg_az-counter.php
View file @
2dbbcf7a
...
...
@@ -3,7 +3,7 @@
Plugin Name: Bg Az-Counter
Plugin URI: https://bogaiskov.ru
Description: Подсчет количества посещений страниц на базе stat.azbyka.ru
Version: 2.0
Version: 2.0
.1
Author: VBog
Author URI: https://bogaiskov.ru
License: GPL2
...
...
inc/rating.php
View file @
2dbbcf7a
...
...
@@ -250,8 +250,11 @@ function setAllRatings ($request) {
******************************************************************************************/
// Регистрируем шорт-код bg_az_rating
add_shortcode
(
'bg_az_rating'
,
'bg_az_rating_shortcode'
);
// Регистрируем шорт-код bg_counter_post_rating
add_shortcode
(
'bg_counter_post_rating'
,
'bg_counter_post_rating_shortcode'
);
// [bg_az_rating]
// Выводит на экран форму для голосования
function
bg_az_rating_shortcode
(
$atts
)
{
extract
(
shortcode_atts
(
array
(
'type'
=>
null
,
...
...
@@ -267,6 +270,17 @@ function bg_az_rating_shortcode( $atts ) {
$quote
=
bg_az_counter_rating
(
$type
,
$id
);
return
"
{
$quote
}
"
;
}
// [bg_counter_post_rating limit='10']
// Выводит на экран список популярных постов
function
bg_counter_post_rating_shortcode
(
$atts
)
{
global
$post
;
extract
(
shortcode_atts
(
array
(
'limit'
=>
'10'
,
'number'
=>
false
),
$atts
)
);
$quote
=
getPostRating
(
$limit
,
0
,
(
bool
)
$number
);
return
"
{
$quote
}
"
;
}
// Склоняем слово "голос"
function
bg_counter_txt_votes
(
$votes
){
...
...
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