Identifing trusted users

Discussion of all aspects of the website, wiki, and forums, including support requests and new ideas.

Moderator: Forum Moderators

Post Reply
Xan
Inactive Developer
Posts: 258
Joined: August 28th, 2005, 3:05 pm
Contact:

Identifing trusted users

Post by Xan »

So that we can easily tell if a user is already in a group, I think that the name of the group should show up where the title goes.

The necessary php modifications are here:

[IN FILE 'viewtopic.php']
FIND:

Code: Select all

$ranksrow = array();
while ( $row = $db->sql_fetchrow($result) )
{
	$ranksrow[] = $row;
}
$db->sql_freeresult($result);
INSERT AFTER:

Code: Select all

$sql = "SELECT *
	FROM " . USER_GROUP_TABLE . "";
if ( !($result = $db->sql_query($sql)) )
{
	message_die(GENERAL_ERROR, "Could not obtain usergroup information.", '', __LINE__, __FILE__, $sql);
}

$groupsrow = array();
while ( $row = $db->sql_fetchrow($result) )
{
	$groupsrow[] = $row;
}
$db->sql_freeresult($result);
FIND:

Code: Select all

	else
	{
		for($j = 0; $j < count($ranksrow); $j++)
		{
			if ( $postrow[$i]['user_posts'] >= $ranksrow[$j]['rank_min'] && !$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 />' : '';
			}
		}
	}
INSERT AFTER:

Code: Select all

	for($j = 0; $j < count($groupsrow); $j++)
	{
		if( $groupsrow[$j]['user_id'] == $postrow[$i]['user_id'] )
		{
			$group_id = $groupsrow[$j]['group_id'];
			$group_sql = "SELECT group_name 
					FROM " . GROUPS_TABLE . " 
					WHERE group_id = $group_id";
			if ( !($result = $db->sql_query($group_sql)) )
			{
				message_die(GENERAL_ERROR, 'Could not get group information', '', __LINE__, __FILE__, $group_sql);
			}
			$group_name_row = $db->sql_fetchrow($result);
			$group_name = $group_name_row['group_name'];
			// possibly modify group_name here
			if($poster_rank == '') // no title
			{
				$poster_rank = $group_name;
			} // else do nothing
			break;
		}
	}
"It is time people learned about their failures and my successes."
User avatar
ivanovic
Lord of Translations
Posts: 1147
Joined: September 28th, 2004, 10:10 pm
Location: Germany

Post by ivanovic »

In the IRC channel is was stated the the normal "main" admin is not willing to apply even more patches to phpBB everytime he updates it. So it looks like there will be no other way than looking directly at the usergroups to be able to tell if a user is a member in one of these.
ettin
Lord of Glamdrol
Posts: 369
Joined: August 17th, 2003, 2:05 pm
Contact:

Re: Identifing trusted users

Post by ettin »

Xan wrote:So that we can easily tell if a user is already in a group, I think that the name of the group should show up where the title goes.
The forum isn't actively maintained at all. It is only updated when it is really needed (that is, security updates).
It would be good if someone else with more time and energy could take over the maintenance of the forum (I mean the forum engine here: phpBB).
Post Reply