php/lib/database.php
/*
	 *  Get User Information from the group
	 * 
	 *  Paramenters:
	 *  $user_id as Integer
	 *  $group_id ad Integer
	 * 
	 *  Return:
	 *  99 as a Super User
	 *  88 as the Administrator
	 *  77 as the Moderator
	 *  
	 *	55 a user who has been kicked by the administrator
	 */
Get User Information from the group



99 as a Super User
88 as the Administrator
77 as the Moderator

55 a user who has been kicked by the administrator
Get User Information from the group 99 as a Super User 88 as the Administrator 77 as the Moderator 55 a user who has been kicked by the administrator
function GetUserInfoFromGroup($user_id,$group_id)
	{
		$dbfields = 'user_id,user_type,user_group_id';
		$query = "SELECT {$dbfields} FROM bot_setting WHERE user_id = {$user_id} AND user_group_id = {$group_id} LIMIT 1";
		$ret=$this->query($query);
		$result = ''; $value='';
		while($row = $ret->fetchArray(SQLITE3_ASSOC) ){
			$value = $row['user_type'];	
		}
		switch ($value){
			case 99: $result='SU'; break;
			case 88: $result='ADMIN'; break;
			case 77: $result='MOD'; break;
			case 55: $result='BANNED'; break;
		}
	   return $result;
	}
function GetUserInfoFromGroup ( $ user_id , $ group_id ) { $ dbfields = 'user_id,user_type,user_group_id' ; $ query = " SELECT  { $ dbfields }  FROM bot_setting WHERE user_id =  { $ user_id }  AND user_group_id =  { $ group_id }  LIMIT 1 " ; $ ret = $ this -> query ( $ query ) ; $ result = '' ; $ value = '' ; while ( $ row = $ ret -> fetchArray ( SQLITE3_ASSOC ) ) { $ value = $ row [ 'user_type' ] ; } switch ( $ value ) { case 99 : $ result = 'SU' ; break ; case 88 : $ result = 'ADMIN' ; break ; case 77 : $ result = 'MOD' ; break ; case 55 : $ result = 'BANNED' ; break ; } return $ result ; }
Get User Information from the group
Get User Information from the group