}
$user_tos_vers = $user_item->tos_vers_get();
+ $partyskill = $bdb->usersnet_partyskill($user->code, $user_item->code);
+
$widefriend = $bdb->usersnet_widefriend($user->code, $user_item->code);
$widefriend['skill'] = $bdb->usersnet_wideskill($user->code, $user_item->code);
$narrowfriend = $bdb->usersnet_narrowfriend($user->code, $user_item->code);
"Normale" : "Stato sconosciuto"))),
"guar" => ($user_item->type & USER_FLAG_TY_APPR ?
"" : $guar_login),
+ "party" => $partyskill,
"match" => (versions_cmp($user_tos_vers, "1.4") < 0 ? "non autorizzato" : $user_item->match_cnt) ,
"game" => (versions_cmp($user_tos_vers, "1.4") < 0 ? "non autorizzato" : $user_item->game_cnt),
"friend" => usersnet_friend_getlabel($usersnet_item->friend),
return ($narrowskill);
}
+ function usersnet_partyskill($owner, $target)
+ {
+ GLOBAL $G_dbpfx;
+
+ $partyskill = "non disponibile";
+
+ $pskl_sql = sprintf("SELECT * FROM %susersnet_party WHERE owner = %d AND target = %d;",
+ $G_dbpfx, $owner, $target);
+ if (($pskl_pg = $this->query($pskl_sql)) == FALSE) {
+ return ($partyskill);
+ }
+
+ if (pg_numrows($pskl_pg) > 0) {
+ $pskl_obj = pg_fetch_object($pskl_pg, 0);
+ // TODO: UNCOMMENT IF THE NETWORK WORKS VERY WELL
+ // if ($wskl_obj->count >= 3)
+ $partyskill = sprintf("%3.2f", $pskl_obj->skill);
+ }
+ return ($partyskill);
+ }
+
function usersnet_bycode($owner, $target, $widefriend, $narrowfriend)
{
GLOBAL $G_dbpfx;
'en' => 'Matches'),
'info_match_tit' => array('it' => 'Partite giocate ai tavoli riservati.',
'en' => 'Matches played at reserved tables.'),
+ 'info_party' => array('it' => 'Party',
+ 'en' => 'Party'),
+ 'info_party_tit' => array('it' => 'Bravura calcolata in base ad amici, agli amici fidati e agli amici degli amici fidati in base alla credibilità degli amici fidati.',
+ 'en' => 'Skill calculated with party rules.'),
'info_game' => array('it' => 'Mani',
'en' => 'Hands'),
'info_game_tit' => array('it' => 'Mani giocate ai tavoli riservati.',
<tr>
<td class="head"><span><?php echo $mlang_room['info_guar'][$G_lang]; ?>:</span></td>
<td class="ri b-right data"><span class="guar_id"></span></td>
-<td></td><td></td>
+<td class="head"><span class="title" title="<?php echo $mlang_room['info_match_tit'][$G_lang]; ?>"><?php echo $mlang_room['info_match'][$G_lang]; ?>:</span></td>
+<td class="ri data"><span class="match_id"></span></td>
</tr>
<tr>
-<td class="head"><span class="title" title="<?php echo $mlang_room['info_match_tit'][$G_lang]; ?>"><?php echo $mlang_room['info_match'][$G_lang]; ?>:</span></td>
-<td class="ri b-right data"><span class="match_id"></span></td>
+<td class="head"><span class="title" title="<?php echo $mlang_room['info_party_tit'][$G_lang]; ?>"><?php echo $mlang_room['info_party'][$G_lang]; ?>:</span></td>
+<td class="ri b-right data"><span class="party_id"></span></td>
<td class="head"><span class="title" title="<?php echo $mlang_room['info_game_tit'][$G_lang]; ?>"><?php echo $mlang_room['info_game'][$G_lang]; ?>:</span></td>
<td class="ri data"><span class="game_id"></span></td>
</tr>
} },
match: { type: 'value', perms: 'ro' },
game: { type: 'value', perms: 'ro' },
+ party: { type: 'value', perms: 'ro' },
friend: { type: 'radio' },
skill: { type: 'radio' },
trust: { type: 'radio' }