How do I create a list of members in particular usergroups on a page node?

Brilliant, thanks. Nearly there.
I want to display the user's signature to the right of their row in the user list.
So I created a new template and copied the contents of the member_list_item template and added
HTML:
<div class="baseHtml signature ugc" style="float:right;">{$user.signature}</div>
Before the user name. But the sigature BB codes aren't parsed. I'm guessing there is a Xenforo function to parse fields prior to display?
 
You're using the template callback functionality for this right? Getting bbcode to parse is supposed to be done in the view instead of in the controller. To get it to work perfectly, you'd pretty much have to re-do the entire thing to have it's own route prefix instead of using the page node method like you're currently doing. You can get most of the bbcode functionality to work in your current method but quotes, attachments, and maybe something else(? I can't look at the moment).
 
'in the view instead of the controller'. whoosh over my head. Don't really understand what a controller is. Is it a bit like the bad guy in Tron?
So there is no function in Xenforo which I can call in the php script which will take a string (a member's signature) and return parsed HTML?
 
lol, the controller is the block of code you posted "...ControllerPublic_..." Moving on though, no, you can try something along the lines of this but it won't work for people with
or attachments.

Code:
$formatter = new XenForo_BbCode_Formatter_Base;
$parser = new XenForo_BbCode_Parser($formatter);
$this->params['test'] = $parser->parse($message);
 
lol, the controller is the block of code you posted "...ControllerPublic_..." Moving on though, no, you can try something along the lines of this but it won't work for people with or attachments.

Code:
$formatter = new XenForo_BbCode_Formatter_Base;
$parser = new XenForo_BbCode_Parser($formatter);
$this->params['test'] = $parser->parse($message);
pls not this way:p

The parser and formatter also use the proxy system and should ALWAYS be initialized via the "create " factory method (to not break any addon extending the BbCode Classes)
PHP:
    $bbCodeParser = XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create('Base'));
 
I feel I made it clear that it wasn't ideal to use that method, he however also made it clear he wasn't interested in learning how to switch the way he's rendering this page at the moment.
 
I feel I made it clear that it wasn't ideal to use that method, he however also made it clear he wasn't interested in learning how to switch the way he's rendering this page at the moment.
Well I am actually interested in learning how to code complex addons for Xenforo Daniel, and I believe that's within my capability. It's just I have the constraints of time pressing at the moment, and I'm hoping that a simple solution will enable me to get the advertiser list page working as it needs to be ASAP (it was supposed to be online at launch on October 26th).

Thanks all for your help, it is very much appreciated, and something which reminds me every day how wonderful Xenforo and its community are.
 
Well I am actually interested in learning how to code complex addons for Xenforo Daniel, and I believe that's within my capability. It's just I have the constraints of time pressing at the moment, and I'm hoping that a simple solution will enable me to get the advertiser list page working as it needs to be ASAP (it was supposed to be online at launch on October 26th).

Thanks all for your help, it is very much appreciated, and something which reminds me every day how wonderful Xenforo and its community are.

I wasn't attmepting to be offensive or imply that you weren't capable. The fact that you're doing things on your own when you could easily pay chris or someone else to do whatever you're trying to do shows you're interested/capable. My comment was more related to you responding with "'in the view instead of the controller'. whoosh over my head. Don't really understand what a controller is. Is it a bit like the bad guy in Tron?" when I was talking about the appropriate way to do it. I took that as you being like:

images


Try: {xen:raw $signature}
 
Oh Daniel please don't think for a moment that I was anything like offended. I'm making excuses for myself because to be honest, I should have got off my lazy ass and learned Xenforo coding ages ago.
Problem is that I'm an old school coder and classes and methods are somewhat of a new concept for me. So a lot of the terminology is very foreign.
To be honest at this point I need to go on a MySQL course (as my SQL training at Oracle happened 23 years ago), a PHP course so I can learn programming with classes and a CSS course so I can learn the most efficient tricks and a JS course with Ajax. I learn best on courses rather than with books.
Anyhoo thanks again for the help which is much appreciated.
 
I have this:
PHP:
        $criteria = array('secondary_group_ids' => array(16));
        $premium_advertisers = $controller->getModelFromCache('XenForo_Model_User')->getUsers($criteria, $options);
        reset($premium_advertisers);
        foreach ($premium_advertisers as &$avf_users) {
            $avf_users['signature'] = $bbCodeParser->parse($avf_users['signature']);
        }
...
    $response->params['premium_advertisers'] = $premium_advertisers;
and the template is this:
HTML:
<xen:require css="xenforo_member_list_item.css" />

<li class="primaryContent memberListItem{xen:if $extended, ' extended'}"{xen:if $id, ' id="{$id}"'}>

   <xen:avatar user="$user" size="s" class="{xen:if $noOverlay, 'NoOverlay'}" />

   <xen:if is="{$extraTemplate}"><div class="extra">{xen:raw $extraTemplate}</div></xen:if>

   <div class="member">
  
     <xen:if is="{$user.user_id}">
       <div class="baseHtml signature ugc" style="float:right; width: 280px;">{xen:raw $user.signature}</div>
It's displaying 'array'.
 
btw

just open the file
Code:
install/data/templates.xml
and take a look at the templates:D


search for "homepage" to see how xenforo is handling the output (e.g to see if a helper is available or if there's anything else (in this case you'll see that xenforo is censoring the homepage url)
Code:
<xen:if is="{$user.homepage}">
                       <dl><dt>{xen:phrase home_page}:</dt> <dd><a href="{xen:string censor, $user.homepage, 'x'}" rel="nofollow" target="_blank">{xen:string censor, $user.homepage}</a></dd></dl>
                     </xen:if>
 
Top Bottom