vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   vBulletin Attachment Downloads Tracker - Help needed (https://vborg.vbsupport.ru/showthread.php?t=175538)

J98680Bxxxxx 04-08-2008 05:11 PM

vBulletin Attachment Downloads Tracker - Help needed
 
The idea seems simple: track which users have downloaded vBulletin attachments. :)

Currently, only the views count on attachments is kept in the database, through the "attachmentviews" table.

Goals: :up:
1. Extend the database to include a table "attachmentsdownloaded" that records information on users who have downloaded attachments
$db->query_write("CREATE TABLE ".TABLE_PREFIX."attachmentdownloaded (userid int(10) unsigned NOT NULL default 0,attachmentid int(10) unsigned NOT NULL default 0,dateline int(10) unsigned NOT NULL default 0,ipaddress varchar(20) NOT NULL default '',PRIMARY KEY (userid,attachmentid),KEY dateline (attachmentid,dateline),KEY ipaddress (ipaddress))

2. Modify the "attachment.php" or any other file to record users information whenever the attachment views counter is updated?
if (!$vbulletin->GPC['thumb'] AND connection_status() == 0 AND $lastbyte == ($attachmentinfo['filesize'] - 1))
{
$db->query_write("INSERT INTO ".TABLE_PREFIX."attachmentdownloaded (userid, attachmentid, dateline, ipaddress) VALUES ($vbulletin->userinfo['userid'], $attachmentinfo[attachmentid], TIMENOW, IPADDRESS) ");
}

3. List attachments downloaded for each user

I have tested 1 & 2 but got the error: "Internet Explorer cannot download the file ?attachment.php?..."??? :eek:

Any help or a quick mods on this is highly appreciated.

Lynne 04-08-2008 07:02 PM

Something like this? Who Downloaded This Attachment

J98680Bxxxxx 04-08-2008 07:11 PM

Quote:

Originally Posted by Lynne (Post 1486162)
Something like this? Who Downloaded This Attachment


:up: Thanks Lynne, much appreciated. The mod you just referred to is perfect. It?s indeed what I have been looking for. Thanks again.


All times are GMT. The time now is 12:30 PM.

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.01217 seconds
  • Memory Usage 1,714KB
  • 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
  • (3)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