Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Who Downloaded This Attachment - for Gold Details »
Who Downloaded This Attachment - for Gold
Mod Version: 1.00, by Mr Blunt (Member) Mr Blunt is offline
Developer Last Online: Sep 2006 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 3.0.0 Rating: (0 vote - 0 average) Installs: 12
Released: 05 Apr 2004 Last Update: Never Downloads: 3
Not Supported  

// **********************************************
// **********************************************
// Hack to track Who Downloaded attachments
// Old vb2 hack modified to vbulletin 3.0 Gold
// Credit to TWTCommish for the original vb2 hack
// http://www.vbulletin.org/forum/showthread.php?t=36900
// **********************************************
// **********************************************
4 new templates
2 modified templates
1 modified php file
1 new php file

This hack allows admins, supermods, and mods to see who downloads each file. If you want to allow other groups, just add/subtract them from whodownloaded.php on the top line as desired.

Although I rewrote and tested this myself, and it works like a charm now, I'm not offering support for this. I'm just a Joe Average. This is an old old hack. I just had to change some words like "gettemplate" to "fetch_template" and "dooutput" to "print_output" and one instance of "post" changed to "attachment". Also had to modify table structures and of course figure out where to put everything. I'm fairly certain that this is up-to-snuff but don't take my word for it.

It doesn't track IP's or how many times a user may have downloaded. It just brings up a popup window with the usernames that have downloaded this atachment. Who knows, maybe someone else will build upon this.

Forgive me if I posted this in the wrong place or if it shouldn't be here at all.
Mods, feel free to do what you wish with this.
Just trying to give a little back to those who have taught me.


// **********************************************
// create a new template - whodownloads
// **********************************************

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


// **********************************************
// **********************************************
// create a new template - whodownloadsbit
// **********************************************

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


// **********************************************
// **********************************************
// create a new template - whodownloads_error
// **********************************************

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


// **********************************************
// **********************************************
// create a new template - whodownloads_error_nop
// **********************************************

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


// **********************************************
// **********************************************
// Find this in template - headinclude
// **********************************************

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

// **********************************************
// Change it to this
// **********************************************

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


// **********************************************
// **********************************************
// Find this in template - postbit_attachment
// **********************************************

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

// **********************************************
// Change it to this
// **********************************************

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


// **********************************************
// **********************************************
// create a new php file - whodownloaded.php
// place it in the main forum (upload) directory
// (same directory that has attachment.php)
// **********************************************

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


// **********************************************
// **********************************************
// Find this in attachment.php
// **********************************************

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

// **********************************************
// Change it to this
// **********************************************

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


// **********************************************
// **********************************************
// Run this SQL Query from Admincp
// **********************************************

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

If you had this installed previously, like for vb2, then don't rerun the query.
The query didn't change so I'D SUSPECT the old and new data is compatible.

And make sure you have completely removed the old vb2 hack beforehand or I suspect this would create a conflict.

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Similar Mod
Mod Developer Type Replies Last Post
Who Downloaded This Attachment akanevsky vBulletin 3.5 Add-ons 107 04 Jul 2011 15:06
Most Downloaded Attachment afterlab vBulletin 2.x Full Releases 19 14 Sep 2003 15:27

Comments
  #2  
Old 05 Apr 2004, 11:35
lasto lasto is offline
 
Join Date: Jan 2002
done it all m8

but when i click on who downloaded this - it goes to a blank page on a fresh screen instead of a popup

Went back over the hack still same thing

