vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Whodownloaded_IP with Dates (https://vborg.vbsupport.ru/showthread.php?t=93167)

Mr Blunt 07-28-2005 10:00 PM

Whodownloaded_IP with Dates
 
Welcome to Mr Blunt's "Whodownloaded_IP" Series for vBulletin 3.5.2


This is FREE CODE AND CAN BE used, abused, and released as desired!!
I only ask it REMAIN FREE - unless maybe you compensate me as well??
If any code looks familiar, I'm sorry and ASSURE YOU it's coincidence!!

Paypal Donations are graciously accepted if you like this script.
I'm just a broke amateur who enjoys writing free stuff (for now).
Donations goto my - Help Rebuild My PC Fund.
But the script is free if your broke too ... So enjoy it either way!!

https://vborg.vbsupport.ru/external/2010/02/12.gif
mr_blunt@sbcglobal.net

Please email me for comments, questions, or anything else on your mind.
Put the exact word "Whodownloaded" in subject to get by my spam filters!
My nick "Mr Blunt" is also at www.vbulletin.org & www.vbulletin.com
Support thread: https://vborg.vbsupport.ru/showthread.php?t=93167


IMPORTANT KEY NOTES:
This script REQUIRES vBulletin 3.5.0 or above and was tested with vb 3.5.2
Failure to upload all files to server WILL PRODUCE DATABASE ERRORS.
Install "Product" file as a "PRODUCT" ... not as a "PLUGIN" or "STYLE".


Features of Whodownloaded_IP:
  1. Log fileid & userid for EVERY download.
  2. Optionally log date, username, filename for easy tracing after deletions.
  3. Optionally log IP's and ALT_IP's (ALT_IP could be the IP behind a proxy).
  4. File deletions won't delete OUR info, so admins can still backtrack.
  5. Customizable width of popup so admins & members get different sizes.
  6. Customizable viewing permissions for the popup.
  7. Customizable phrases for non english forums.
  8. The button to open popup is easy to add to templates.
  9. Click any name in the popup to view user's profile.
  10. Click file date in the popup to view the post where the file is located.
  11. Hover the paperclip by dates to get downloads id# for easy referencing.
  12. Template edits are "additions", not "modifications", so no conflictions.
  13. Powered by one 3rd party database table, a few vBulletin addon fields.
  14. Admins can now search database by any criteria (partial terms are OK).
Whodownloaded (PRE-IP-v100) Uninstallation Procedures
JUST IN CASE YOU HAVE ANY OF MY OLD vb3.0.x VERSIONS:
Uninstall any "NON-IP" version before installing this.
vBulletin PHP FILE: attachment.php -- (307 versions edited this)
3rd Party PHP FILE: whodownloaded.php
vBulletin TEMPLATE: postbit_attachment
vBulletin TEMPLATE: headinclude
3rd Party TEMPLATE: whodownloads
3rd Party TEMPLATE: whodownloadsbit
3rd Party TEMPLATE: whodownloads_error
3rd Party TEMPLATE: whodownloads_error_nop
vBulletin DATABASE TABLE: user
3rd Party DATABASE FIELD: user.downloads
  1. Revert my old code out of "postbit_attachment" template.
  2. Revert my old code out of "headinclude" template (if still there).
  3. Revert all other templates listed (that deletes them).
  4. Delete the whodownloaded.php file.
  5. vB350 gave a new attachment.php so forget about that old file, forever.
  6. DO NOT DELETE OLD "downloads" FIELD UNTIL WE TRANSFER DATA TO NEW TABLE!
  7. DO NOT DELETE OLD "downloads" FIELD UNLESS NO OTHER HACKS ARE USING IT!!
  8. NEVER DELETE VBULLETIN'S "USER" TABLE ... NEVER EVER!!!!!!!!
Whodownloaded_IP Installation/Upgrade Procedures:
  1. For non-English forums - EDIT product phrases in the Product XML.
  2. UPLOAD & Overwrite all files from the UPLOAD folder to your server.
  3. IMPORT 'product_blunts_whodl_ip.xml' and select "Allow Overwrite".
  4. MERGE 'style_blunts_whodl_ip.xml' over your styles (ignore version).
  5. SET controls in AdminCP 'Usergroup Permissions'.
  6. SET controls in AdminCP 'vBulletin Options'.
  7. DONE ... Hope You Enjoy It!!!
NOTE: If you have other hacks that edit a same STYLE TEMPLATE, then SKIP STEP #4 AND manually edit templates as listed further down.

Test it and come back to the file's vbulletin.org forum support thread and CLICK INSTALL so I can alert you when this hack gets important updates. NO, I DO NOT SPAM!!! Alerts will only be sent AFTER major changes!!


Whodownloaded_IP Uninstallation Procedures:
  1. Revert (or remove code from) any templates which you added button to.
  2. Delete file 'includes/xml/bitfield_blunts_whodl_ip.xml' from server.
  3. Delete file 'includes/xml/cpnav_blunts_whodl_ip.xml' from server.
  4. Delete PRODUCT 'Whodownloaded_IP' from AdminCP Products.
  5. Read Screen & Click button if you want to delete data table (optional).
  6. Delete file 'blunts_whodownloaded_ip.php' from server.
  7. Delete file 'admincp/bitfield_blunts_whodl_ip.xml' from server.
  8. Delete file '/images/attach/blunts_whodl_vertical.bmp' from server.
  9. Done ... Thank You For Checking It Out!!!
Do NOT uninstall prior versions before v120 is installed.
And the order of steps is important, so please be careful.


Whodownloaded_IP Files To Upload:
  1. /blunts_whodownloaded_ip.php
  2. /admincp/admin_blunts_whodl_ip.php
  3. /images/attach/blunts_whodl_vertical.bmp
  4. /includes/xml/bitfield_blunts_whodl_ip.xml
  5. /includes/xml/cpnav_blunts_whodl_ip.xml
Whodownloaded_IP Product File Contents:
File Name: product_blunts_whodl_ip.xml
Product ID: blunts_whodl_ip
Title: Whodownloaded_IP
Version: 1.2.0

3rd Party PLUGIN: Whodownloaded IP - Enable Bitfields
3rd Party PLUGIN: Whodownloaded IP - Enable Viewing
3rd Party PLUGIN: Whodownloaded IP - Enable Logging
3rd Party MASTER PHRASES: 65 Phrases with 'blunts_whodl_' prefix
3rd Party MASTER TEMPLATE: blunts_whodownloaded_ip_main
3rd Party MASTER TEMPLATE: blunts_whodownloaded_ip_namebit
3rd Party MASTER TEMPLATE: blunts_whodownloaded_ip_datebit
3rd Party DATABASE TABLE: blunts_whodownloaded_ip
3rd Party DATABASE FIELD: blunts_whodownloaded_ip.whodownloaded_ipid
3rd Party DATABASE FIELD: blunts_whodownloaded_ip.userid
3rd Party DATABASE FIELD: blunts_whodownloaded_ip.username
3rd Party DATABASE FIELD: blunts_whodownloaded_ip.filename
3rd Party DATABASE FIELD: blunts_whodownloaded_ip.fileid
3rd Party DATABASE FIELD: blunts_whodownloaded_ip.ipaddress
3rd Party DATABASE FIELD: blunts_whodownloaded_ip.alt_ip
3rd Party DATABASE FIELD: blunts_whodownloaded_ip.dateline
3rd Party DATABASE FIELD: usergroup.bluntswhodlpermissions
3rd Party DATABASE FIELD: settinggroup.blunts_whodl
3rd Party DATABASE FIELD: settings.blunts_whodl_popisactive
3rd Party DATABASE FIELD: settings.blunts_whodl_poplarge
3rd Party DATABASE FIELD: settings.blunts_whodl_popsmall
3rd Party DATABASE FIELD: settings.blunts_whodl_logwhat


Whodownloaded_IP Style File Contents:
File Name: style_blunts_whodl_ip.xml
OVERWRITES these 4 standard vBulletin templates:

vBulletin Template: modifyattachmentsbit (November 1st, 2005)
vBulletin Template: postbit_attachment (Aug 20th, 2005)
vBulletin Template: postbit_attachmentmoderated (Aug 20th, 2005)
vBulletin Template: postbit_attachmentthumbnail (Aug 20th, 2005)

Use these manual template edit instructions if you use other hacks!!

Template: modifyattachmentsbit
FIND THIS:
Code:

<div class="smallfont">$post[postdate] <if condition="!$show['detailedtime']"><span class="time">$post[posttime]</span></if></div>
ADD THIS BELOW IT:
Code:

<if condition="$show['blunts_whodl_width']"><div class="smallfont"><input type="button" class="button" value="$vbphrase[blunts_whodl_who_downloaded]" tabindex="1" onclick="window.open('blunts_whodownloaded_ip.php?$session[sessionurl]fid=$post[attachmentid]','blunts_whodownloaded_ip','toolbar=no, scrollbars=yes, resizable=yes, width=$show[blunts_whodl_width], height=450, top=50, left=50'); return false;" title="$vbphrase[blunts_whodl_who_downloaded]: $post[attachmentid]" /></div></if>
Template: postbit_attachment
Template: postbit_attachmentmoderated
FIND THE LAST:
Code:

</tr>
ADD THIS BEFORE IT:
Code:

<td><if condition="$show['blunts_whodl_width']"><input type="button" class="button" value="$vbphrase[blunts_whodl_who_downloaded]" tabindex="1" onclick="window.open('blunts_whodownloaded_ip.php?$session[sessionurl]fid=$attachment[attachmentid]','blunts_whodownloaded_ip','toolbar=no, scrollbars=yes, resizable=yes, width=$show[blunts_whodl_width], height=450, top=50, left=50'); return false;" title="$vbphrase[blunts_whodl_who_downloaded]: $attachment[attachmentid]" /></if></td>
Template: postbit_attachmentthumbnail
FIND THE LAST:
Code:

&nbsp;<if condition="$show['br']"><br /><br /></if>
ADD THIS BEFORE IT:
Code:

<if condition="$show['blunts_whodl_width']">
        <if condition="is_browser('ie', '5.5')">
                <input type="button" class="button" value="$vbphrase[blunts_whodl_who_downloaded]" tabindex="1" onclick="window.open('blunts_whodownloaded_ip.php?$session[sessionurl]fid=$attachment[attachmentid]','blunts_whodownloaded_ip','toolbar=no, scrollbars=yes, resizable=yes, width=$show[blunts_whodl_width], height=450, top=50, left=50'); return false;" title="$vbphrase[blunts_whodl_who_downloaded]: $attachment[attachmentid]" style="writing-mode:tb-rl" />
        <else />
                <a href="blunts_whodownloaded_ip.php?$session[sessionurl]fid=$attachment[attachmentid]"<if condition="$show['newwindow']"> target="_blank"</if>><img class="button" src="$stylevar[imgdir_attach]/blunts_whodl_vertical.bmp" alt="$vbphrase[blunts_whodl_who_downloaded]" border="1" title="$vbphrase[blunts_whodl_who_downloaded]: $attachment[attachmentid]" /></a>
        </if>
</if>

Version History:

v-1.0.0 - July 29th, 2005:
  1. Initial vb350 release which adds ip & date logging to old vb3 hack.
v-1.0.5 - August 9th, 2005:
  1. Prevent logging of non-thumbnail image views (images loaded by showthread).
  2. Use escape_string to clean dB insertion variables during dB writes.
  3. Moved names above users date/IP list.
  4. Added paperclip hover target to show id# of the logged download.
  5. Added phrase 'blunts_whodl_download_id' for use in hover paperclip.
  6. Added vertical button BMP FILE for non-IE users (next to thumbs).
  7. Added vertical button WITH CODE for IE users (next to thumbs).
  8. Tweaked the popup's gui layout to give some nice borders.
  9. Cut the dB reading down to 2 queries.
  10. Began building up the 2 queries & other things for future search features.
  11. Set the php environment & pre-cache templates.
  12. URL input (was attachment=X) is now fid=X (fid is attachmentid or fileid).
v-1.0.7 - August 20th, 2005:
  1. Added the time of download to any dates shown.
  2. Added 'bitfield_blunts_whodl_ip.xml' (upload to 'INCLUDES/XML' folder).
  3. Added 'bluntswhodlpermissions' field to vB's 'usergroup' table.
  4. Added 5 Custom Usergroup Permissions to AdminCP (and phrases for them).
  5. Added 10 Custom vBulletin Options to AdminCP (and phrases for them).
  6. Added comments to the installation process to be echoed back to user.
  7. Added code to seek/transfer data from old whodownloaded hacks to new table.
  8. Repaired the integer fields in our dB table to be INT(10) and UNSIGNED.
  9. Modified the internal product templates again (they install themselves).
  10. Modified STYLE file again (you can keep using v105's if you want to).
  11. Changed all but one global phrase to be in my own 'phrase group'.
  12. Shuffled some things around in the PHP script.
  13. Renamed style and product files to conform with the other underscores.
v-1.1.0 - November 1st, 2005:
  1. Tweaked all of the "product codes" for (hopefully) the final time.
  2. Added a new AdminCP Nav Group (left column) with hotlinks to key features.
  3. Added a search engine for admins who have permission to control plugins.
  4. Added ability for admins to manually edit/delete entries from database.
  5. Importing & Deletion of old 3.0.x data can optionally be done at any time.
  6. Deletion of main database table is now optional during uninstallation.
  7. Found another template that can use a button (modifyattachmentsbit).
v-1.2.0 - December 12th, 2005:
  1. MANDATORY FIX to correct issues which made 1.1.0 incompatible with vb351+ .... I strongly recommend updating this product before upgrading to vb351 or vb352, if you haven't yet.
  2. Moved a lot of the install code from the product file to the admin file.
  3. Condensed the rest of the install/uninstall code.
  4. Changed the format of all files from Windows to UNIX.
  5. Updated all the screenshots (zip file has 11 pics so are not shown).
  6. Removed the Beta Tag from the product.
To Do and/or Wish List:
  1. I'm still looking for someone to help me add better language support.
Known Bug List:
  1. Installation messages are english only since code installs before phrases.
  2. Non-IE5.5 shows horizontal href text next to thumbs IF THE BMP isn't found ... which looks REALLY dumb ... so make sure you upload the BMP to the proper folder on your server!!
Credits:
  1. Mostly Jelsoft for their dedication and "easy to read & modify" code!!
  2. vbulletin.com, vbulletin.org, & php.com for their excellent resources!!
  3. The MEMBERS and MODS who MAKE these forums great resources!!
  4. Special SHOUT to MarcoH64 and Andreas for help when I needed it.
  5. AND OF COURSE TWTCommish for his original v2 whodownloaded hack!!
https://vborg.vbsupport.ru/external/2010/02/12.gif
mr_blunt@sbcglobal.net

Boofo 07-29-2005 10:15 PM

Any way to have the button only show for certain usergroups? Maybe a setting? ;)

Mr Blunt 07-29-2005 10:28 PM

#5 in my to-do list ;)

In the meantime, the plugin is easy to edit.
Might LOOK tough, but it's not.
Edit the Product XML file before installation (or edit the plugin itself after, whichever).

Add something like this in the VIEWING plugin somewhere:
PHP Code:

if ($vbulletin->userinfo['usergroupid'] == OR $vbulletin->userinfo['usergroupid'] == Y)
{
    
$show['blunts_whodl_width'] = 500;
    
$show['blunts_whodl_names'] = true;
    
$show['blunts_whodl_dates'] = true;
    
$show['blunts_whodl_dates_to_just_poster'] = true;
    
$show['blunts_whodl_ips'] = true;
    
$show['blunts_whodl_altips'] = true;


Notice everything I just cut n pasted is the the same except for the IF statement itself.

Only thing you have to be careful about is nesting the IF'S.
With my one big nest, the first condition that succeeds will exit the "nest".

And you don't need to use my "one nest" either.
You can have a seperate conditional at the bottom!!

Example you could add a conditional at the end and if that condition is met it will override any previous condition which might/might not have been met.

If that didn't make sense, say so.
:D

laycomp 07-29-2005 11:46 PM

Wow, great release!

By the look of the screens it looks like you've done a great job on the d/l stats, congratulations man! :D ...I think this calls for "beers on the house!"

Thanks MrBlunt, I look forward to installing this soon :D ...thanks again and I will report back.

Mr Blunt 07-30-2005 12:30 AM

I'm too much of a perfectionist so I'm still not happy with my work yet.
:p
I really don't like having the usernames underneath the dates.
Just doesn't look right at all IMHO.
But that's just cosmetic stuff that hopefully I'll conquer soon.


Here's my dilema with that if anyone can help:


One username with his count next to it, but many dates so I can't eval the username beforehand because I don't know if his individual count is complete until I check next row's username.

I understand how to build seperate evals but I couldn't figure out how to join them correctly after that user is complete. If I could merge two different evals from within php, then I would create 3 eval vars ... one for name, one for dates, and the third merges the two together and unset the first two after it verifies this is the "next user" .... so that we can start processing on the next name from the long list.

belinea 07-30-2005 11:49 AM

Great Job Mr. Blunt

Many thanks for this great hack.

belinea 07-30-2005 04:13 PM

The downloads were correctly logged in vb3_blunts_whodownloaded_ip

But when I click on the "Who downloaded button" I get the following information:

Quote:

Viewed By: 0 Memebers And 0 Guests
No Users Found

Mr Blunt 07-30-2005 05:16 PM

Hmmm, I'm stumped.

The "no user found" means your getting to the point in the code where we query my DB table and no data was returned from the table for the attachmentid number which was input.

This means all your settings and permissions are in good shape or we wouldn't have gotten that far into the code.


1) I hope you aren't expecting to see data from downloads PRIOR TO latest installation of v100 (previous versions or not) because I haven't gotten that far yet (#1 & #2 in my to-do list)

2) You say "they were correctly logged" ... Are you saying you went into phpmyadmin and "browsed" through the table manually and verified that the correct attachmentid number (I call it FILEID) and such was written to AND IS currently sitting in my table for the file you downloaded?

3) I hate to quote things that were erased, but my email notification which had your original post mentioned a database error ... and since the error was quoted, it wasn't included in the email so I don't know what the specific error said. If you could repost that database error for me, maybe it will give me a clue as to why my query isn't returning a result (feel free to remove the IP's from the message as I don't need or want that info).

belinea 07-30-2005 10:15 PM

Now all works fine. I have changed nothing. But it works now. :speechless:

laycomp 07-31-2005 12:59 AM

Mr. Blunt, I am using vb2 which is already using Commish's Hack. Soon I will attempt to upgrade to vb3. What would be the best way to install your hack so that I can still keep OLD attachments under the watchful eye of your WhoDownloaded IP hack? I have a huge db, 2 gigs ...mmm.. any tips or suggestions?

Regards~

Mr Blunt 07-31-2005 04:46 AM

belinea,

Happy to hear it's working!! Please speak up if you have any other troubles. Like the readme says, I've never written a bugless first release so that's why I list the file as a "beta" for now. The only way I'll know it's really ready is to hear it from you folks.

I wonder if your first trouble had to do with any caching or cron stuff?? For example I think vB has an option that will only update attachments and/or attachment views on a time schedule .... as opposed to "immediately". My forum is small so I use no-cache headers and and most of my options are set to immediately update .... so this could maybe explain why I haven't encountered an issue like yours yet.


laycomp,

I think the best way to import old data from My and/or Commish's old hack is to just let the data sit exactly where it is until I make a "product update" to import the data for you automatically.

Yes, this means the data won't be available for a "period of time" while I learn more about creating install/uninstall packages ... but I figure that's a small price to pay for safety. Eventually WE WILL get it imported. I'd rather see you go maybe a month without the data than to see it imported now and get messed up and/or unrecoverable.

If I had to take a guess how long??
I'd say chances are good I'll figure it out before vb350 goes gold.
But that is NOT a promise.
Safety comes first in my book.

belinea 07-31-2005 07:25 AM

Quote:

Originally Posted by Mr Blunt
belinea,

I wonder if your first trouble had to do with any caching or cron stuff?? For example I think vB has an option that will only update attachments and/or attachment views on a time schedule .... as opposed to "immediately". My forum is small so I use no-cache headers and and most of my options are set to immediately update .... so this could maybe explain why I haven't encountered an issue like yours yet.

I am also using no-cache and immediately update counters. But am using eAccelerator. Of course this PHP caching tool was the problem.

Brinnie 07-31-2005 09:04 AM

just a question, but what if you have it set to display thumbnails?

belinea 07-31-2005 05:49 PM

Quote:

Originally Posted by Brinnie
just a question, but what if you have it set to display thumbnails?

You can put the Who-downloaded-Button wherever you want. Look in the Readme (Can the popup button be put in more places?)

Mr Blunt 07-31-2005 06:49 PM

Well, I finally tried and it's tricky for the images.
The 4 different postbit_attachment.... templates all handle the tr/td's differently.

I didn't edit the 'postbit_attachmentthumbnail' template for you guys yet because I don't like the button being displayed 'next to' the image .... looks really stupid that way.

And just adding a carriage return won't cut it, because some folks use inline images.
Let me see if I can create a "vertical" button for next to images.
;)

Mr Blunt 08-01-2005 05:55 PM

There's something fishy going on with images, and I think it smells like a vbulletin issue. I can't reproduce a specific circumstance yet, but sometimes image views update and sometimes they don't. This goes for vbulletin's tables and/or my table. For example when you hover over a thumbnail, vbulletin shows image views (that's not me or my code which prints that), and I don't believe the displayed numbers are true.


But neither here nor there....
Here's all the templates edits I've come up with so far.

I found 4 POSTBIT templates that handle the attachments.
These edits work, but I'm still not happy so I'm not updating top post yet.

*** removed my proposed edits because I like what's in v105 ***

This blunts_whodl_vertical.bmp file (inside this zip file) is REQUIRED for the 'postbit_attachmentthumbnail' template edit!!!

*** removed the first button image I posted because it was ugly ***
*** please use the one that's included with the v105 zip ***

The BMP must be put in your IMAGES/ATTACH folder for this to work!!!
To use your own button (or change path), edit the SRC="" with your button file's name.

C.Birch 08-04-2005 08:27 PM

Database error in vBulletin 3.5.0 Release Candidate 1:

Invalid SQL:

INSERT INTO blunts_whodownloaded_ip
(
userid,
username,
filename,
fileid,
ipaddress,
alt_ip,
dateline
)
VALUES
(
'212',
'Scott_lee's_Rock',
'chatroom.jpg',
'2617',
'80.41.214.230',
'80.41.214.230',
'1123136477'
);

MySQL Error : You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 's_Rock',
'chatroom.jpg',
'2617',
'80.41.214.230',
'
Error Number : 1064
Date : Thursday, August 4th 2005 @ 06:21:17 AM
Script : http://forums.lisascottlee.com//atta...1&d=1123102373
Referrer :
IP Address : 80.41.214.230
Username : Scott_lee's_Rock
Classname : vb_database

Mr Blunt 08-04-2005 10:32 PM

vbulletin allows you to have a ' (single quote) in a username??
Your kidding me!!

Boofo 08-04-2005 11:24 PM

Quote:

Originally Posted by Mr Blunt
There's something fishy going on with images, and I think it smells like a vbulletin issue. I can't reproduce a specific circumstance yet, but sometimes image views update and sometimes they don't. This goes for vbulletin's tables and/or my table. For example when you hover over a thumbnail, vbulletin shows image views (that's not me or my code which prints that), and I don't believe the displayed numbers are true.


But neither here nor there....
Here's all the templates edits I've come up with so far.

I found 4 POSTBIT templates that handle the attachments.
These edits work, but I'm still not happy so I'm not updating top post yet.

postbit_attachment: add this just before the final </tr>
HTML Code:

<td><if condition="$show['blunts_whodl_width'] AND $show['popups']">
<input type="button" class="button" value="$vbphrase[blunts_whodl_who_downloaded]" onclick="window.open('blunts_whodownloaded_ip.php?$session[sessionurl]attachmentid=$attachment[attachmentid]','blunts_whodownloaded_ip','toolbar=no,scrollbars=yes,resizable=yes, width=$show[blunts_whodl_width],height=450,top=50,left=50'); return false;" />&nbsp;
</if></td>

postbit_attachmentmoderated: add this just before the final </tr>
HTML Code:

<td><if condition="$show['modattachmentlink'] AND $show['blunts_whodl_width'] AND $show['popups']">
<input type="button" class="button" value="$vbphrase[blunts_whodl_who_downloaded]" onclick="window.open('blunts_whodownloaded_ip.php?$session[sessionurl]attachmentid=$attachment[attachmentid]','blunts_whodownloaded_ip','toolbar=no,scrollbars=yes,resizable=yes, width=$show[blunts_whodl_width],height=450,top=50,left=50'); return false;" />&nbsp;
</if></td>

postbit_attachmentimage: add this to the end
HTML Code:

<if condition="$show['blunts_whodl_width'] AND $show['popups']">
<img class="button" src="$stylevar[imgdir_button]/blunts_whodl_vertical.bmp" alt="blunts_whodownloaded_ip.php?$session[sessionurl]attachmentid=$attachment[attachmentid]" onclick="window.open('blunts_whodownloaded_ip.php?$session[sessionurl]attachmentid=$attachment[attachmentid]','blunts_whodownloaded_ip','toolbar=no,scrollbars=yes,resizable=yes, width=$show[blunts_whodl_width],height=450,top=50,left=50'); return false;" />&nbsp;
</if>

postbit_attachmentthumbnail: FIND THIS
HTML Code:

<if condition="$show['br']"><br /><br /></if>
Just before that, add this:
HTML Code:

<if condition="$show['blunts_whodl_width'] AND $show['popups']">
<img class="button" src="$stylevar[imgdir_button]/blunts_whodl_vertical.bmp" alt="blunts_whodownloaded_ip.php?$session[sessionurl]attachmentid=$attachment[attachmentid]" onclick="window.open('blunts_whodownloaded_ip.php?$session[sessionurl]attachmentid=$attachment[attachmentid]','blunts_whodownloaded_ip','toolbar=no,scrollbars=yes,resizable=yes, width=$show[blunts_whodl_width],height=450,top=50,left=50'); return false;" />&nbsp;
</if>


This blunts_whodl_vertical.bmp file (inside this zip file) is REQUIRED for the 2 'postbit_attachmentimage' & 'postbit_attachmentthumbnail' template edits!!!

The BMP must be put in your IMAGES/BUTTONS folder for this to work!!!
To use your own button (or change path), edit the SRC="" with your button file's name.

Any pics?

Mr Blunt 08-04-2005 11:41 PM

Don't goto far!!
And don't bother with those extra template edits or that image as I'm changing that stuff a little.
I think I'm done testing this portion so I'll slap it together and post new version hoepfully tonight.

I'm going to stop tracking NON thumbnail images because it's useless. They load with the showthread page so the count is more like a "who viewed the thread" count which isn't the purpose of this.

However we can track thumbnails, so we shall.
AND I found a way to make a html vertical button (for IE only)!!
Gimme the rest of the night and I'll post v103.

I'd like to find out wassup with this single quotes in a name thing first.
That's pretty major if you ask me!!
If anyone's got a suggestion for that, feel free to speak up!!

laycomp 08-04-2005 11:46 PM

Quote:

Originally Posted by Mr Blunt
belinea,

laycomp,

I think the best way to import old data from My and/or Commish's old hack is to just let the data sit exactly where it is until I make a "product update" to import the data for you automatically.

Yes, this means the data won't be available for a "period of time" while I learn more about creating install/uninstall packages ... but I figure that's a small price to pay for safety. Eventually WE WILL get it imported. I'd rather see you go maybe a month without the data than to see it imported now and get messed up and/or unrecoverable.

If I had to take a guess how long??
I'd say chances are good I'll figure it out before vb350 goes gold.
But that is NOT a promise.
Safety comes first in my book.

Mr Blunt, to be sure I understand this, are you suggesting that If I do a forum upgrade (vb2 to vb3) with existing Commish's hack, that I should NOT install your hack until you've made the "product update" data import hack? and so in the meantime, files will just reside without me being able to track downloads?

Mr Blunt 08-05-2005 12:34 AM

Quote:

Originally Posted by laycomp
Mr Blunt, to be sure I understand this, are you suggesting that If I do a forum upgrade (vb2 to vb3) with existing Commish's hack, that I should NOT install your hack until you've made the data import? and so in the meantime, files will just reside without me being able to track downloads?

Most hacks aren't transferrable between "major" vb revisions.
vb2 hacks won't work with vb3.
vb3 hacks won't work with vb350.
Whodownloaded_IP is strictly a vb350 hack.

So if you have Commish's old vb2 hack installed, you'd have to get rid of any edits before the upgrade to EITHER vb3 or vb350 ... meaning clean vb files and reverting your old templates.

If you move into vb3.0.8 then you'll have to settle for my super old vb3 hack.

If you move into vb3.5.0 then you have the option of using either of my vb350 whodownloaded hacks (with IP or without), but note that if you choose the OTHER non IP version, then you still aren't saving dates which is "somewhat dumb" if you plan to use this IP version in the future.


Now note:
Files and templates are not "database data".

The "data" that was saved with each download won't get touched while you do the vb upgrade and will remain stored in the database. The only thing that changes when you upgrade vB is it will stop logging downloads from that day forward (until you install a hack for that version) and there won't be a way to view the saved data since your templates and files won't have the "hack" to process the data.


So summary....
New IP hack can be installed on vb350 at any time no matter if you've got old data sitting around or not ... because new IP hack is independent.

We just won't add to the old column anymore.
The old data won't be "viewable today"!!!
Soon it will be viewable ... as if it was never missing.

Let it sit where it is in the database and "I'll import it" when I make the proper install script. Once it's imported, then it will magically be "viewable again". The imported data will be easy to spot because there will be a date from 1969 (since old hack didn't track dateline).

Feel free to install this the same day you upgrade to vb350!!


LAST NOTE:
This is still beta so I do NOT suggest installing it on a live forum just yet.
I'm not saying "you can't", because you can.

If you do, just make darn sure you "CLICK INSTALL" on this thread so you will get a notice when I make a major change to this .... and do not overlook changes I make ... until such time as I remove the "beta checkmark" at the top of the thread.

I have a long agenda (you saw the todo list).
I've already dropped a month of my life into this.
And I expect at least one more month before I finish that list!!
There's still no major flaws that I know of, so that's a plus, LOL.

C.Birch 08-05-2005 08:40 PM

Quote:

Originally Posted by Mr Blunt
vbulletin allows you to have a ' (single quote) in a username??
Your kidding me!!

nope im not.

Mr Blunt 08-05-2005 08:53 PM

I'm on it...
How stupid of me to think you couldn't use a quote in name.
What would the irish do, LOL.

I think $myvar = addslashes($vbulletin->userinfo['username']) should fix it.
I tested it on my forum yesterday and it seems to work fine.

Can anyone with experience verify that this is all I need to do??
And then I just stripslashes() after reading from DB?


What I don't understand is why I don't physically see the slashes in my database fields.
I just see the exact text name in the db.
Is this normal?

Marco van Herwaarden 08-06-2005 05:35 AM

Addslashes is depreciated in 3.5, please use $vbulletin->db->escape_string instead.

And you will only see something different in the database if you use a special character like a quote.

Mr Blunt 08-06-2005 06:50 AM

Quote:

Originally Posted by MarcoH64
Addslashes is depreciated in 3.5, please use $vbulletin->db->escape_string instead.

And you will only see something different in the database if you use a special character like a quote.

Thanks MarcohH64!!
I really appreciate you following me around and helping me out.

I looked at that function and see it used "during" the db connection.
Does this imply that there's no "special handling" needed for after a db read?

Also while searching vb's code, I notice escape_string() is used for IPADDRESS in places, so I suppose I should do this for 4 of my 6 insertion variables (username, filename, ipaddress, & alt_ip)??

I'm so close with this thing ....
For the past few days I've been learning how to JOIN LEFT, ROFLMAO.
So that is knocking off a couple queries for me now.
I'm getting there....

Marco van Herwaarden 08-06-2005 06:55 AM

Basicly you should sanitize all 'untrusted' (ie provided by outside sources like user input) variables used in queries.

Mr Blunt 08-09-2005 12:46 PM

<font size="4">I just posted a new version (v105)!!
This is a crtical update!!
To anyone who had issues - I'M SORRY!!</font>

I also rewrote many parts of the top post so might I suggest re-reading it please. The v105 zip file's readme is the same as the post (as of this writing) so pick one to read. Sometimes I think I spend more time writing the readme's than I do the researching and writing code, LOL, but it's for YOUR own good .... not mine!!

Please see the version history for full list of changes.
The really critical update is for the ENABLE LOGGING plugin.

Boofo,
New screen shots are posted!!

C.Birch and MarcoH64,
Thanks guys for pointing out why and how to better clean things like usernames before trying to write them into the database!! If someone can double check me, I think I have all the bases covered now ... as far as db writes go anyways. I now clean all the non numeric numbers (hope that's sufficient, if not, could someone please say so??).

C.Birch,
Sorry it took me a few days before posting a fix, but I didn't want to post a patch when major release with many changes was so close to being ready.

Laycomp,
Now that I'm feeling good about this version ... Here's my short answer!! No better time than the present to install this. The longer you wait, the less data you'll have to retrieve about those downloads later on. I PROMISE that soon I will figure out how to automate the process with a product update and your old saved data will reappear like it was never gone. Think of the old saved data as simply "not available today, but will be soon".

belinea 08-09-2005 02:30 PM

Thank you very much for the new Release.

Great Great Great Mr.Blunt !!!!

Boofo 08-09-2005 03:14 PM

Quote:

Originally Posted by Boofo
Any way to have the button only show for certain usergroups? Maybe a setting? ;)

Has this been added yet? ;)

Mr Blunt 08-09-2005 07:40 PM

Boofo,

Still #4 in my to-do list.
For the last month, I've been spending about 10 hours every day on this script.
I'm sorry I'm not fast enough to finish that list in a few hours or days.
I'm doing the best I can, believe me.

Boofo 08-09-2005 08:30 PM

Quote:

Originally Posted by Mr Blunt
Boofo,

Still #4 in my to-do list.
For the last month, I've been spending about 10 hours every day on this script.
I'm sorry I'm not fast enough to finish that list in a few hours or days.
I'm doing the best I can, believe me.

Oh, no, don't take that wrong. I'm sorry if it came off as anything else but a query. ;)

I just wanted to check is all. You have done a great job so far and I was just seeing what else needed to be done. Take you time, don't kill yourself over it. It's just a hack. ;)

belinea 08-10-2005 12:39 AM

@Mr.Blunt: Can you also output the Hour, Minutes and Seconds of the download time in the popup windows? Currently there is only the date (day,month and year).

Mr Blunt 08-10-2005 01:49 AM

No sweat Boofo!!
I like to kill myself over it. Learning is fun to me. I'm just disappointed in myself that it takes me so long. I have to REALLY design one complete hack from scratch before I really begin to understand how sql, php, and vbulletin all mix together ... and this is that first "big one" for me.

