![]() |
help with custom memberlist please
I am creating custom memberlist pages and could use some help. I was familiar with the old vB code prior to the publishing suite, but things are different now.
I want to create a custom member list that will show members from a specific usergroup ID only. Then I want to specify which custom profile fields will be displayed (different from the default memberlist display). So, I need to know the code to call users of usergroup ID "x" and load custom profile fields by specific ID "x,y,z". I don't need all of the code for the memberlist template. Just the bits that I need to add or edit to make the content more specific. Thanks for the help! :D |
All of that should be the same as when you used vB3 - the php didn't change, it's the template calls and template syntax that changed. is_member_of is still the function to use to find if a user is a member of a usergroup and profile fields are still called by $variable['fieldx'] just like before.
|
Thanks Lynn!
I got the custom field part down ok. But am having an issue displaying members of a specific usergroup. I have tried the following, but I get an error in admin cp... Code:
<if condition="is_member_of($post, 10)"> Code:
<vb:if condition="is_member_of[$post, 10]"> Code:
<vb:if condition="is_member_of($bbuserinfo, 10)"> I am not trying to show items TO a specific usergroup. I am trying to show a memberlist OF members FROM a specific usergroup. Just wanted to say that in case there was any confusion. |
Look in the template - what is the variable being used for the users? It's isn't $post (that is in the postbit templates) and it isn't $bbuserinfo (that is you, the viewer), but it will be another variable ($userinfo? I can't remember) and that is the one you want to use.
|
Woohoo!! Ok so I finally got a bit farther. This works...
Code:
<vb:if condition="in_array($userinfo[usergroupid],array(10))"> So, the usergroupid filter I am trying to apply is not applying to this and I am not sure how best to apply that... Code:
{vb:raw letterbits} Code:
{vb:raw pagenav} |
Look at the query that defines the pagination and modify it for your own needs.
|
Any suggestions how to get the memberlist to display these users correctly? It is only showing the users from the usergroup I specified, but the page numbers and layout look like it's still counting the other members from the other groups as well.
I don't know if you would want to look at it or not as it's an adult oriented site with some nudity. |
It's in your code somewhere - not anything I would see on your site. In the 'real' memberslist.php file, there is a query just to get the userscount which is then used for pagination. If your page is modeled after that page, then it's that query that you need to modify.
|
I'm guessing that would be this bit of code? Any suggestions as to how I might modify it?
Code:
($hook = vBulletinHook::fetch_hook('memberlist_query_userscount')) ? eval($hook) : false; PS... thanks so much for all your help by the way! I really appreciate it. I'm still learning PHP. I'm actually going back to college the 28th to learn PHP more in depth. :) |
You will want to modify the line regarding the where users are in usergroup $ids (etc). Didn't you do the same thing in the main query which has the exact same part in the where statement?
|
All times are GMT. The time now is 11:36 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|