only thing i could`nt do was run the sql query cause of this error

An error occurred while attempting to execute your query. The following information was returned.
error number: 1060
error desc: Duplicate column name 'downloads'

but i have updated board from v2 to v3 so maybe thats why
Reply With Quote
  #3  
Old 05 Apr 2004, 11:41
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Real name: Rob
Can we get a screenshot and also, would you please put this in the TXT file for download instead of posting the code?
Reply With Quote
  #4  
Old 05 Apr 2004, 16:00
Mr Blunt Mr Blunt is offline
 
Join Date: Jan 2004
lasto,

I don't know how much "advise" I should give since I'm a newbie.
So take this with a grain of salt.

Are you sure you removed all of the old vb2 hack before installing mine?
This would be mandatory as there's several differences.
I'd revert all of these templates and files to vb3 gold form and then install it.
Also I have no idea if this is compatible or incompatible with any other vb hacks.

Boofo,
I don't know what I can/can't post so I made a zip with whodownloaded.php, whodownloaded.xml for the templates, and then text code. If you have to remove the XML, then go for it but I don't see the harm.

Also, here's 4 screenshots from 3 different styles I run.
1st and 2nd are vb3 default and vb2 default.
3rd & 4th reflect my board's customized style.
Attached Images
File Type: jpg screen-1.JPG (10.7 KB, 289 views)
File Type: jpg screen-2.JPG (11.5 KB, 235 views)
File Type: jpg screen-3.JPG (11.3 KB, 228 views)
File Type: jpg screen-4.JPG (12.0 KB, 173 views)
Attached Files
File Type: zip vb3-whodownloaded.zip (36.9 KB, 89 views)
Reply With Quote
  #5  
Old 05 Apr 2004, 16:08
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Real name: Rob
It's better to have the code in the file so as not to make the first post so long and to help those who don't want to have to copy all of the code in the message. It just makes it easier for everyone that way.
Reply With Quote
  #6  
Old 05 Apr 2004, 16:09
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Real name: Rob
Originally Posted by Mr Blunt
lasto,

I don't know how much "advise" I should give since I'm a newbie.
So take this with a grain of salt.

Are you sure you removed all of the old vb2 hack before installing mine?
This would be mandatory as there's several differences.
I'd revert all of these templates and files to vb3 gold form and then install it.
Also I have no idea if this is compatible or incompatible with any other vb hacks.

Boofo,
I don't know what I can/can't post so I made a zip with whodownloaded.php, whodownloaded.xml for the templates, and then text code. If you have to remove the XML, then go for it but I don't see the harm.

Also, here's 4 screenshots from 3 different styles I run.
1st and 2nd are vb3 default and vb2 default.
3rd & 4th reflect my board's customized style.
Any way to have it show how many downloads each user made?
Reply With Quote
  #7  
Old 05 Apr 2004, 16:12
Mr Blunt Mr Blunt is offline
 
Join Date: Jan 2004
Oh ya,

If you had this installed previously, like for vb2, then don't rerun the query.
The query didn't change so I'D SUSPECT the old and new data is compatible.

Maybe you, lasto, should delete that second query under USER called DOWNLOADS(2) or whatever that second one is now named, but then again, maybe you should wait for a more qualified person to help you.

I'll edit the top post to reflect this.
Reply With Quote
  #8  
Old 05 Apr 2004, 16:21
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Real name: Dean Clatworthy
Did you get permission of TWTCommish to port this modification ?
__________________
Dean Clatworthy - Web Developer/Designer
Reply With Quote
  #9  
Old 05 Apr 2004, 16:26
Mr Blunt Mr Blunt is offline
 
Join Date: Jan 2004
Boofo,

It's my first real hack, so I didn't want to get in trouble.
That's why I was cautious.

As for advancing the hack, I leave that up to you folks.
Personally, I'd like to see it log IP's of downloaders along with dates & times.
I think someone did this for the vb2 hack but I never saw it posted.

If I had a copy of that one, then I could probably port it over to vb3 if no one else wants to.

All I did to make this was follow the logic of the old hack and where TWT put everything and then found the appropriate new locations. I'm not "advanced" enough to "create from scratch" yet.
Sorry.
Reply With Quote
  #10  
Old 05 Apr 2004, 16:29
Mr Blunt Mr Blunt is offline
 
Join Date: Jan 2004
Originally Posted by Dean C
Did you get permission of TWTCommish to port this modification ?
No sir.

TWTCommish mentioned in the old thread that it's free for all and that people could build on it if they wanted, so I didn't see the need.

If you feel it's best to delete this then go for it.
I'm just a new kid on the block.
I don't want to rock any boats.

Like I said, just trying to give a little back to those who helped me learn.
I did give TWTCommish all the credit, I do believe.

Last edited by Mr Blunt; 05 Apr 2004 at 16:31.
Reply With Quote
  #11  
Old 05 Apr 2004, 20:15
Fi_InCogNiTo Fi_InCogNiTo is offline
 
Join Date: Jan 2003
I couldnt find any of that code in my attachment.php file....

Where should I add this code since it's not in the file?
Reply With Quote
  #12  
Old 05 Apr 2004, 20:22
Mr Blunt Mr Blunt is offline
 
Join Date: Jan 2004
Originally Posted by Fi_InCogNiTo
I couldnt find any of that code in my attachment.php file....

Where should I add this code since it's not in the file?
Unless you have another hack installed, that code I listed is in there.
It's right above this line.....


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Are you sure your using vb3 Gold??
Reply With Quote
  #13  
Old 05 Apr 2004, 20:35
Fi_InCogNiTo Fi_InCogNiTo is offline
 
Join Date: Jan 2003
No, ur right. I found it. I was looking in admincp/attachment.php. I used my text scanner and it didnt find it at all.....

/me goes off to look for another good scanner

EDIT: Works

Last edited by Fi_InCogNiTo; 05 Apr 2004 at 20:59.
Reply With Quote
  #14  
Old 06 Apr 2004, 02:03
Vivi Ornitier's Avatar
Vivi Ornitier Vivi Ornitier is offline
 
Join Date: Nov 2001
I had to change the postbit code a bit in order for the template ot work.

<a href="java_script_:whodownloaded($attachment[attachmentid])">Who Downloaded This?</a>

The java_script_:whodownloaded($attachment[attachmentid]) should be changed to javascript:whodownloaded($attachment[attachmentid]);
Reply With Quote
  #15  
Old 06 Apr 2004, 02:38
Mr Blunt Mr Blunt is offline
 
Join Date: Jan 2004
Vivi, I'm confused.
What do you click now to get the popup??

That href line you modified is the click.
The phrase "who downloaded this?" is the text I click to get the popup.

Or are you saying you just added a semi-colon inbetween ) and "
And if this semi colon is neccessary, then wouldn't it go after the question mark in the phrase??

Forgive me for questioning you.
I'm just trying to learn why.
And moreso, why mine works for me.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 02:52.

Layout Options | Width: Wide Color: