function get_user_thanked ($uid) //сколько раз юзера благодарили
{
$query3 = "SELECT COUNT(*) FROM (
". BB_ATTACHMENTS_RATING ." r
LEFT JOIN bb_attachments a ON ( a.attach_id=r.attach_id) )
WHERE a.user_id_1=$uid";
$result3 = mysql_query($query3) or die(mysql_error());
$row3 = mysql_fetch_assoc($result3);
$count3 = $row3['COUNT(*)'];
return $count3;
}
function get_user_thanked ($uid) //сколько раз юзера благодарили
{
$query3 = "SELECT COUNT(*) FROM (
". BB_ATTACHMENTS_RATING ." r
LEFT JOIN bb_attachments a ON ( a.attach_id=r.attach_id) )
WHERE a.user_id_1=$uid AND r.thanked =1";
$result3 = mysql_query($query3) or die(mysql_error());
$row3 = mysql_fetch_assoc($result3);
$count3 = $row3['COUNT(*)'];
return $count3;
}
----------------- includes/ucp/torrent_userprofile.php ---------------------
найти
$template->assign_block_vars('switch_leeching_none', array());
}
вставить после
require(BB_ROOT .'includes/functions_thanks.php');
найти 'LEECH_ROWSPAN' вставить ниже
'USER_THANKS_' => '<b>' . @get_user_thanks($profiledata['user_id']) . '</b> / <b>' . @get_user_thanked($profiledata['user_id']) . '</b> (раз)',
require(INC_DIR .'functions_thanks.php');
'USER_THANKS_' => '<b>' . @get_user_thanks($profiledata['user_id']) ,
'USER_THANKED_' => '<b>' . @get_user_thanked($profiledata['user_id']) ,
'USER_THANKS_LINK' => 'thanks.php?u=' . $profiledata['user_id'],