Problem mit der Teamliste

Du hast Probleme beim Einbau oder bei der Benutzung eines Mods? In diesem Forum bist du richtig.
Forumsregeln
phpBB 3.0 hat das Ende seiner Lebenszeit überschritten
phpBB 3.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 3.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf die neuste phpBB-Version, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
Antworten
Incognito
Mitglied
Beiträge: 88
Registriert: 10.03.2007 15:33

Problem mit der Teamliste

Beitrag von Incognito »

Hallo,
Ich habe den MOD installiert, der mir mehrere Gruppen auf der Teamliste anzeigt. Das Ergebnis ist nicht gerade überzeugend..

Große Bilder bitte nur verlinken - KB:16 - JFooty
http://img3.imagebanana.com/img/tqm65d3v/sammelbild.PNG
Große Bilder bitte nur verlinken - KB:16 - JFooty

Der Spaß geht noch länger so weiter. Die entsprechenden Codestücke, die die Teamliste beeinflussen sind folgende:

memberlist.php

Code: Alles auswählen

// Display a listing of board admins, moderators
		$new_group_id = '11';//enter your usergroup number here!
    include($phpbb_root_path . 'includes/functions_user.' . $phpEx);

		$page_title = $user->lang['THE_TEAM'];
		$template_html = 'memberlist_leaders.html';

		$user_ary = $auth->acl_get_list(false, array('a_', 'm_'), false);

		$admin_id_ary = $global_mod_id_ary = $mod_id_ary = $forum_id_ary = array();
		foreach ($user_ary as $forum_id => $forum_ary)
		{
			foreach ($forum_ary as $auth_option => $id_ary)
			{
				if (!$forum_id)
				{
					if ($auth_option == 'a_')
					{
						$admin_id_ary = array_merge($admin_id_ary, $id_ary);
					}
					else
					{
						$global_mod_id_ary = array_merge($global_mod_id_ary, $id_ary);
					}
					continue;
				}
				else
				{
					$mod_id_ary = array_merge($mod_id_ary, $id_ary);
				}

				if ($forum_id)
				{
					foreach ($id_ary as $id)
					{
						$forum_id_ary[$id][] = $forum_id;
					}
				}
			}
		}

		$admin_id_ary = array_unique($admin_id_ary);
		$global_mod_id_ary = array_unique($global_mod_id_ary);

		$mod_id_ary = array_merge($mod_id_ary, $global_mod_id_ary);
		$mod_id_ary = array_unique($mod_id_ary);
		
				$new_group_ary = array();
		$sql2 = 'SELECT ug.*
			FROM ' . USER_GROUP_TABLE . " ug
			WHERE  ug.group_id = '$new_group_id'";
		$result2 = $db->sql_query($sql2);
		while ($row2 = $db->sql_fetchrow($result2))
		{
			$new_group_ary[] = $row2['user_id'];
		}
		$db->sql_freeresult($result2);
		$sql3 = 'SELECT group_name, group_type
			FROM ' . GROUPS_TABLE . "
			WHERE group_id = '$new_group_id'
			LIMIT 1";
		$result3 = $db->sql_query($sql3);
		while ($row3 = $db->sql_fetchrow($result3))
		{
			$new_group_name = ($row3['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row3['group_name']] : $row3['group_name'];
		}
		$db->sql_freeresult($result3);

		// Admin group id...
		$sql = 'SELECT group_id
			FROM ' . GROUPS_TABLE . "
			WHERE group_name = 'ADMINISTRATORS'";
		$result = $db->sql_query($sql);
		$admin_group_id = (int) $db->sql_fetchfield('group_id');
		$db->sql_freeresult($result);

		// Get group memberships for the admin id ary...
		$admin_memberships = group_memberships($admin_group_id, $admin_id_ary);

		$admin_user_ids = array();
		
		if (!empty($admin_memberships))
		{
			// ok, we only need the user ids...
			foreach ($admin_memberships as $row)
			{
				$admin_user_ids[$row['user_id']] = true;
			}
		}
		unset($admin_memberships);

		$sql = 'SELECT forum_id, forum_name
			FROM ' . FORUMS_TABLE . '
			WHERE forum_type = ' . FORUM_POST;
		$result = $db->sql_query($sql);
		
		$forums = array();
		while ($row = $db->sql_fetchrow($result))
		{
			$forums[$row['forum_id']] = $row['forum_name'];
		}
		$db->sql_freeresult($result);

		$sql = $db->sql_build_query('SELECT', array(
			'SELECT'	=> 'u.user_id, u.group_id as default_group, u.username, u.username_clean, u.user_colour, u.user_rank, u.user_posts, u.user_allow_pm, g.group_id, g.group_name, g.group_colour, g.group_type, ug.user_id as ug_user_id',

			'FROM'		=> array(
				USERS_TABLE		=> 'u',
				GROUPS_TABLE	=> 'g'
			),

			'LEFT_JOIN'	=> array(
				array(
					'FROM'	=> array(USER_GROUP_TABLE => 'ug'),
					'ON'	=> 'ug.group_id = g.group_id AND ug.user_pending = 0 AND ug.user_id = ' . $user->data['user_id']
				)
			),

			'WHERE'		=> $db->sql_in_set('u.user_id', array_unique(array_merge($admin_id_ary, $mod_id_ary)), false, true),
      'ORDER_BY'	=> 'g.group_name ASC, u.username_clean ASC'
		));
		$result = $db->sql_query($sql);

		while ($row = $db->sql_fetchrow($result))
		{
			$which_row = (in_array($row['user_id'], $admin_id_ary)) ? 'admin' : 'mod';

			// We sort out admins not within the 'Administrators' group.
			// Else, we will list those as admin only having the permission to view logs for example.
			if ($which_row == 'admin' && empty($admin_user_ids[$row['user_id']]))
			{
				// Remove from admin_id_ary, because the user may be a mod instead
				unset($admin_id_ary[array_search($row['user_id'], $admin_id_ary)]);

				if (!in_array($row['user_id'], $mod_id_ary) && !in_array($row['user_id'], $global_mod_id_ary))
				{
					continue;
				}
				else
				{
					$which_row = 'mod';
				}
			}
			else if ($which_row == 'mod')
			{
				$which_row = (in_array($row['user_id'], $mod_id_ary)) ? 'mod' : 'new_group';
			}
			$s_forum_select = '';
			$undisclosed_forum = false;

			if (isset($forum_id_ary[$row['user_id']]) && !in_array($row['user_id'], $global_mod_id_ary))
			{
				if ($which_row == 'mod' && sizeof(array_diff(array_keys($forums), $forum_id_ary[$row['user_id']])))
				{
					foreach ($forum_id_ary[$row['user_id']] as $forum_id)
					{
						if (isset($forums[$forum_id]))
						{
							if ($auth->acl_get('f_list', $forum_id))
							{
								$s_forum_select .= '<option value="">' . $forums[$forum_id] . '</option>';
							}
							else
							{
								$undisclosed_forum = true;
							}
						}
					}
				}
			}

			// If the mod is only moderating non-viewable forums we skip the user. There is no gain in displaying the person then...
			if (!$s_forum_select && $undisclosed_forum)
			{
//				$s_forum_select = '<option value="">' . $user->lang['FORUM_UNDISCLOSED'] . '</option>';
				continue;
			}

			// The person is moderating several "public" forums, therefore the person should be listed, but not giving the real group name if hidden.
			if ($row['group_type'] == GROUP_HIDDEN && !$auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel') && $row['ug_user_id'] != $user->data['user_id'] || $auth->acl_get('f_list', 45)) //MOD TEHNETHACKER
			{
				$group_name = $user->lang['GROUP_UNDISCLOSED'];
				$u_group = '';
			}
			else
			{
				$group_name = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'];
				$u_group = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']);
			}

			$rank_title = $rank_img = '';
			get_user_rank($row['user_rank'], $row['user_posts'], $rank_title, $rank_img, $rank_img_src);

			$template->assign_block_vars($which_row, array(
				'USER_ID'		=> $row['user_id'],
				'FORUMS'		=> $s_forum_select,
				'RANK_TITLE'	=> $rank_title,
				'GROUP_NAME'	=> $group_name,
				'GROUP_COLOR'	=> $row['group_colour'],
				'USER_BP'  => GetUserBP($row['user_id']),


				'RANK_IMG'		=> $rank_img,
				'RANK_IMG_SRC'	=> $rank_img_src,

				'U_GROUP'			=> $u_group,
				'U_PM'				=> ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($row['user_allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&u=' . $row['user_id']) : '',

				'USERNAME_FULL'		=> get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
				'USERNAME'			=> get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']),
				'USER_COLOR'		=> get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']),
				'U_VIEW_PROFILE'	=> get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']),
			));
		}
		$db->sql_freeresult($result);

		#		$template->assign_vars(array(
#			'PM_IMG'		=> $user->img('icon_contact_pm', $user->lang['SEND_PRIVATE_MESSAGE']))
#		);
		$template->assign_vars(array(
			'PM_IMG'				=> $user->img('icon_contact_pm', $user->lang['SEND_PRIVATE_MESSAGE']),
			'NEW_GROUP_NAME'		=> $new_group_name,
		));
memberlist_leaders.html

Code: Alles auswählen

<!-- BEGIN new_group -->
	<!-- IF new_group.S_ROW_COUNT is even --><tr class="row2"><!-- ELSE --><tr class="row1"><!-- ENDIF -->

	<td class="gen" align="center"><strong>{new_group.USERNAME_FULL}</strong></td>
	<td align="center">-</td>
	<td class="gensmall" align="center" nowrap="nowrap">&nbsp;
		<!-- IF new_group.U_GROUP -->
			<a<!-- IF new_group.GROUP_COLOR --> style="font-weight: bold; color:#{new_group.GROUP_COLOR}"<!-- ENDIF --> href="{new_group.U_GROUP}">{new_group.GROUP_NAME}</a>
		<!-- ELSE -->
			{new_group.GROUP_NAME}
		<!-- ENDIF -->
	&nbsp;</td>
	<td class="gen" align="center"><!-- IF new_group.RANK_IMG -->{new_group.RANK_IMG}<!-- ELSE -->{new_group.RANK_TITLE}<!-- ENDIF --></td>
	<td class="gen" align="center">&nbsp;<!-- IF new_group.U_PM --><a href="{new_group.U_PM}">{PM_IMG}</a><!-- ENDIF -->&nbsp;</td>
</tr>
<!-- BEGINELSE -->
	<tr>
		<td class="row1" colspan="5" align="center"><span class="gen">{L_NO_MEMBERS}</span></td>
	</tr>
<!-- END new_group -->]]>
Wie ist das Problem zu lösen?

mfg
aurora876
Ehemaliger Übersetzer
Beiträge: 1600
Registriert: 30.08.2008 20:41

Re: Problem mit der Teamliste

Beitrag von aurora876 »

warum installierst du einen mod, der standardmäßig im phpbb3 drin ist?
There are 10 types of people in the world: Those who understand binary and those who don't. :D

Support Toolkit in Deutsch
Benutzeravatar
nickvergessen
Ehrenadmin
Beiträge: 11559
Registriert: 09.10.2006 21:56
Wohnort: Stuttgart, Germany
Kontaktdaten:

Re: Problem mit der Teamliste

Beitrag von nickvergessen »

aurora876 hat geschrieben:warum installierst du einen mod, der standardmäßig im phpbb3 drin ist?
Ist er nicht, sonst hätte ich die damals nicht gebastelt?

@Incognito: entfern mal aus deiner Template Datei.
Und auch sonst solltest du mal überprüfen, ob du alle Änderungen richtig gemacht hast.
kein Support per PN
Antworten

Zurück zu „[3.0.x] Mod Support“