Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Sources/Logging.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ function writeLog($force = false)
logSpider();
}

// Don't log guests anymore - helps during bot attacks.
if (!empty($modSettings['no_guest_logging']) && !empty($user_info['is_guest']))
return;

// Don't mark them as online more than every so often.
if (!empty($_SESSION['log_time']) && $_SESSION['log_time'] >= (time() - 8) && !$force)
return;
Expand Down
3 changes: 2 additions & 1 deletion Sources/ManageSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ function ModifyBasicSettings($return_config = false)
array('check', 'hitStats'),
'',

// Guest stats.
// Guest stats
array('check', 'no_guest_logging'),
array('check', 'no_guest_views'),
'',

Expand Down
2 changes: 1 addition & 1 deletion Themes/default/BoardIndex.template.php
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ function template_ic_block_online()
</h4>
</div>
<p class="inline">
', $context['show_who'] ? '<a href="' . $scripturl . '?action=who">' : '', '<strong>', $txt['online'], ': </strong>', comma_format($context['num_guests']), ' ', $context['num_guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ', comma_format($context['num_users_online']), ' ', $context['num_users_online'] == 1 ? $txt['user'] : $txt['users'];
', $context['show_who'] ? '<a href="' . $scripturl . '?action=who">' : '', '<strong>', $txt['online'], ': </strong>', empty($modSettings['no_guest_logging']) ? comma_format($context['num_guests']) . ' ' . ($context['num_guests'] == 1 ? $txt['guest'] : $txt['guests']) . ', ' : '', comma_format($context['num_users_online']), ' ', $context['num_users_online'] == 1 ? $txt['user'] : $txt['users'];

// Handle hidden users and buddies.
$bracketList = array();
Expand Down
1 change: 1 addition & 0 deletions Themes/default/languages/Help.english.php
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@
// argument(s): scripturl
$helptxt['who_enabled'] = 'This setting allows you to turn on or off the <a href="%1$s?action=who" target="_blank" rel="noopener">Who\'s Online</a> page, which shows who is browsing the forum and what they are doing.';

$helptxt['no_guest_logging'] = 'This setting prevents guests from being included in the Users Online counts. Guest and bot activity can cause excessive IO, so this may help during a bot attack.';
$helptxt['no_guest_views'] = 'This setting disables incrementing views for guests as well as bots. Bot activity can cause excessive IO, and is often disguised as guest activity, so this may help during a bot attack.';

$helptxt['recycle_enable'] = '&quot;Recycles&quot; deleted topics and posts to the specified board.';
Expand Down
1 change: 1 addition & 0 deletions Themes/default/languages/ManageSettings.english.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
$txt['timeLoadPageEnable'] = 'Display time taken to create every page';
$txt['disableHostnameLookup'] = 'Disable hostname lookups';
$txt['who_enabled'] = 'Enable who\'s online list';
$txt['no_guest_logging'] = 'Do not include guests or bots in Users Online stats';
$txt['no_guest_views'] = 'Disable counting views for guests and bots';
$txt['meta_keywords'] = 'Meta keywords associated with forum';
$txt['meta_keywords_note'] = 'For search engines. Leave blank for default.';
Expand Down
Loading