belinea,
Yes, that's easy (but finding space for it isn't right now, LOL). The saved 'dateline' is already measured in seconds. Honestly I figured that displaying it that way would be overkill, but now that you mention it, maybe it would have it's advantages .... especially when I add in the ability to search by userid .... so I'll work that in there.

laycomp 08-10-2005 12:45 PM

That's telling them Mr Blunt, heck, they don't understand, it's not just a hack, it IS the hack! :D

Seeing you're only putting 10 hours a day and a day has 24 hours, I hope you might put some extra time -maybe 4-6 hours?- in creating some type of import so one can bring old data from previous Comish WhoDownloadedThis hack ;) ...this still leaves you with 8-10 free hours a day for eating and sleeping -more then ample time if you ask me. :D

Mr Blunt 08-11-2005 07:28 PM

I'm not ready to release, but I now have 3 vBulletin Options, 5 Usergroup Permissions, and I have successfully created an install to transfer old hack data to new dB table!!

Give me some time to test and tweak.

Mu5icMan 08-15-2005 02:44 PM

Is there a way to show all attachments downloaded by a forumid's and list who's downloaded what?

laycomp 08-18-2005 05:56 AM

Quote:

Originally Posted by Mr Blunt
I'm not ready to release, but I now have 3 vBulletin Options, 5 Usergroup Permissions, and I have successfully created an install to transfer old hack data to new dB table!!

Give me some time to test and tweak.

Wow Mr Blunt, you are the man! If you need some help testing, let me know :D

Thanks again for the work you're putting into this.

Mr Blunt 08-20-2005 10:12 AM

Made some real huge breakthroughs in my knowledge base.

:banana:

v-1.0.7 - August 20th, 2005:
  1. Added the time of download to any dates shown.
  2. Added 'bitfield_blunts_whodl_ip.xml' (upload to 'INCLUDES/XML' folder).
  3. Added 'bluntswhodlpermissions' field to vB's 'usergroup' table.
  4. Added 5 Custom Usergroup Permissions to AdminCP (and phrases for them).
  5. Added 10 Custom vBulletin Options to AdminCP (and phrases for them).
  6. Added comments to the installation process to be echoed back to user.
  7. Added code to seek/transfer data from old whodownloaded hacks to new table.
  8. Repaired the integer fields in our dB table to be INT(10) and UNSIGNED.
  9. Modified the internal product templates again (they install themselves).
  10. Modified STYLE file again (you can keep using v105's if you want to).
  11. Changed all but one global phrase to be in my own 'phrase group'.
  12. Shuffled some things around in the PHP script.
  13. Renamed style and product files to conform with the other underscores.

I rewrote the top post yet again to reflect MANY changes.

Please .... I need some feedback on this one!!!
Good and/or Bad!!


I think I took care of all requests except for Mu5icMan's (the big one I've been working towards for a long time) which is still "down the road". I won't speculate on a timeline because it's all a matter of how fast I learn some more things. I COULD do it today, but I'd RATHER study for a while longer so I don't have to rewrite it when I learn the "better way".


Right now I want to make sure I'm on the right track.
This is why input is crucial right now.
I really need a coder to inspect this sucker.
Anyone willing??
:D

belinea 08-20-2005 02:21 PM

GREAT RELEASE !!!!!!

But I´m missing a feature. I want to hide the "Who Downlaoded" buttons for normal users. Only admins schould see the button.


All times are GMT. The time now is 07:40 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.01799 seconds
  • Memory Usage 1,965KB
  • 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
  • (6)bbcode_code_printable
  • (5)bbcode_html_printable
  • (1)bbcode_php_printable
  • (11)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