MyBB Community Forums

Full Version: A second team Page
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hey, here it what I am trying to do Smile

I need a second team page with different people.

So I copied the the showteam.php file and started to change stuff.

The criteria to be on the second page are not identical to the first, so I changed line 24

$query = $db->query("SELECT * FROM ".TABLE_PREFIX."usergroups WHERE showforumteam='yes' AND gid!='6' ORDER BY title ASC");

to

$query = $db->query("SELECT * FROM ".TABLE_PREFIX."usergroups WHERE showpaten='yes'");

Whereby I added a new column (showpaten) with phpmyadmin to usergroups and put a "yes" to the groups I want to display.

And there I pretty much get lost. The groups I use are 8 and 10. All the members are secondary users. I don't want to show them separated in groups (If that is a problem, I just will create another group where all will be in as another secondary group).

And what I want to show are customfields fid5, fid5 and fid7 and sorted by fid7.

Could anybody help me with that?

Thanx in advance.
Bill Wrote:The groups I use are 8 and 10. All the members are secondary users. I don't want to show them separated in groups
Just to be sure I follow on this part, you want a second team page that shows users from group number 8 and 10, but you do not want to show them in their individiual group, rather a list in ABC order.

Is that correct?
OK, not exactly Smile, I want to show a group (which are momentary consist of two groups (male female) so I easily could put them all into a third one). They are all assigned to a special job (in fid7), after this job it should be sorted. On the page itself I want to show the custom fields fid5 to 7. Hope I could explain i properly Smile.
I tried around a little bit more, but I don't have any success. I have no idea how to make the query to show the secondary users of a group in the team-page, could anybody help.

In my opinion it is also a bug, the Forum-Team page should show all members of a group (primary and secondary as well).
The team page by default should show the display group of the user.
Does "By default" mean you can change it?
By default I meant without modifications to the code. You can change it, but it will require some coding modifications. (I was responding you thinking that it was a 'bug')
Could you give me some help Dennis Rolleyes
Find:
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."usergroups WHERE showforumteam='yes' AND gid!='6' ORDER BY title ASC");
while($usergroup = $db->fetch_array($query))
{
	$teams[$usergroup['gid']] = $usergroup;
	$teamquery .= "$comma'$usergroup[gid]'";
	$comma = ",";
}
$query = $db->query("SELECT u.*, u.usergroup, u.displaygroup FROM ".TABLE_PREFIX."users u WHERE u.displaygroup IN ($teamquery) OR (u.displaygroup = 0 AND u.usergroup IN ($teamquery)) ORDER BY u.username ASC");
Replace with:
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."usergroups WHERE showforumteam='yes' AND gid!='6' ORDER BY title ASC");
while($usergroup = $db->fetch_array($query))
{
	$teams[$usergroup['gid']] = $usergroup;
	$ug = "%,$usergroup[gid],%";
	$teamquery .= (empty($teamquery)) ? '' : ' OR ';
	$teamquery .= "(CONCAT(',',additionalgroups,',') = $ug)";
	$comma = ",";
}
$query = $db->query("SELECT u.*, u.usergroup, u.displaygroup FROM ".TABLE_PREFIX."users u WHERE $teamquery ORDER BY u.username ASC");

The above is 2AM guess-work. I'm going to sleep now, try it, and if it doesn't work, we'll figure it out tomorrow.
Thank you so very much for your help, that's what the page gives me out
mySQL error: 1064
You have an error in your SQL syntax near '%,11,%) OR (CONCAT(',',additionalgroups,',') = %,14,%) OR (CONCAT(',',additional' at line 1
Query: SELECT u.*, u.usergroup, u.displaygroup FROM mybb_users u WHERE (CONCAT(',',additionalgroups,',') = %,11,%) OR (CONCAT(',',additionalgroups,',') = %,14,%) OR (CONCAT(',',additionalgroups,',') = %,15,%) OR (CONCAT(',',additionalgroups,',') = %,16,%) OR (CONCAT(',',additionalgroups,',') = %,23,%) OR (CONCAT(',',additionalgroups,',') = %,22,%) OR (CONCAT(',',additionalgroups,',') = %,19,%) OR (CONCAT(',',additionalgroups,',') = %,18,%) OR (CONCAT(',',additionalgroups,',') = %,21,%) OR (CONCAT(',',additionalgroups,',') = %,20,%) OR (CONCAT(',',additionalgroups,',') = %,17,%) OR (CONCAT(',',additionalgroups,',') = %,9,%) OR (CONCAT(',',additionalgroups,',') = %,3,%) OR (CONCAT(',',additionalgroups,',') = %,8,%) OR (CONCAT(',',additionalgroups,',') = %,10,%) ORDER BY u.username ASC
Pages: 1 2