I worked on the problem to build a link to the posting/thread including the attachment.
I still have to figure out where in the database the "Postcount"-number is stored.. until then i have built a workaround.
In index.php you have to replace the code from the original-hack with this:
PHP Code:
//Start recent attachments by Trix
$trix = $DB_site->query("SELECT attachmentid, a.dateline, filename, a.postid, threadid FROM " . TABLE_PREFIX . "attachment a JOIN ".TABLE_PREFIX."post b ON a.postid=b.postid WHERE a.dateline < " . TIME() ." ORDER BY a.dateline DESC LIMIT 3");
And in the recent_attachments template:
PHP Code:
<tr>
<td class="alt2">
<div align="center"><a href="attachment.php?attachmentid=$recentattachment[attachmentid]">
<img src='attachment.php?attachmentid=$recentattachment[attachmentid]&thumb=1' alt='$recentattachment[filename]' width="70">
</a></div>
<br> Attachment number $recentattachment[attachmentid]<br/>
<a href="showthread.php?t=$recentattachment[threadid]">In this thread</a><br/>
<a href="showpost.php?p=$recentattachment[postid]">In this posting</a><br/>
</td>
</tr>
(i have included the block into a sidebar on the forumhome)
Take a look at
http://www.infam.net/forum/index.php
Hopefully someone could help me to figure out how to get the postcount...