Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Preview Image in Profile
White_Rabbit Offline
Junior Member
**
Posts: 1
Joined: May 2021
Post: #1
Preview Image in Profile
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:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php
$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 (tp.pid=t.prefix) 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>
        </div>

      </div>
				
          </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

05-22-2021 06:48 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
Preview Image in Profile - White_Rabbit - 05-22-2021 06:48 AM
RE: Preview Image in Profile - RateU - 06-12-2021, 06:34 AM

 Standard Tools
Forum Jump: