Seite 1 von 1

Spezialränge für Gruppenmitglieder!

Verfasst: Fr 02.Dez, 2005 15:05
von Rabi
Gibt es eine Möglichkeit, oder eine MOD um User, die in eine Gruppe aufgenommen werden, automatisch einen Spezial-Rang zuzuweisen?

Ich habe eine Gruppe Moderatoren. Wenn ich einen User in diese Gruppe schiebe, hat er automatisch "Moderatoren" Rechte. Das neue Gruppenmitglied soll aber auch automatisch einen Spezial-Rang bekommen!

Is soetwas möglich?

Verfasst: Fr 02.Dez, 2005 15:26
von oxpus
Möglich sicher.
Da wäre nach dem INSERT INTO in die Usergruppen-Tabelle, bzw. beim UPDATE der Userdatne selber auch ein UPDATE des Rangs fällig.
Wobei genau dieser hier fest zu definieren wäre, was im Falle einer Rang-Änderung im ACP (bewusst oder versehentlich) zu Problemem führen kann...

Verfasst: Fr 02.Dez, 2005 16:40
von AmigaLink
Group Rank Hack Könnte da evtl. weiterhelfen.

Verfasst: Sa 03.Dez, 2005 03:43
von nightowl
Extended Ranks System

This hack allows you to set up different rank sets that you can use to attach different post count ranks to individual users, users who use a certain template or users who are either male of female.

You can choose to allow your members to choose their own rank set with the option to hide certain rank sets from them.

You can also apply special ranks to banned users, users who are celebrating their birthdday (with the Birthday Hack), users who are either an administrator moderator or people who are in a specific usergroup.

Verfasst: Fr 09.Dez, 2005 18:30
von Rabi
Genau das habe ich gesucht!

Habe es eingebaut, nun bekomme ich folgenden Fehler:

Code: Alles auswählen

Parse error: parse error, unexpected T_ELSE in /var/www/XXX/html/phpBB2/viewtopic.php on line 894
Das sind die Zeilen:

Zeile 9 im Code ist bei mir die 894

Code: Alles auswählen

	//
	// Generate ranks, set them to empty string initially.
	//
	$poster_rank = '';
	$rank_image = '';
	if ( $postrow[$i]['user_id'] == ANONYMOUS )
	{
	}
	} else if ( isset($userdata['user_birthday']) && isset($rankcfg[RANK_CFG_BIRTHDAY.',1']) && create_date('md', time(), $postrow[$i]['user_timezone']) == realdate('md',$postrow[$i]['user_birthday']) ) {

		for($j = 0; $j < count($ranksrow); $j++)
		{
			if ( $rankcfg[RANK_CFG_BIRTHDAY.',1'] == $ranksrow[$j]['rank_id'] && $ranksrow[$j]['rank_special'] )
			{
				$poster_rank = $ranksrow[$j]['rank_title'];
				$rank_image = ( $ranksrow[$j]['rank_image'] ) ? '<img src="' . $ranksrow[$j]['rank_image'] . '" alt="' . $poster_rank . '" title="' . $poster_rank . '" border="0" /><br />' : '';
			}
		}
	else if ( $postrow[$i]['user_rank'] )
	{
		for($j = 0; $j < count($ranksrow); $j++)
		{
			if ( $postrow[$i]['user_rank'] == $ranksrow[$j]['rank_id'] && $ranksrow[$j]['rank_special'] )
			{
				$poster_rank = $ranksrow[$j]['rank_title'];
				$rank_image = ( $ranksrow[$j]['rank_image'] ) ? '<img src="' . $ranksrow[$j]['rank_image'] . '" alt="' . $poster_rank . '" title="' . $poster_rank . '" border="0" /><br />' : '';
			}
		}
	}

	else
	{
		for($j = 0; $j < count($ranksrow); $j++)
		{
						if ( $postrow[$i]['user_posts'] >= $ranksrow[$j]['rank_min'] && !$ranksrow[$j]['rank_special'] && $ranksrow[$j]['rankset_id'] == $postrow[$i]['user_rankset_id'] )
			{
				$poster_rank = $ranksrow[$j]['rank_title'];
				$rank_image = ( $ranksrow[$j]['rank_image'] ) ? '<img src="' . $ranksrow[$j]['rank_image'] . '" alt="' . $poster_rank . '" title="' . $poster_rank . '" border="0" /><br />' : '';
			}
		}
	}
Habe aber alles nach Anweisung eingebaut! (hoffe ich) ^d

Verfasst: Sa 10.Dez, 2005 09:48
von oxpus
Lösche mal die Klammer aus Zeile 8.

Verfasst: Do 15.Dez, 2005 08:30
von Rabi
Prima, das wars! ;)