Commit 8f7c38fa authored by Vadim's avatar Vadim

Version 2.3.1

Забыл внести новый параметр в вызывающие функцию и шорткод
parent 055085a4
......@@ -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}";
}
......
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