vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Mini Mods - Attachment Views Flood Check (https://vborg.vbsupport.ru/showthread.php?t=158529)

AlexanderT 09-22-2007 10:00 PM

Attachment Views Flood Check
 
Only 56 thread views, but 4163 attachment views: We all know how wrongly configured download clients and search bots gone berserk can inflate the view counts of attachments.

To solve the problem, I wrote this mini-mod that (temporarily) stores the information of the downloader - more specifically, it generates and stores a hash made out of his IP, his User ID (0 for guests), and the Attachment ID. This hash will "timeout" after x seconds (default: 60) and the timeout will be renewed whenever the person reinitiates the download within that time-frame. In other words, only when there's no download attempt within x seconds will a new download request by the same user of the same attachment be considered a new view count.

This mod adds 1 to 2 highly optimized database queries whenever attachments are downloaded. Unless you run a high-traffic forum with lots and lots of attachment downloads, this should not cause any problems.

This mod also requires a tiny filechange; you find the installation instruction in the attached readme.txt.

Tips for improvements are always welcomed. Also feel free to build your own products based on this one (with attribution please).

maxicep 09-23-2007 12:42 PM

thanks reserved.

muratksk 09-23-2007 01:11 PM

thanks :)

Hornstar 09-23-2007 10:32 PM

Thanks, I aways thought that maybe a member had a bot, that just kept downloading the attachment over and over to waste my bandwidth.

AlexanderT 09-24-2007 06:02 AM

Quote:

Originally Posted by hornstar1337 (Post 1345492)
Thanks, I aways thought that maybe a member had a bot, that just kept downloading the attachment over and over to waste my bandwidth.

Note that this mod does not prevent users from reinitiating a download (it would be trivial to implement though!). It only prevents them from artificially increasing the download views counter.


All times are GMT. The time now is 12:19 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00979 seconds
  • Memory Usage 1,717KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete