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


All times are GMT. The time now is 08:02 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.02055 seconds
  • Memory Usage 1,748KB
  • 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
  • (3)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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