Advertisement:

Author Topic: Spiders Don't Increase Topic Views  (Read 26794 times)

Offline Randem

  • Jr. Member
  • **
  • Posts: 305
  • Gender: Male
    • Randem Systems
Re: Spiders Don't Increase Topic Views
« Reply #40 on: October 10, 2020, 03:37:04 AM »
Made a minor modification for SMF 2.1 RC2 support.
Code: [Select]
<operation>
<search position="replace"><![CDATA[ $smcFunc['db_query']('', '
UPDATE {db_prefix}topics
SET num_views = num_views + 1
WHERE id_topic = {int:current_topic}
AND id_member_started != {int:current_member}',
array(
'current_topic' => $topic,
'current_member' => $user_info['id'],
)
);
]]></search>
<add><![CDATA[
// ONLY INCREASE NUMBER OF TOPIC VIEWS IF NOT A SPIDER
$is_spider = detect_spider();
if(!$is_spider) {
$smcFunc['db_query']('', '
UPDATE {db_prefix}topics
SET num_views = num_views + 1
WHERE id_topic = {int:current_topic}
AND id_member_started != {int:current_member}',
array(
'current_topic' => $topic,
'current_member' => $user_info['id'],
)
);
}
]]></add>
</operation>
https://randemsystems.com/support/       -   Discusware to SMF Converter / BotBanish Support
https://blaxtonjames.com                         - Money, Knowledge And Power; Why You Are Missing All Three
https://joystickgangsta.com                      - An Experience You Can't Refuse
https://botbanish.com                                 - The Ultimate BOT Defender for SMF, OpenCart, WordPress  & Websites

Always ignore those who attempt to tell you what to think and believe those who will allow you think for yourself