diff --git a/class/class.core.php b/class/class.core.php index 58e2a45..7cdfa88 100755 --- a/class/class.core.php +++ b/class/class.core.php @@ -730,6 +730,16 @@ $main_content ); + // GetField + $main_content = preg_replace_callback( + '/\[tag:get:([a-zA-Z0-9-_]+)(|:([0-9]+))+?\]/', + function ($match) { + return get_field($match[1], $match[3]); + }, + $main_content + ); + + $main_content = str_replace('[tag:docdate]', translate_date(strftime(DATE_FORMAT, $this->curentdoc->document_published)), $main_content); $main_content = str_replace('[tag:doctime]', translate_date(strftime(TIME_FORMAT, $this->curentdoc->document_published)), $main_content); $main_content = str_replace('[tag:humandate]', human_date($this->curentdoc->document_published), $main_content); diff --git a/functions/func.breadcrumbs.php b/functions/func.breadcrumbs.php index 77ead07..f020fd0 100644 --- a/functions/func.breadcrumbs.php +++ b/functions/func.breadcrumbs.php @@ -55,6 +55,8 @@ $lang_home_alias = getDocument($home_id); + $number = 1; + $search = [ '[name]', '[link]', @@ -166,7 +168,7 @@ $bread_crumb .= $bread_sepparator; } - unset($search, $replace, $link, $number, $row_doc); + unset($search, $replace, $link, $row_doc); } } } @@ -175,7 +177,7 @@ if ((isset($AVE_Core->curentdoc->bread_link_box_last) && $AVE_Core->curentdoc->bread_link_box_last == 0)) $bread_crumb .= ''; else if (get_settings('bread_link_box_last') == 1 || (isset($AVE_Core->curentdoc->bread_link_box_last) && $AVE_Core->curentdoc->bread_link_box_last == 1)) - $bread_crumb .= sprintf($bread_self_box, $current->document_breadcrum_title); + $bread_crumb .= str_replace('[count]', $number+1, sprintf($bread_self_box, $current->document_breadcrum_title)); if (! $noprint) $crumbs[$curent_document] = sprintf($bread_box, $bread_crumb); diff --git a/functions/func.logs.php b/functions/func.logs.php index 1a806b0..f261eda 100755 --- a/functions/func.logs.php +++ b/functions/func.logs.php @@ -32,7 +32,7 @@ $logdata[]=array( 'log_time' => time(), 'log_ip' => $_SERVER['REMOTE_ADDR'], - 'log_url' => $_SERVER['QUERY_STRING'], + 'log_url' => $_SERVER['REQUEST_URI'], 'log_user_id' => (isset($_SESSION['user_id']) ? $_SESSION['user_id'] : '0'), 'log_user_name' => (isset($_SESSION['user_name']) ? $_SESSION['user_name'] : 'Anonymous'), 'log_text' => $message, @@ -65,7 +65,7 @@ $logsql[] = array( 'log_time' => time(), 'log_ip' => $_SERVER['REMOTE_ADDR'], - 'log_url' => $_SERVER['QUERY_STRING'], + 'log_url' => $_SERVER['REQUEST_URI'], 'log_user_id' => $_SESSION['user_id'], 'log_user_name' => $_SESSION['user_name'], 'log_text' => $message @@ -96,7 +96,7 @@ $log404[] = array( 'log_time' => time(), 'log_ip' => @$_SERVER['REMOTE_ADDR'], - 'log_query' => @$_SERVER['QUERY_STRING'], + 'log_query' => @$_SERVER['REQUEST_URI'], 'log_user_agent' => @$_SERVER['HTTP_USER_AGENT'], 'log_user_referer' => (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''), 'log_request_uri' => @$_SERVER['REQUEST_URI'] diff --git a/functions/func.pagination.php b/functions/func.pagination.php index 1b731e8..5520837 100644 --- a/functions/func.pagination.php +++ b/functions/func.pagination.php @@ -1,141 +1,141 @@ - 5 && $curent_page > 3) - { - $first = str_replace('data-pagination="{s}"', 'data-pagination="1"', $template_label); - - $nav .= sprintf($link_box, str_replace(array('{s}', '{t}'), $start_label, str_replace(array('&'. $type .'={s}', '&' . $type .'={s}', '/' . $type . '-{s}'), '', $first))); - if ($separator_label != '') - $nav .= sprintf($separator_box, $separator_label); - } - - // Предыдущая - if ($curent_page > 1) - { - if ($curent_page - 1 == 1) - $nav .= sprintf($link_box, str_replace(array('{s}', '{t}'), $prev_label, str_replace(array('&'. $type .'={s}', '&' . $type .'={s}', '/' . $type . '-{s}'), '', $template_label))); - else - $nav .= sprintf($link_box, str_replace('{t}', $prev_label, str_replace('{s}', ($curent_page - 1), $template_label))); - } - - foreach($pages as $val) - { - if ($val >= 1 && $val <= $total_pages) - { - if ($curent_page == $val) - { - // Текущий номер страницы (активная страница) - $nav .= sprintf($link_box, sprintf($active_box, str_replace(array('{s}', '{t}'), $val, $curent_page))); - } - else - { - if ($val == 1) - { - // Страница номер 1 - $nav .= sprintf($link_box, str_replace(array('{s}', '{t}'), $val, str_replace(array('&'.$type.'={s}','&'.$type.'={s}','/'.$type.'-{s}'), '', $template_label))); - } - else - { - // Остальные неактивные номера страниц - $nav .= sprintf($link_box, str_replace(array('{s}', '{t}'), $val, $template_label)); - } - } - } - } - - // Следующая - if ($curent_page < $total_pages) - { - $nav .= sprintf($link_box, str_replace('{t}', $next_label, str_replace('{s}', ($curent_page + 1), $template_label))); - } - - // Последняя - if ($total_pages > 5 && ($curent_page < $total_pages-2)) - { - if ($separator_label != '') - $nav .= sprintf($separator_box, $separator_label); - - $nav .= sprintf($link_box, str_replace('{t}', $end_label, str_replace('{s}', $total_pages, $template_label))); - } - - // Страница ХХХ из ХХХ - if ($nav != '') - { - if ($total_label != '') - $nav = sprintf($total_box, sprintf($total_label, $curent_page, $total_pages)) . $nav; - - // Оборачиваем в общий контейнер - if ($navi_box != '') - $nav = sprintf($navi_box, $nav); - } - - return $nav; - } - + 5 && $curent_page > 3) + { + $first = str_replace('data-pagination="{s}"', 'data-pagination="1"', $template_label); + + $nav .= sprintf($link_box, str_replace(array('{s}', '{t}'), $start_label, str_replace(array('&'. $type .'={s}', '&' . $type .'={s}', '/' . $type . '-{s}'), '', $first))); + if ($separator_label != '') + $nav .= sprintf($separator_box, $separator_label); + } + + // Предыдущая + if ($curent_page > 1) + { + if ($curent_page - 1 == 1) + $nav .= sprintf($link_box, str_replace(array('{s}', '{t}'), $prev_label, str_replace(array('&'. $type .'={s}', '&' . $type .'={s}', '/' . $type . '-{s}'), '', $template_label))); + else + $nav .= sprintf($link_box, str_replace('{t}', $prev_label, str_replace('{s}', ($curent_page - 1), $template_label))); + } + + foreach($pages as $val) + { + if ($val >= 1 && $val <= $total_pages) + { + if ($curent_page == $val) + { + // Текущий номер страницы (активная страница) + $nav .= sprintf($link_box, sprintf($active_box, str_replace(array('{s}', '{t}'), $val, $curent_page))); + } + else + { + if ($val == 1) + { + // Страница номер 1 + $nav .= sprintf($link_box, str_replace(array('{s}', '{t}'), $val, str_replace(array('&'.$type.'={s}','&'.$type.'={s}','/'.$type.'-{s}'), '', $template_label))); + } + else + { + // Остальные неактивные номера страниц + $nav .= sprintf($link_box, str_replace(array('{s}', '{t}'), $val, $template_label)); + } + } + } + } + + // Следующая + if ($curent_page < $total_pages) + { + $nav .= sprintf($link_box, str_replace('{t}', $next_label, str_replace('{s}', ($curent_page + 1), $template_label))); + } + + // Последняя + if ($total_pages > 5 && ($curent_page < $total_pages-2)) + { + if ($separator_label != '') + $nav .= sprintf($separator_box, $separator_label); + + $nav .= sprintf($link_box, str_replace('{t}', $end_label, str_replace('{s}', $total_pages, $template_label))); + } + + // Страница ХХХ из ХХХ + if ($nav != '') + { + if ($total_label != '') + $nav = sprintf($total_box, sprintf($total_label, $curent_page, $total_pages)) . $nav; + + // Оборачиваем в общий контейнер + if ($navi_box != '') + $nav = sprintf($navi_box, $nav); + } + + return $nav; + } + ?> \ No newline at end of file