I'm looking for a way to fetch a users avatar to display inside a modification, a ticket support system. I've done a search and been through about 60+ pages of avatar modifications and can't find the actual code for it. I'm not exactly sure where I would need to insert the code into the PHP file, plus using the avatar conditional (<if condition="$show['avatar']">) doesn't seem to work on the modification.
Basically, this is how I've got it setup. This is the "ticket_display" template:
PHP Code:
<if condition="$issue[status]==0">
<img src="$stylevar[imgdir_button]/threadclosed.gif" border="0" alt"" />
</if>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td valign="top">
<table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%" style="border-bottom-width:0px">
<tr align="left">
<th class="tcat" width="100%">
$issue[title]
</th>
<if condition="$show['member']">
<th class="vbmenu_control" id="issuetools" nowrap="nowrap">
<a href="$vbptions[bburl]/issue.php?$session[sessionurl]do=issuetools">Issue Tools</a>
<script type="text/javascript">vbmenu_register("issuetools");</script>
</th>
</if>
</tr>
</table>
<table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%">
<tr>
<td class="thead normal">
<if condition="$show['can_delete_issues'] OR $show['can_delete_any_issues']">
<div style="float:right">
[<a href="$vboptions[bburl]/issue.php?$session[sessionurl]do=delete&id=$_REQUEST[id]">Delete</a>]
</div>
</if>
<img src="$stylevar[imgdir_statusicon]/post_new.gif" alt="#$_REQUEST[id]" class="inlineimg" />
$ticket[datelogged]
</td>
</tr>
<tr valign="top">
<td class="alt2">
<table cellpadding="0" cellspacing="6" border="0" width="100%">
<tr>
<td class="alt2">
<if condition="$show['avatar']">
<a href="$vboptions[bburl]/member.php?$session[sessionurl]u=$issue[ownerid]"><img src="$vboptions[bburl]/image.php?u=$issue[ownerid]" alt="" border="0" />
</if>
</td>
<td nowrap="nowrap" width="100%">
<div id="notemenu_68661">
<a class="bigusername" href="$vboptions[bburl]/member.php?$session[sessionurl]u=$issue[ownerid]">$issue[ownerusername]</a>
</div>
<div class="smallfont">Posted <span class="time">$issue[datelogged]</span></div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="alt1" valign="top">
<div style="font-size:12pt">$issue[title]</div>
<div><strong></strong></div>
<hr style="border:0px; height:1px; color:#D1D1E1; background-color:#D1D1E1" />
<div>$issue[message]</div>
<div class="smallfont" align="right" style="margin-top:12px">
<div style="float:left" align="left">
</div>
<if condition="$show['can_edit_issues'] OR $show['can_edit_any_issues']">
<a href="$vboptions[bburl]/issue.php?$session[sessionurl]do=edit&id=$_REQUEST[id]"><img src="$stylevar[imgdir_button]/edit.gif" alt="Edit" border="0" /></a>
</if>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br />
<a name="comments"></a>
<div style="font-size:12pt">Comments</div>
<div style="height:3px"> </div>
For some reason using the 'avatar' conditional is hindering the ability to display the user's avatar. It simply doesn't show. I've never written the PHP code to fetch an avatar. I've tried this code only it results in a database error:
PHP Code:
require_once('./includes/init.php');
require_once('./includes/functions_user.php');
$issue['owner_avatar']=fetch_avatar_url($issue['ownerid']);
if ($issue['owner_avatar']=='') ($bbuserinfo['owner_avatar']='images/misc/noavatar.gif');
$issue['owner_avatar']="<img src='$vboptions[bburl]/{$issue['owner_avatar']}' border='0'>";
$issue['owner_avatar']="<a href='$vboptions[bburl]/profile.php?{$session['sessionurl']}&do=editavatar'>{$issue['owner_avatar']}</a>";
$issue_avatar=$issue['owner_avatar'];
How do I fetch the avatar? Sorry to ask guys, but this is driving me insane. I can't use $bbuserinfo because that will only display the avatar of the user browsing the actual modification.