gordy
Well-known member
I've cobbled together bits and pieces from other code from this forum but I'm just getting blank avatars returned, so I'm apparently missing something.
What I have so far, the bits in green are added to my known working good code:
Here are the template bits:
Any help in the right direction would be great!
thank you
What I have so far, the bits in green are added to my known working good code:
Code:
<?php
class PFvbench_vlist extends XenForo_Model
{
public static function showVlist(XenForo_ControllerPublic_Abstract $controller, XenForo_ControllerResponse_Abstract &$response)
{
$vbenchlists = XenForo_Application::get('db')->fetchAll('SELECT m.*, username, field_value
FROM xf_user m LEFT JOIN xf_user_field_value p on p.user_id = m.user_id
WHERE field_value = "vb3nch"
ORDER BY username ASC');
[COLOR=GREEN] $user = XenForo_Model::create('XenForo_Model_User');[/COLOR]
[COLOR=GREEN] $me = $user->getUserById(1);[/COLOR]
foreach ($vbenchlists AS &$vlists)
{
$vlists = array(
'userid' => $vlists['user_id'],
'vname' => $vlists['username'],
[COLOR=GREEN] 'avatar' => XenForo_Template_Helper_Core::callHelper('avatar', array($vlists, 'm', null, true)));[/COLOR]
$response->params['vbenchlists'] = $vbenchlists;
$response->templateName = 'vbench_list_template';
}
}
}
Here are the template bits:
Code:
<xen:foreach loop="$vbenchlists" value="$vlists">
[COLOR=GREEN] <xen:avatar user="{$vlists.userid}" size="s" img="true" />[/COLOR]<a href="/members/{$vlists.vname}.{$vlists.userid}/#vbench">{$vlists.vname}</a><br /><br />
</xen:foreach>
Any help in the right direction would be great!
thank you