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-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... :(
[high]* wooolF[RM] goes back in the corner and cries... :p[/high]

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,
Quote:

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:
PHP Code:

//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

Quote:

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/vbport...php?postid=857
Referer: http://www.gamblingforums.net/vbport...hp?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/vbport...hp?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:

PHP Code:

$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:

PHP Code:

$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:

PHP Code:

} 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

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:
Quote:


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? :)

Quote:

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


All times are GMT. The time now is 04:17 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.01281 seconds
  • Memory Usage 1,838KB
  • 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
  • (4)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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