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
8f7c38fa
Commit
8f7c38fa
authored
Apr 08, 2019
by
Vadim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Version 2.3.1
Забыл внести новый параметр в вызывающие функцию и шорткод
parent
055085a4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
counter.php
inc/counter.php
+9
-6
No files found.
inc/counter.php
View file @
8f7c38fa
...
...
@@ -143,7 +143,7 @@ function setAllCounts ($request) {
Отображает разметку текста для отображения кол-ва просмотров
и кол-ва читающих пост пользователей
******************************************************************************************/
function
bg_az_counter_views
(
$type
=
null
,
$id
=
null
,
$now
=
null
,
$rate
=
null
,
$views
=
null
)
{
function
bg_az_counter_views
(
$type
=
null
,
$id
=
null
,
$now
=
null
,
$rate
=
null
,
$views
=
null
,
$pr
=
null
)
{
global
$project
;
$option
=
get_option
(
'bg_counter_options'
);
...
...
@@ -179,14 +179,16 @@ function bg_az_counter_views ($type=null, $id=null, $now=null, $rate=null, $view
$proj
=
preg_replace
(
'#[\.\/\\\\]#i'
,
'_'
,
$proj
)
;
}
$proj
=
'/project/'
.
$proj
;
if
(
$project
!=
$proj
)
$id
=
null
;
// Заглушка для ссылок на другие проекты
if
(
get_post_meta
(
$id
,
'link'
,
true
))
$id
=
null
;
if
(
is_null
(
$pr
)
&&
((
$project
!=
$proj
)
||
get_post_meta
(
$id
,
'link'
,
true
)))
$id
=
null
;
// Заглушка для ссылок на другие проекты
}
if
(
!
is_null
(
$type
)
&&
!
is_null
(
$id
))
{
$sum
=
'<i title="Просмотры страницы" class="fa fa-eye"></i> <span class="bg-az-counter-views"></span>'
;
$users
=
' <i title="Сейчас читают страницу" class="fa fa-user-o"></i> <span class="bg-az-counter-now"></span>'
;
$score
=
' <i title="Оценка пользователей" class="fa fa-star-o"></i> <span class="bg-az-counter-score"></span>'
;
$quote
=
'<span class="bg-az-counter" data-type="'
.
$type
.
'" data-ID="'
.
$id
.
'">'
.
(
$views
?
$sum
:
''
)
.
(
$now
?
$users
:
''
)
.
(
$rate
?
$score
:
''
)
.
'</span>'
;
$score
=
' <i title="Оценка пользователей" class="fa fa-star-o"></i> <span class="bg-az-counter-score"></span>'
;
if
(
!
is_null
(
$pr
))
$dataPr
=
' data-project="'
.
$pr
.
'"'
;
else
$dataPr
=
""
;
$quote
=
'<span class="bg-az-counter"'
.
$dataPr
.
' data-type="'
.
$type
.
'" data-ID="'
.
$id
.
'">'
.
(
$views
?
$sum
:
''
)
.
(
$now
?
$users
:
''
)
.
(
$rate
?
$score
:
''
)
.
'</span>'
;
return
$quote
;
}
else
return
""
;
}
...
...
@@ -205,13 +207,14 @@ function bg_az_counter_views ($type=null, $id=null, $now=null, $rate=null, $view
function
bg_counter_shortcode
(
$atts
)
{
global
$post
;
extract
(
shortcode_atts
(
array
(
'project'
=>
null
,
'type'
=>
null
,
'id'
=>
null
,
'views'
=>
null
,
'now'
=>
null
,
'rate'
=>
null
),
$atts
)
);
$quote
=
bg_az_counter_views
(
$type
,
$id
,
$now
,
$rate
,
$views
);
$quote
=
bg_az_counter_views
(
$type
,
$id
,
$now
,
$rate
,
$views
,
$project
);
return
"
{
$quote
}
"
;
}
...
...
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