<?php


function get_userface($username, $n_hotuser) {
  static $f = 1;
  global $web, $row_hotuser;

   $text .= '<span class="index_userface_each"><a href="user.php?get=card&username='.urlencode($username).'" target="_blank"><img src="obj.php?title=face-'.urlencode($username).'.'.$web['img_up_format'].'" width="'.$web['img_w_s'].'" height="'.$web['img_h_s'].'" /><span class="un">'.$username.'<br />('.$row_hotuser['n'].')</span></a></span>';

  return $text;
}

function get_y_td($y) {
  for ($i = 0; $i < 3 - $y; $i++) {
    $text .= '<td>&nbsp;</td>';
  }
  return $text;
}

@ require ('inc/set/set_userface.php');
$topdate = gmdate('Ymd', time() + (floatval($web['time_pos']) * 3600)).'000000';
$result_hotuser = @mysql_query('SELECT author_ip,COUNT(id) AS n FROM '.$sql['pref'].''.$sql['data']['承载主题文章的表名'].' WHERE area_check="0" GROUP BY author_ip ORDER BY n DESC LIMIT 12', $db);
$n_hotuser = @mysql_num_rows($result_hotuser);
if ($n_hotuser > 0) {
  $text_userface .= '<div class="index_userface">
                     <div class="title"><a class="list_title_in">活跃成员</a></div><div class="body_in">';
  while ($row_hotuser = @mysql_fetch_assoc($result_hotuser)) {
    $text_userface .= get_userface($row_hotuser['author_ip'], $n_hotuser);
  }
  $text_userface .= '</div></div>';

  unset($row_hotuser, $n_hotuser);
}
@mysql_free_result($result_hotuser);

write_file('inc/require/hot_user.txt', $text_userface);
unset($text_userface);


?>