gordy
Well-known member
I'm trying to use this as a PHP callback into a page.
The video tutorial is little help for anything not builtin function wise or custom queries.
I've got this :
The query by itself against the database works fine showing expected results.
And is this part right getting it into it's own template?
$response->templateName = 'vbench_list_template';
The template (exists)
The video tutorial is little help for anything not builtin function wise or custom queries.
I've got this :
PHP:
<?php
class PFvbench_vlist
{
public static function showVlist(XenForo_ControllerPublic_Abstract $controller, XenForo_ControllerResponse_Abstract &$response)
{
$vbenchlists = XenForo_Application::get('db')->fetchAll('SELECT *
FROM xf_user m LEFT JOIN xf_user_field_value p on p.user_id = m.user_id
WHERE field_value = "vbench"
ORDER BY username ASC');
foreach ($vbenchlists AS &$vlists)
{
$vlists = array(
'userid' => $vlists['user_id'],
'vname' => $vlists['username']);
print "$vlists";
return $vbenchlists;
}
$response->templateName = 'vbench_list_template';
}
}
The query by itself against the database works fine showing expected results.
And is this part right getting it into it's own template?
$response->templateName = 'vbench_list_template';
The template (exists)
Code:
<xen:foreach loop="$vlist" value="$vbenchlists">
<li>
<a href="{$username}{$user_id}/#vbench">{$username}</a><br /><br />
</li>
</xen:foreach>