updated core to 7.73

This commit is contained in:
2020-09-24 17:04:08 +02:00
parent 084d28842a
commit 7d87153100
524 changed files with 25194 additions and 7745 deletions
+17 -4
View File
@@ -57,7 +57,7 @@ function statistics_exit() {
// in which case we need to bootstrap to the session phase anyway.
drupal_bootstrap(DRUPAL_BOOTSTRAP_VARIABLES);
if (variable_get('statistics_count_content_views', 0)) {
if (variable_get('statistics_count_content_views', 0) && !variable_get('statistics_count_content_views_ajax', 0)) {
// We are counting content views.
if (arg(0) == 'node' && is_numeric(arg(1)) && arg(2) == NULL) {
// A node has been viewed, so update the node's counters.
@@ -74,8 +74,6 @@ function statistics_exit() {
}
}
if (variable_get('statistics_enable_access_log', 0)) {
drupal_bootstrap(DRUPAL_BOOTSTRAP_SESSION);
// For anonymous users unicode.inc will not have been loaded.
include_once DRUPAL_ROOT . '/includes/unicode.inc';
// Log this page access.
@@ -115,6 +113,21 @@ function statistics_permission() {
* Implements hook_node_view().
*/
function statistics_node_view($node, $view_mode) {
// Attach Ajax node count statistics if configured.
if (variable_get('statistics_count_content_views', 0) && variable_get('statistics_count_content_views_ajax', 0)) {
if (!empty($node->nid) && $view_mode == 'full' && node_is_page($node) && empty($node->in_preview)) {
$statistics = drupal_get_path('module', 'statistics') . '/statistics.js';
$node->content['#attached']['js'][$statistics] = array(
'scope' => 'footer',
);
$settings = array('data' => array('nid' => $node->nid), 'url' => url(drupal_get_path('module', 'statistics') . '/statistics.php'));
$node->content['#attached']['js'][] = array(
'data' => array('statistics' => $settings),
'type' => 'setting',
);
}
}
if ($view_mode != 'rss') {
if (user_access('view post access counter')) {
$statistics = statistics_get($node->nid);
@@ -230,7 +243,7 @@ function statistics_user_delete($account) {
* Implements hook_cron().
*/
function statistics_cron() {
$statistics_timestamp = variable_get('statistics_day_timestamp', '');
$statistics_timestamp = variable_get('statistics_day_timestamp', 0);
if ((REQUEST_TIME - $statistics_timestamp) >= 86400) {
// Reset day counts.