install_instructions

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
to your main board directory (eg, www.domain.com/wbboard/) where all your
other PHP files are and run it. This will install the correct database entries.


If you want to do it yourself, create a new table: bb(n)_attachdldrs (where
(n) is your board number) and add the following fields:




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')");



3. File Edit: admin/templates/menue.htm


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>



3. File Edit: admin/admin.php


Look for:


?>



Add above:



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>&nbsp;&nbsp;";
if(!$username) $downloaderslist .= "(Guest)&nbsp;&nbsp;";
}
$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")."\");");
}



4. File Edit: thread.php - Optional


You can edit this file if you want to add logging functions, if you have
it set up so that an attached image is downloaded instantly without a link being
pressed when the thread is viewed.


Look for:


if($extension == "gif" || $extension == "jpg" || $extension == "jpeg" || $extension == "bmp" || $extension == "png")
eval ("\$attachmentbit = \"".gettemplate("thread_attachimagebit")."\";");



Replace with:


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
for past downloadings this will not work (but for attachments uploaded in the
past, it will work after installing the mod). This is because this mod adds
the 'tracking' ability as it does not exist with the current attachment hack,
so please don't ask why you can't see who's downloaded in the past. However,
when people start downloading new or existing attachments after you've installed
the mod, it will work.


Head to your Admin C-Panel and click "View Attachment Downloaders".
Select an attachment from the list, then click View Attachment Downloaders.
The following page will tell you who has downloaded that attachment (including
Guests). If you see their name more than once, then that attachment has been
downloaded more than once by that person.


Problems, Comments, Suggestions

Reply in the relevant thread in Finished Mods at wbbmods.com or email me at

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • teen-mushing.xlx.pl
  • WÄ…tki
    Powered by wordpress | Theme: simpletex | © Lemur zaprasza