MyBB Hacks

Full Version: Preview Image in Profile
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all!

I set up some threads with a preview field (upload image) and some tag fields and want those fields to automatically be shown in the profile if someone opened a new thread (a gallery f.ex.).
I use PHP in templates and this code:

PHP Code:
$gesuchquery = "";
$gesuchquery = $db->query("SELECT * FROM ".TABLE_PREFIX."threads t LEFT JOIN ".TABLE_PREFIX."forums f ON (t.fid=f.fid) LEFT JOIN ".TABLE_PREFIX."threadfields_data td ON (td.tid=t.tid) LEFT JOIN ".TABLE_PREFIX."threadprefixes tp ON ( WHERE t.uid = '$memprofile[uid]' AND f.fid IN ('5') AND t.visible = '1' ORDER BY t.subject DESC");
while($data = $db->fetch_array($gesuchquery))
 echo "
  <div class=\"profile2_tutorials-content-block\">
      <div class=\"profile2_tutorials-block-preview\"><img src='".htmlspecialchars_uni($data['preview_image']['url'])."'></div>
      <div class=\"profile2_tutorials-block-content\">
        <div class=\"profile2_tutorials-title\"><a href=\"showthread.php?tid={$data['tid']}\">{$data['subject']}</a></div>
        <div class=\"profile2_tutorials-keywords\">
          <div class=\"profile2_tutorials-keyword\">".htmlspecialchars_uni($data['graphicTutorials_category'])."</div>


The tag fields show up properly, but the preview image does not. Instead, I get a number (0, 2, 4, 22 ...). The key is "preview_image". Can anyone tell me where I go wrong? Eyes

Maybe this post will help you how to get the thumbnail URL:

Sorry for late reply.
Reference URL's