Something I made to help connect downloaders to other downloaders with a link to request file help / feedback. As time goes on, the table will populate with hits and users photos will start to appear on details page.
Open download.php and find
Add after
Open torrents-details.php and find
Add after
Add to your theme's CSS
run query
What it looks like on my end
[ATTACH type="full" alt="AlsoDownloaded.png"]5589[/ATTACH]
Open download.php and find
SQL_Query_exec("UPDATE torrents SET hits = hits + 1 WHERE id = $id");Add after
SQL_Query_exec("INSERT INTO users_downloaded (userid, torrentid, lastdownload) VALUES ($CURUSER[id], $id, NOW())");Open torrents-details.php and find
print("<center><br />" . format_comment($row['descr']) . "<br /><br />\n");
// end description
?>
Add after
<h1 itemprop="name" class="entry-title" style="font-size:30px;font-weight:400">
Also downloaded
</h1>
<?
$downloaders = SQL_Query_exec("SELECT users_downloaded.userid, users_downloaded.torrentid, users.avatar, users.id, users.class, users.username FROM users_downloaded LEFT JOIN users ON users.id = users_downloaded.userid WHERE users_downloaded.torrentid = $id LIMIT 12");
if (mysql_num_rows($downloaders) > 0) {
?>
<!-- BEGIN Users Also Downloaded -->
<div class="alsoDownloaded">
<ul class="grid columns-3" style="list-style: none">
<?
while ($dlrow = mysql_fetch_assoc($downloaders)):
?>
<li>
<a href="/user/?id=<? echo $dlrow["userid"]; ?>">
<img src="/<? echo $dlrow["avatar"]; ?>" /></a>
<?
if ($CURUSER) {
?>
<p><a href="/message/?compose&id=<?
echo $dlrow["userid"]; ?>">Ask for Help</a></p>
<?
}
?>
</li>
<?
endwhile;
?>
<li style="padding-bottom:10px; list-style: none">
<span>+ 11 more</span>
</li>
</ul>
</div>
<?
} else {
echo '<span style="float:right;padding:30px">' . format_comment('No downloaders populated yet.. :( ') . '</span>';
}
?>
Add to your theme's CSS
.alsoDownloaded {
margin: 0 auto;
margin-top: 3%;
margin-bottom: 4%
}
ul.grid {
list-style: none;
font-size: 0px;
margin-left: -6.5% /* should match li left margin */
}
ul.grid li {
float: right;
display: inline-block;
_padding: 10px;
_margin: 0 0 2.5% 2.5%;
_background: #fff;
_border: 1px solid #dfdfdf;
font-size: 16px;
font-size: 1rem;
vertical-align: top;
_box-shadow: 0 0 5px #dfdfdf;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box
}
ul.grid li img {
height:55px;
width:55px;
border-radius:100%;
margin-left:10px
}
ul.grid li h3 {
margin: 0 0 5px
}
ul.grid li p {
font-size: .9em;
line-height: 1.5em;
color: #999;
text-align: center
}
ul.grid.columns-3 li {
_width: 30.83%; /* this value + 2.5 should = 33% */
}
run query
CREATE TABLE `users_downloaded` (
`userid` int(10) unsigned NOT NULL DEFAULT 0,
`torrentid` int(10) unsigned NOT NULL DEFAULT 0,
`lastdownload` datetime NOT NULL,
UNIQUE KEY `userfriend` (`userid`,`torrentid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
What it looks like on my end
[ATTACH type="full" alt="AlsoDownloaded.png"]5589[/ATTACH]

