2010-07-25, 02:38 AM
So I have this plugin here:
http://www.thingiej.be/RecentThreadsInProfile.rar
This basically displays the users latest threads on their profiles, created by LeX- and that works perfectly fine.
I'm trying to edit the code to allow the first thumbnail from each thread show up on the profiles. LeX- made a code edit for forum display that does exactly this, but I'm trying to get it to work on profiles now. He appears to query similar things, but I'm not good with php or mysql for that matter, I'm very new, and any help or advice would be very much appreciated.
I did ask LeX- if he could do it and if it was possible. He said he's currently to busy to do it but that it indeed is possible to achieve.
The thumbnail code, as it is now, places into Forumdisplay.php after:
This places below that code.
http://www.thingiej.be/RecentThreadsInProfile.rar
This basically displays the users latest threads on their profiles, created by LeX- and that works perfectly fine.
I'm trying to edit the code to allow the first thumbnail from each thread show up on the profiles. LeX- made a code edit for forum display that does exactly this, but I'm trying to get it to work on profiles now. He appears to query similar things, but I'm not good with php or mysql for that matter, I'm very new, and any help or advice would be very much appreciated.
I did ask LeX- if he could do it and if it was possible. He said he's currently to busy to do it but that it indeed is possible to achieve.
The thumbnail code, as it is now, places into Forumdisplay.php after:
else
{
$attachment_count = '';
}
This places below that code.
// GET FIRST ATTACHMENT
$attachment_thumbnail = '';
if($attachment_count)
{
$query = $db->query("
SELECT a.thumbnail
FROM ".TABLE_PREFIX."attachments a
LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid=a.pid)
WHERE p.tid='{$thread['tid']}' AND a.filetype LIKE '%image%'
ORDER BY a.dateuploaded ASC
LIMIT 0,1
");
$thumbnail = $db->fetch_field($query, 'thumbnail');
if($thumbnail)
{
$attachment_thumbnail = "<div style=\"float:left\"><img src=\"./uploads/{$thumbnail}\" /></div>";
}
}