View Full Version : Who Downloaded This Attachment?
TWTCommish
04-01-2002, 10:00 PM
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 (http://www.movieforums.net/showthread.php?threadid=1385&view=attachments&pagenumber=5).
This is a vBHacker (https://vborg.vbsupport.ru/showthread.php?threadid=36378) hack, too. I highly encourage you to install vBHacker (https://vborg.vbsupport.ru/showthread.php?threadid=36378). I'll include a vBHacker (https://vborg.vbsupport.ru/showthread.php?threadid=36378)-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
<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,h eight=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:
<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,h eight=300, top=50, left=50"); }
-->
</script>
$headnewpm
Use this:
<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,h eight=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:
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...
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.
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.php?s=&attachmentid=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:+-------------------------------------------------------------------------------------------------+
| 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.
TWTCommish
04-14-2002, 09:54 PM
Like I said, I have no clue. But obviously all the commands have worked. I think this is a server side issue, and not really an issue with the hack, perhaps. I don't know what version of PHP or MySQL I'm running offhand, and I'm not up to finding out just yet. :D
wooolF[RM]
04-14-2002, 09:57 PM
]53 hacks installed and only one doesn't work... :(
* wooolF[RM] goes back in the corner and cries... :p
Chris M
04-15-2002, 12:07 PM
Useful...
This will be a Hack I install soon!
Satan
Jawelin
04-15-2002, 12:30 PM
Great hack and great idea!
As nakkid did, I enabled it only to Admin/Mods.
Besides, as suggested here,
Originally posted by WallStreat
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
[...]
i tried to modify myself with a stand-alone table to keep downloads.
A table containing attachid/userid as key, then a counter for multiple-times downloaded
attachments, and as requested dateline and ipaddress of the lastest download by that user.
First look, I should use code like this in attachment.php to add values to that table:
//HACK: Who downloaded attachment
if (!$attdl=$DB_site->query_first("SELECT * FROM attachment_download WHERE attachmentid='$attachmentid' AND userid='$bbuserinfo[userid]'") ) {
$usercounter=1;
} else {
$usercounter=$attdl[counter]++;
}
$ipaddress=getenv("REMOTE_ADDR");
$DB_site->query("REPLACE INTO attachment_download (attachmentid,userid,counter,dateline,ipaddress) VALUES ('$attachmentid','$bbuserinfo[userid]','$usercounter','".time()."','$ipaddress')");
//HACK: Who downloaded attachment
If would and with the agreement of TWTCommish, we could go ahead all together to modify the
whodownloaded.php file (and templates) to read such a table...
What do you think about ?
Bye
TWTCommish
04-15-2002, 12:32 PM
Well, I'm not opposed to it, if that's what you mean. :) The hack is free for anyone to use and modify as they please.
Lucky
04-16-2002, 01:59 AM
Great work.
Looking good on 2.2.2
Lucky
04-18-2002, 09:58 PM
I installed this hack and now when people reply to a post there post is put on top of the posts instead of below. I know that in the admin cp there is an option for this but it is not the problem. Any one know what is?
Also, most of the new post indicators are always on now as well, and it never changes.
TIA
TWTCommish
04-18-2002, 10:00 PM
Hmm. Sounds like you might've accidently changed or deleted a line somewhere...
wooolF[RM]
04-19-2002, 04:00 PM
]grrrrrrrr... still can't get it to work... :(
wooolF[RM]
04-20-2002, 08:46 PM
ok... this is my last try...
Lucky
04-21-2002, 01:06 AM
Originally posted by TWTCommish
Hmm. Sounds like you might've accidently changed or deleted a line somewhere...
No, I took out the hack and it still is doing the same. All was good before I installed this hack. Any ideas?
TIA
bandersen
04-21-2002, 04:02 PM
This is a nice hack and I have installed it using vbhacker. Worked fine except I did the attachment.php manually. I got the same errors as a few others here, but managed to sort it out by reading these posts - thanx!!
Now, I get one error I hope someone can help out with. I am on 2.2.5 and get this when clicking on the link "who downloaded this?":
----
Database error in vBulletin 2.2.5:
Invalid SQL: SELECT u.userid, u.username FROM user u WHERE u.downloads LIKE "1%" OR u.downloads LIKE "%1%" OR u.downloads LIKE "%1" ORDER BY u.username ASC
mysql error: Unknown column 'u.downloads' in 'where clause'
mysql error number: 1054
---
Now, If I view my ....whodownloaded.php in the browser it looks just fine...
Any hints are appreciated!
Edited: I think the above is due to a "parse error in line 56" in the attachment.php..... because of it I do not manage to get any downloads when clicking on the attachment link. Hence, the above sql error shows because no one downloaded yet??
How do I get rid of the parse error.... I have checked the coding in the attachment.php....
freeshares1
04-21-2002, 05:31 PM
I tried to install this using vbhacker and now i am getting errors.
When i try click on who downloaded this i get the following errors
Database error in vBulletin 2.2.4:
Invalid SQL: SELECT downloads FROM user WHERE userid = 1
mysql error: Unknown column 'downloads' in 'field list'
mysql error number: 1054
Date: Sunday 21st of April 2002 12:30:18 PM
Script: http://www.gamblingforums.net/vbportal/forums/vbportal/forums/attachment.php?postid=857
Referer: http://www.gamblingforums.net/vbportal/forums/showthread.php?threadid=56
When using vbhacker everything went ok except for the attachment.php part which i did manually.
Now i cant even download the attachment
attachment link
http://www.gamblingforums.net/vbportal/forums/showthread.php?threadid=56
bandersen
04-21-2002, 05:40 PM
Yes!... I now managed to get rid of the sql error I got when clicking on the link "who downloaded this?" (see post #52).
By running the whodownloaded_query in the whodownloaded_query.txt file!!!! ofcourse.....
(I really thought vbhacker took care of everything)
I am a novice.. so I am using Firefly's hack for running a query..not myphpAdmin.
The above should apply for more than me ;)
Now... that parse error....
TWTCommish
04-21-2002, 06:07 PM
Well, I can't know what's wrong with line 56 until I see it. :) Liines 50-60 should help...
bandersen
04-21-2002, 06:24 PM
Thank you TWTCommish!
I have attached the attachment file here.... I am never sure if I manage to spread the lines over several lines... you know. :rolleyes:
Thanks again.
Edit: here is the error:
Parse error: parse error in ...../forums/upload/attachment.php on line 58
freeshares1
04-21-2002, 06:36 PM
I have the same JS error.. I have checked my templates and it seems to be correct....
freeshares1
04-21-2002, 06:46 PM
I should have read the whole thread it works great now
Thanks
TWTCommish
04-21-2002, 08:47 PM
bandersen: please remove that file. I don't think you're allowed to post entire vBulletin files on here. You can only post parts of them. I'll download it so I can take a look, but I don't think it's allowed to be up there...
bandersen
04-21-2002, 08:51 PM
Sorry... I didnt know. It's gone.
TWTCommish
04-21-2002, 09:15 PM
Okay, on lines 53-57, you have this:
$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]");
$comma = ($dl[downloads]) ? ',' : '';
$DB_site->query("UPDATE user SET downloads = '$dl[downloads]$comma$attachmentid' WHERE userid = $bbuserinfo[userid]");REPLACE that with this:
$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 think that should work. Worth a try. :)
bandersen
04-21-2002, 09:36 PM
I tried... sorry.. didnt do it. Maybe there are more errors right before and after these lines? same coding there....
TWTCommish
04-21-2002, 09:43 PM
Right after the code I just gave you, take this part OUT:
} else {
$shutdownqueries[]="UPDATE LOW_PRIORITY attachment SET counter=counter+1 WHERE attachmentid='$attachmentid'";
}
Looks like you duplicated a few lines of code originally. :)
bandersen
04-21-2002, 10:13 PM
I've tried that.... Yahooooo... it works!!!
thanks a lot :)
Just one more thing..... :laugh: (just happy I got to see an image!).. it's not counting. If I click on the attachment; I can see it and my name shows up in the box... but the line below the link still shows 0 downloads. Admin not included in the counts... or something?
here's my test page/post if you care to take a look:
link (http://www.athlonarena.com/forums/upload/showthread.php?threadid=34)
Thanks again!
bandersen
04-21-2002, 10:15 PM
For some reason it works now! 1 download, but box says 2. It's ok. Wonderful.
bandersen
05-09-2002, 11:53 PM
What if a guest downloads?
How do you prevent guests from downloading... or identify that "guests" downloaded....
(when I download without being logged in... it counts, but no new names/guest).
I was planning to have downloadable demos located in its own forum, then use this script to see who downloaded.
Jadelit
06-06-2002, 12:42 AM
is there any way to make only admins and mods view this?
machiavelli33
06-06-2002, 07:06 PM
When I run the query I get the following error messages:
Error
SQL-query :
ALTER TABLE user ADD COLUMN downloads TEXT NOT NULL
MySQL said:
Duplicate column name 'downloads'
Its saying i have duplicate column names. I dont really know how to check for this in mysql so I appreciate if anyone can help me out on this.
Does deleting the existing "downloads" column affect my forum in any way?
TWTCommish
06-06-2002, 07:12 PM
As I told you in a PM, if you're getting that error, then the query has already been run and you can skip to the next step.
machiavelli33
06-06-2002, 07:25 PM
thanks for the reply. But now when I click on any attachments in my forum, I cant download them. I'm getting a
Parse error: parse error in /home/sites/site22/web/forums/attachment.php on line 55
Also I'm getting a runtime error whenever I move anywhere in my forum.
TWTCommish
06-06-2002, 07:29 PM
The first problem likely stemmed from an error in the code change in the attachment.php file. You might want to try that step again to make sure you got it right.
As for the other problem: do you mean a JavaScript error? If so, what's it say?
machiavelli33
06-06-2002, 07:35 PM
sometimes I get syntax errors when moving from one forum to another.
line: 126
char: 100
Error: Syntax error
Code: 0
I just also double checked in my attachment.php and its still doing the same thing.
Whenever I click on the WHO DOWNLOADED THIS link I get the following error:
Runtime error has occured. Do you wish to debug?
When I click on an attachment I get the following error:
Parse error: parse error in /home/sites/site22/web/forums/attachment.php on line 55
TWTCommish
06-06-2002, 07:51 PM
I need more information here. :) Examples of the error. What changes you made, etc. The JavaScript provided with this hack works just fine as far as I can tell, unless it conflicts with something else you've done, or unless it's been placed in the wrong place, etc.
machiavelli33
06-06-2002, 08:06 PM
I just uninstalled it. I've had the same problem with two forums now.
Jean147
08-14-2002, 12:56 AM
It seems that my whodownloadsbit does not work. :(
Old Donwloads are shown with "No Downloads found" like explained in the anouncement.
But a new Attachement, attached after installing this hack, just show the table with
Total Downloads: 2
User
Close Window
But the Users are not shown. Any help?
thx Jean
Tim Wheatley
09-01-2002, 04:53 PM
All you have to do is put the javascript for the attachment on showthread template instead of in phpinclude. That way it won't clash with his 'who posted' hack which you'd put that script into forum home main and forum display main.
Boofo
09-01-2002, 05:01 PM
How did you do that, Floren? :)
Originally posted by TECK
great hack. :)
i'll use it but a little modified. i'll make it visible only for mods and admins.
Gohan
09-01-2002, 07:55 PM
Great hack, does working on 2.2.7 :D
Thank ya!
TvNut
09-07-2002, 12:00 AM
Did anyone figure out what to use so admin/mods can only use this?
Thanks
Christoff
10-03-2002, 06:31 AM
Hi
Please please give us more data in the who downloaded this box. Accept usernames i would like to get at least dates of downloads!!! (Sorting by the date would be very nice!)
Regards
BusteR
kreftt
11-04-2002, 08:35 PM
thats a very nice hack, but:
wont it be a problem on large boards with lots of attachments? i imagine it would have to search 3000 users's downloads column which include lots of attachments that have long been deleted...
or am i wrong in assuming this?
Dynamic One
11-11-2002, 09:20 AM
Thanks TWTCommish. Job done well :).
partang2
11-15-2002, 01:59 PM
Works great on 2.2.8 Thanks!
esfron
01-01-2003, 05:23 PM
Thanks. I'll test it (2.2.9)
Edit: Just done one try by/for myself with a txt file on a clean board. Installed manually (no Vbhacker) and it's working on 2.2.9 without any hacks. You have to fix the CR (javascript) in headinclude.
Thanks again for this hack.
KnightCrash
01-19-2003, 02:16 AM
Did anyone figure out what to use so admin/mods can only use this?
Thanks
KnightCrash
01-19-2003, 01:53 PM
^^^^^^^bump^^^^^^^^
KnightCrash
01-20-2003, 12:53 AM
bump
magna
02-15-2003, 08:41 AM
would like to make this for admins only
Any help here, others would like to have it admins/mods
I would still like it admins only
great hack
thanks
TranceMaster
02-19-2003, 02:00 AM
Originally posted by TECK
great hack. :)
i'll use it but a little modified. i'll make it visible only for mods and admins.
ahhh
how would we go about doing this man?
Kars10
03-01-2003, 08:55 AM
With this addon only admins/supermods/mods can view the downloads!
Instructions in the zip-file.
Enjoy! :D
Slynderdale
03-02-2003, 11:30 AM
This is a great idea for a hack but it lacked a few things so I decided to make my own, Intsead of storing it in the user table and seperate them with a comma and also storing the same attachment id multiple times, i create a new table called attachment_view which keep track of the number of views and the last time a user views the attachment, Ill post a screen shot below.
firas
03-14-2003, 07:12 AM
First of al, thanx for this gr8 hack
I've got a slight problme:
----------------------------
Database error in vBulletin 2.3.0:
Invalid SQL: SELECT u.userid, u.username FROM user u WHERE u.downloads LIKE "1%" OR u.downloads LIKE "%1%" OR u.downloads LIKE "%1" ORDER BY u.username ASC
mysql error: Unknown column 'u.downloads' in 'where clause'
mysql error number: 1054
Date: Friday 14th of March 2003 12:02:00 PM
Script: http://localhost/vb2/vb2/whodownloaded.php?s==1
Referer:
--------------------------
I noticed that it says http://localhost/vb2/vb2/whodownloaded.php
whereas my folder is:
http://localhost/vb2/whodownloaded.php
Can anyone help?
Bison
03-20-2003, 06:46 AM
03-02-03 at 08:30 AM Slynderdale said this in Post #91 (https://vborg.vbsupport.ru/showthread.php?postid=360051#post360051)
This is a great idea for a hack but it lacked a few things so I decided to make my own, Intsead of storing it in the user table and seperate them with a comma and also storing the same attachment id multiple times, i create a new table called attachment_view which keep track of the number of views and the last time a user views the attachment, Ill post a screen shot below.
Would you like to share your version? The one here is constantly breaking and everytime I click on the "Who Downloaded this" link, nothing pops up! :cry:
Bison
03-20-2003, 06:47 AM
Scrap Post ... [Mods Delete this please]
partang2
03-21-2003, 10:13 AM
Did you change to this?
<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,h eight=300, top=50, left=50"); }
-->
</script>
The function line needs to start on it's own line.
Bison
03-21-2003, 12:00 PM
That's *exactly* how I have it ...
Boofo
03-21-2003, 01:58 PM
It won't work on past attachments. It only saves the data for attachments made after the hack was installed. ;)
Bison
03-21-2003, 06:28 PM
Well this hack must have broke somewhere cause it been installed a long time ago. To follow up on your theory Boofo, I just created a attachment and the script doesn't open up another window!
The worse thing about it is that i'm not getting a error message at all!
I believe after installing Bira's "contract posts" hack, it broke this one ... don't quote me on this but I can't seem to find the reason other than this.
I also have another Java Scipt in the headerinclude template for the Registered Members hack, and that one works great ... I just think that the way vb is created and how each of these pages are generated there must be a connection between these *two* hacks that involve the postbit, and showthread.
I've done the liberty of moving this script to this hack into the showthread header and still doesn't work.
Boofo
03-21-2003, 07:50 PM
Try doing an onLoad= in the body tag for multiple java scripts that might be messing with one another. I found this solution after running in to a couple of them not playing nice together. Just a thought. ;)
Slynderdale
03-21-2003, 07:52 PM
I believe theres a javascript conflict with biras's contract posts hack. I have the same problem.
Bison
03-21-2003, 08:50 PM
Today at 04:50 PM Boofo said this in Post #99 (https://vborg.vbsupport.ru/showthread.php?postid=370937#post370937)
Try doing an onLoad= in the body tag for multiple java scripts that might be messing with one another. I found this solution after running in to a couple of them not playing nice together. Just a thought. ;)
there's no "body tag" in the "headinclude" template bro ... this problem resides in the postbit betwen Bira's Hack and this hack ... I just know it.
It might be that Bira's Cotract Post Hack is using the <DIV> tag and I don't know if this is true, but that might as well be the problem since they both are working in the same location.
If someone else have these two hacks workin together ... please reply to this! :)
believe theres a javascript conflict with biras's contract posts hack. I have the same problem.
I bet there is ... only I need to find out how the page is put together to see if that js script (In Bira's Hack) is using the proper method of placing javaScript code within HTML ... or maybe this hack needs to be re-written.
Bison
03-22-2003, 05:58 PM
^ ^
laycomp
03-29-2003, 04:21 PM
Greets and great hack!
I am having a problem here in that the number displayed in "This has been downloaded x time(s). is not corresponding to the "who downloaded this" users in the pop up box.
As seen by attached file, the hack indicates 19 downloads, however, the popup box indicates only 7 members downloading the file.
Any suggestions please?
Bison
03-29-2003, 04:40 PM
Someone may have used one of those download accelerators to download the attachment. These programs use two or more connections to download files. This maybe the reason why your numbers are off ... to test my theory, install a download program (Like Download Accelerator Plus) and download an attachment! :)
Boofo
03-29-2003, 05:19 PM
Either that or maybe the same people downloaded it more than once. :)
laycomp
03-29-2003, 10:38 PM
Yesterday at 06:40 PM Rolodex said this in Post #104 (https://vborg.vbsupport.ru/showthread.php?postid=375106#post375106)
Someone may have used one of those download accelerators to download the attachment. These programs use two or more connections to download files. This maybe the reason why your numbers are off ... to test my theory, install a download program (Like Download Accelerator Plus) and download an attachment! :)
I did try out the theory using GetRight and in my case, I downloaded a newly placed attachment and it only counted one download. Perhaps other download managers work differently but yes, a possibility since there are no external linking in my server log files.
As Boofo suggested aybe people download it twice or also another copy for backup or forget where they put it and download again, others may just download not remembering they downloaded already.
Thanks guys and sorry, should have thought of this possibility.
What im doing this ??
ALTER TABLE user ADD COLUMN downloads TEXT NOT NUL
JeffyJoe
04-12-2003, 12:03 AM
you must do this query or the pop up window will give your an error
it updates your database with the new string commands
(I am an extreme newbie myself so my wording may be wrong, but my point should still be taken) :)
04-07-03 at 12:18 PM TeEq said this in Post #107 (https://vborg.vbsupport.ru/showthread.php?postid=378671#post378671)
What im doing this ??
ALTER TABLE user ADD COLUMN downloads TEXT NOT NUL
dstruct2k
04-16-2003, 04:16 AM
Ohhh, I like the hack, but this is great to see when I try to open an attachment....
Database error in vBulletin 2.3.0:
Invalid SQL: SELECT downloads FROM user WHERE userid = 1
mysql error:
mysql error number: 0
Date: Tuesday 15th of April 2003 11:14:18 PM
Script: http://myhost/forums/forums/attachment.php?s=&postid=1247
Referer: http://myhost/forums/showthread.php?s=&postid=1247
I also get an error trying to open the "Who Downloaded" box.
Invalid SQL: SELECT u.userid, u.username FROM user u WHERE u.downloads LIKE "37%" OR u.downloads LIKE "%37%" OR u.downloads LIKE "%37" ORDER BY u.username ASC
mysql error:
mysql error number: 0
Date: Tuesday 15th of April 2003 11:15:36 PM
Script: http://myhost/forums/forums/whodownloaded.php?s=&attachmentid=37
Referer:
Something tells me I have to modify both my tables and my queries... Damn these older hacks! :laugh:
dstruct2k
04-16-2003, 04:18 AM
Ohhh.... The vBHacker file doesn't run the query itself....
My bad, problem solved. :D
Christoff
04-16-2003, 03:05 PM
03-02-03 at 01:30 PM Slynderdale said this in Post #91 (https://vborg.vbsupport.ru/showthread.php?postid=360051#post360051)
This is a great idea for a hack but it lacked a few things so I decided to make my own...
Hi.. could you share your work with us?
It looks great...
If you do meybe you could think about a small change [or just tell us how to made such one]...
Instead of showing number of downloads per user, make another register for each download so that we could know when a person downloaded this [ if that was few times really or just one with a DL accelerator]...
I beg you :D [probably not only me!]
Regards
subu1
04-17-2003, 08:11 AM
ups, i have a white popup on my 2.2.8 Version.
Can everybady help me
kabresh
07-02-2003, 09:06 AM
anyone got this working on vb2.3.0?
Christoff
07-21-2003, 06:00 PM
subu: check all the thread, there are some posts about your problem.
laycomp
08-13-2003, 12:40 PM
I am currently using vb 3.0 b5 and must keep track of downloads, is this hack going to be available for vb3?
Is it that hard to port over to the new v3.0 vb version?
Thank you.
Morpheus84
08-13-2003, 12:55 PM
Jelsoft has sayed, the won't would see vB 3 hacks.
laycomp
08-30-2003, 04:51 AM
Maybe someone can do it for me for a fee? If ANYONE is interested, you may contact me via pm with your email, also I would like to add other important options, this to be discussed with project. Send me your quote for hack as is and then we'll discuss mods. This open to anyone and have hack ready when vb3 comes out, I will not require exclusivity so consider that too when pricing.
Thanks.
NoAhBoDy
12-12-2003, 07:12 PM
fyi, the instructions for this hack need some repair work...any reference to "whodownloadsbits" needs to be changed to "whodownloadsbit" (in the instructions and the php files) and the javascript edit for the headinclude template needs to be changed to:
<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,h eight=300, top=50, left=50"); }
-->
</script>
$headnewpm
(ie, move the function line to it's own line as referenced on the 2nd or 3rd page of this thread....)
nice hack tho...just what i was looking for :)
laycomp
12-12-2003, 09:17 PM
Yes, it's very cool hack, thanks man!
Mu5icMan
01-13-2004, 02:04 PM
Is it possible to modify this Hack so you can see the dates and times when someone has downloaded a file even if they have downloaded it more than once.
Mr Blunt
04-05-2004, 06:01 AM
Just thought I'd let y'all know I rewrote this to be compatible with vb3 Gold.
https://vborg.vbsupport.ru/showthread.php?t=63468
Thanks for the original hack TWTCommish!!!!
The new one has the exact same functionality as yours.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.