vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Who Downloaded This Attachment? (https://vborg.vbsupport.ru/showthread.php?t=36900)

TWTCommish 04-01-2002 10:00 PM

Who Downloaded This Attachment?
 
This hack is pretty straightforward: it tracks the attachments your members download, and therefore allows people to view which people have downloaded which attachment. This may be expanded later into a more comprehensive, expanded "download center," but for now, it's just a small hack. :)

Screenshot?
Surely. Attached to the next post.

Online Demo?
Here ya' go.

This is a vBHacker hack, too. I highly encourage you to install vBHacker. I'll include a vBHacker-generated installation text file in the attached archive, though, so no one will be left out. Enjoy. Let me know if you run into any problems.

TWTCommish 04-02-2002 12:58 PM

Screenshot (a little fuzzy and the green is overly bright...I guess I used the wrong format or something). :)

afterlab 04-02-2002 01:21 PM

Nice, as always, TWTCommish! I'll install it tonight. Great idea.

AntiOnline 04-02-2002 01:34 PM

Greetings:

You forgot to include the whodownloaded.php file in the zip.

AntiOnline 04-02-2002 01:39 PM

Greetings:

You also forgot to include the sql statement to update the DB.

TWTCommish 04-02-2002 04:52 PM

I'm an idiot. :D I'll fix that now. Sorry everybody. I'm a moron.

AntiOnline 04-02-2002 05:58 PM

Greetings:

Wow, no need to beat yourself up twice in one post! Heh, everything works great now, thanks.

Velocd 04-02-2002 06:06 PM

That demo you have is alittle strange, for it says there have been 24 downloads for that attachment, yet it tracks only TWTCommish. That is unless ofcourse TWTCommish downloaded the file 24 times. ;)

Anyway, its probably just a glitch or something. I'm gonna install it right now, real nice work =)

TWTCommish 04-02-2002 06:21 PM

Nope, no glitch: it's just that it can't track downloads that happened before the tracking system was put in place. :)

69-FLy-gUy 04-02-2002 10:35 PM

wow.. you rock... I just logged on to request this.. LOL;)

TWTCommish 04-02-2002 10:38 PM

LOL. :laugh: Well, I guess I've got a supernatural sense of timing. Glad you like it.

69-FLy-gUy 04-02-2002 10:44 PM

ok.. i have a problem though.. the link doesn't work:(

TWTCommish 04-02-2002 10:45 PM

You're gonna have to be a little more specific. :)

69-FLy-gUy 04-02-2002 10:48 PM

ok... at the bottom of the page.. it says there are errors on th epage.. when i click the link.. who has downloaded this.. nothing happens at all.. the error that i get from IE is this

Object Expected

TWTCommish 04-02-2002 10:50 PM

Hmmm. Did you remember to add the JS function to your headinclude template? Sounds like it's having trouble with the JS popup function...

69-FLy-gUy 04-02-2002 10:51 PM

i used vbhacker....

and i am checking it... and it appears it is there.. here is what it looks likek

Code:

<script language="JavaScript">
  <!-- START HIDEfunction whodownloaded(attachmentid) {
    window.open
("whodownloaded.php?s=$session[sessionhash]&attachmentid=" + attachmentid,
 "whodownloaded", "toolbar=no,scrollbars=yes,resizable=no,width=240,height=300, top=50, left=50"); }
  -->
</script>

$headnewpm


maverick1236 04-03-2002 12:04 AM

same problem here

java popup doesnt work

all code is there

TWTCommish 04-03-2002 12:06 AM

I know what's wrong. Don't use this:

Code:

<script language="JavaScript">
  <!-- START HIDEfunction whodownloaded(attachmentid) {
    window.open
("whodownloaded.php?s=$session[sessionhash]&attachmentid=" + attachmentid,
 "whodownloaded", "toolbar=no,scrollbars=yes,resizable=no,width=240,height=300, top=50, left=50"); }
  -->
</script>

$headnewpm

Use this:

Code:

<script language="JavaScript">
  <!-- START HIDE
function whodownloaded(attachmentid) {
    window.open
("whodownloaded.php?s=$session[sessionhash]&attachmentid=" + attachmentid,
 "whodownloaded", "toolbar=no,scrollbars=yes,resizable=no,width=240,height=300, top=50, left=50"); }
  -->
</script>

$headnewpm

See, the function line needs to start on it's own line. I suppose I forgot a crucial line break. I'll go back and fix it. :)

maverick1236 04-03-2002 12:21 AM

WELL DONE

Works great now

thanks for the great support

69-FLy-gUy 04-03-2002 03:24 AM

Thanks! It works now

WallStreat 04-03-2002 03:56 AM

1. A suggestion: to store the dowload info into a new table instead of creating a new field in the user table.

2. The new whodownloaded table could contain the following info:
- attachmentid
- userid
- dateline
- ip

3. This way, we can also find out how many a particular user downloaded the same attachment, the date & time downloaded or the ip address (if needed for control purpose)

4. Moreover this can prevent bloating the $bbuserinfo variable as the download field can get quite big

TWTCommish 04-03-2002 03:59 AM

Well, I'd thought of all that already, hence this line in my original post:

Quote:

This may be expanded later into a more comprehensive, expanded "download center," but for now, it's just a small hack. :)
I may consider expanding this down the line, but for now it's just a small addition. I'm not worried about the $bbuserinfo variable, however. Variables can hold an awful lot of text without becoming any real kind of problem. I think it'd have to be disgustingly large to cause "bloating" to the point of difficulty.

If anyone else seconds the idea to expand this hack, say so... :)

WallStreat 04-03-2002 04:29 AM

anyway this is a great hack, well done :)

Crazy Mofo 04-12-2002 07:18 AM

hi i get a 404 error :(

Jadelit 04-12-2002 07:46 AM

OK I have a Mutiple Attachments hack installed... when I click on the like.. I get this error...

Code:

Invalid SQL: SELECT counter FROM attachment WHERE attachmentid = undefined
mysql error: Unknown column 'undefined' in 'where clause'

mysql error number: 1054

what does this mean..

TWTCommish 04-12-2002 12:16 PM

I don't know how you got the text "undefined" there. Did you modify any of the files?

As for the 404 error: make sure you upload the whodownloaded.php file to the main forums directory!

squawell 04-12-2002 01:56 PM

nice job!!

did u ever think add the download times numbers??

TWTCommish 04-12-2002 01:58 PM

Yeah, I thought of it, but decided to just start simple. I might expand this big time later on...if I ever finish the other 3 or so hacks I'm working on. LOL.

TECK 04-12-2002 03:34 PM

great hack. :)
i'll use it but a little modified. i'll make it visible only for mods and admins.

wooolF[RM] 04-12-2002 11:45 PM

]Your SQL-query has been executed successfully

SQL-query :
ALTER TABLE user ADD COLUMN downloads TEXT NOT NULL


Clicking on link (I have downloaded file to be sure it have some records)

New window pop-ups ->>>

Database error in vBulletin 2.2.4:

Invalid SQL: SELECT u.userid, u.username FROM user u WHERE u.downloads LIKE "56%" OR u.downloads LIKE "%56%" OR u.downloads LIKE "%56" ORDER BY u.username ASC
mysql error: Unknown column 'u.downloads' in 'where clause'

mysql error number: 1054

Date: Saturday 13th of April 2002 02:42:16 AM
Script: http://blablabla/forum/whodownloaded...ttachmentid=56
Referer:

Any help please?... I rechecked twice if I edited/added everything right...

wooolF[RM] 04-13-2002 12:02 AM

]just checked MySQL database under user table

maybe this screenshot will tell you something... it doesn't to me...

something telling me there's something wrong with this code:
Code:

+-------------------------------------------------------------------------------------------------+
| In attachment.php, replace this code:                                                          |
+-------------------------------------------------------------------------------------------------+
if ($noshutdownfunc) {
  $DB_site->query("UPDATE attachment SET counter=counter+1 WHERE attachmentid='$attachmentid'");
} else {
  $shutdownqueries[]="UPDATE LOW_PRIORITY attachment SET counter=counter+1 WHERE attachmentid='$attachmentid'";
}
+-------------------------------------------------------------------------------------------------+

+-------------------------------------------------------------------------------------------------+
| With this code:                                                                                |
+-------------------------------------------------------------------------------------------------+
if ($noshutdownfunc) {
  $DB_site->query("UPDATE attachment SET counter=counter+1 WHERE attachmentid='$attachmentid'");
} else {
  $shutdownqueries[]="UPDATE LOW_PRIORITY attachment SET counter=counter+1 WHERE attachmentid='$attachmentid'";
}
$dl    = $DB_site->query_first("SELECT downloads FROM user WHERE userid = $bbuserinfo[userid]");
$comma = ($dl[downloads]) ? ',' : '';
$DB_site->query("UPDATE user SET downloads = '$dl[downloads]$comma$attachmentid' WHERE userid = $bbuserinfo[userid]");
+-------------------------------------------------------------------------------------------------+

I'm not sure tho'...

wooolF[RM] 04-13-2002 10:58 AM

*cough*

wooolF[RM] 04-14-2002 11:29 AM

]*cough* again... :(

wooolF[RM] 04-14-2002 08:08 PM

]and again... :(

TWTCommish 04-14-2002 08:12 PM

Please stop bumping...it's getting out of hand. :)

wooolF[RM] 04-14-2002 09:10 PM

Aren't u the man who created this wonderfull hack?

TWTCommish 04-14-2002 09:12 PM

Indeedy.

wooolF[RM] 04-14-2002 09:20 PM

]well... I need some help if u have seen it... :( Can u please help me? As I said I rechecked everything (manual) twice... :(

TWTCommish 04-14-2002 09:47 PM

I've looked only very briefly at your problem. I have 100% positively no clue as to what is wrong. If I were going to guess, I'd say maybe we're running different versions of MySQL, or something of the sort.

wooolF[RM] 04-14-2002 09:51 PM

vBB 2.2.4 running on PHP v4.1.2 and MySQL v3.23.36.


All times are GMT. The time now is 04:46 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.01442 seconds
  • Memory Usage 1,812KB
  • 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
  • (5)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete