Lemur zaprasza
Addon: Attachments - Who Downloaded? 1.0b Author: Synergy Description: Allows admins to see who downloaded Attachments through Admin C-Panel Requirements: lBurning Board 1.1.1 (untested on previous versions)l lAttachment Hack by Satelk (tested on version 2.5) - you can get it from l Bug Fix 1.0b: Fixes problem with some database calls that may cause the page not to view correctly. Install Instructions 1. Database Changes You can make the changes yourself through phpMyAdmin, or upload whodownloaded_db_install.php
If you want to do it yourself, create a new table: bb(n)_attachdldrs (where
Field Type Length Null? attachmentid INT 11 Not Null downloaderid INT 11 Not Null 2. File Edit: misc2.php Look for: $db_zugriff->query("UPDATE bb".$n."_attachments SET downloads=downloads+1 WHERE attachmentid=$attachmentid"); Add below: $db_zugriff->query("INSERT INTO bb".$n."_attachdldrs (attachmentid,downloaderid) VALUES ('$attachmentid','$user_id')");
Look for: <p style="margin-top: 0; margin-bottom: 0"> <font size=1 face="Tahoma"><a href="admin.php?action=pms_options$session" target="main"> <font color="#FFFFFF">» Options for Private Messages</font></a></font></p> Add below: <p style="margin-top: 0; margin-bottom: 0"> <font size=1 face="Tahoma"><a href="admin.php?action=view_attachments$session" target="main"> <font color="#FFFFFF">» View Attachment Downloaders</font></a></font></p>
Look for: ?>
if($action == "view_attachments") { if($send == "send" && $attachmentid) header("Location: admin.php?action=view_downloaders&attachmentid=$attachmentid$session"); $attachmentresult = $db_zugriff->query("SELECT * FROM bb".$n."_attachments ORDER BY attachmentid ASC"); while($row = $db_zugriff->fetch_array($attachmentresult)) { $filename = $row[filename]; $userinfo = $db_zugriff->query_first("SELECT username FROM bb".$n."_user_table WHERE userid = '$row[userid]'"); $attacher = $userinfo[username]; $threadinfo = $db_zugriff->query_first("SELECT threadparentid FROM bb".$n."_posts WHERE uploadid = '$row[attachmentid]'"); $threadinfotwo = $db_zugriff->query_first("SELECT threadname FROM bb".$n."_threads WHERE threadid = '$threadinfo[threadparentid]'"); $threadname = $threadinfotwo[threadname]; eval ("\$attachdl_view .= \"".gettemplate("attachdl_view_bit")."\";"); } eval("dooutput(\"".gettemplate("attachdl_view")."\");"); } if($action == "view_downloaders") { $attachmentinfo = $db_zugriff->query("SELECT * FROM bb".$n."_attachdldrs WHERE attachmentid = '$attachmentid'"); while($row = $db_zugriff->fetch_array($attachmentinfo)) { $usernameinfo = $db_zugriff->query_first("SELECT username FROM bb".$n."_user_table WHERE userid = '$row[downloaderid]'"); $username = $usernameinfo[username]; if($username) $downloaderslist .= "<a href=\"../members.php?mode=profile&userid=$row[downloaderid]\" target=\"_blank\">".$username."</a> "; if(!$username) $downloaderslist .= "(Guest) "; } $attachinfo = $db_zugriff->query_first("SELECT filename FROM bb".$n."_attachments WHERE attachmentid = '$attachmentid'"); $filename = $attachinfo[filename]; $threadinfo = $db_zugriff->query_first("SELECT threadparentid FROM bb".$n."_posts WHERE uploadid = '$attachmentid'"); $threadinfotwo = $db_zugriff->query_first("SELECT threadname FROM bb".$n."_threads WHERE threadid = '$threadinfo[threadparentid]'"); $threadname = $threadinfotwo[threadname]; eval ("\$attach_viewdownloaders .= \"".gettemplate("attachdl_viewdlsbit")."\";"); eval("dooutput(\"".gettemplate("attachdl_viewdownloaders")."\");"); }
You can edit this file if you want to add logging functions, if you have
Look for: if($extension == "gif" || $extension == "jpg" || $extension == "jpeg" || $extension == "bmp" || $extension == "png") eval ("\$attachmentbit = \"".gettemplate("thread_attachimagebit")."\";");
if($extension == "gif" || $extension == "jpg" || $extension == "jpeg" || $extension == "bmp" || $extension == "png") { $db_zugriff->query("INSERT INTO bb".$n."_attachdldrs (attachmentid,downloaderid) VALUES ('$attachmentinfo[attachmentid]','$user_id')"); eval ("\$attachmentbit = \"".gettemplate("thread_attachimagebit")."\";"); } 5. File Uploads Upload all edited files, plus the following from the zip file: File Destination attachdl_view.htm admin/templates/ attachdl_view_bit.htm admin/templates/ attachdl_viewdlsbit.htm admin/templates/ attachdl_viewdownloaders.htm admin/templates/ Done! Usage First, please note this will only work from the moment you install it, i.e
Head to your Admin C-Panel and click "View Attachment Downloaders".
Problems, Comments, Suggestions Reply in the relevant thread in Finished Mods at wbbmods.com or email me at
|