 |
|
|
 | |  | |
|
|
°èÁ¤ Á¤º¸ Ãâ·ÂÇϱâ |
|
|
°ü¸®ÀÚ
|
06-06-17 01:53
|
|
|
| |
|
|
|
<? // Byte¸¦ KB, MB, GB·Î º¯È¯ÇÏ´Â ÇÔ¼ö function size($size) { if(!$size) return "0 Byte"; if($size < 1024) { return "$size Byte"; } elseif($size >= 1024 && $size < 1024 * 1024) { return sprintf("%0.1f",$size / 1024)." KB"; } elseif($size >= 1024 * 1024 && $size < 1024 * 1024 * 1024) { return sprintf("%0.1f",$size / 1024 / 1024)." MB"; } else { return sprintf("%0.1f",$size / 1024 / 1024 / 1024)." GB"; } }
// ÃÑ °Ô½Ã¹°ÀÇ °¹¼ö, ÃÑ ÄÚ¸àÆ®ÀÇ °¹¼ö, °Ô½ÃÆÇÀÇ °¹¼ö, ±×¸®°í °¢ °Ô½ÃÆÇÀÇ Å×ÀÌºí ¸íÀ» ±¸ÇÔ $q_count = mysql_query("select * from g4_board"); $count_write = 0; $count_comment = 0; $count_board = 0; $bo_tb = "0"; while($data=mysql_fetch_array($q_count)) { $count_write += $data[bo_count_write]; $count_comment += $data[bo_count_comment]; $count_board++; $bo_tb = $bo_tb."|".$data[bo_table]; }
// °¢ °Ô½ÃÆÇÀÇ ÃÑ °Ô½Ã¹° ¼ö, ÃÑ ÄÚ¸àÆ® ¼ö, »õ °Ô½Ã¹° ¼ö¸¦ ±¸ÇÔ(ÇöÀç ³¯Â¥¿Í µî·ÏµÈ ³¯Â¥¸¦ ºñ±³ÇÏ¿© °°À¸¸é »õ °Ô½Ã¹°) $bo_tb = explode("|", $bo_tb); $i = 1; $new_comment = 0; $new_article = 0; while($i<=$count_board) { $q_new = mysql_query("select * from g4_write_".$bo_tb[$i]); $m_total[$bo_tb[$i]] = 0; while($dat=mysql_fetch_array($q_new)) { $m_total[$bo_tb[$i]]++; $m_article[$bo_tb[$i]] = 0; if(substr($dat[wr_datetime],0,10)!=date("Y-m-d")) continue; if($dat[wr_comment]>0) $new_comment++; else { $new_article++; $m_article[$bo_tb[$i]]++; } } $i++; } // ¿©±â¼ ±¸ÇÑ °¢ °Ô½ÃÆÇÀÇ ÃÑ °Ô½Ã¹°°ú »õ °Ô½Ã¹°ÀÇ ¼ö´Â °¢°¢ $m_total[Å×À̺í¸í], $m_article[Å×À̺í¸í] À¸·Î »ç¿ëÇÏ½Ã¸é µË´Ï´Ù.
// ÇöÀç Á¢¼ÓÇÑ È¸¿ø ¶Ç´Â ºñȸ¿øÀÇ ¼ö¸¦ ±¸ÇÔ(Àú´Â ½ºÅ²¸¸µé¾î ¾²±â°¡ ±ÍÂú¾Æ¼ À̹æ¹ýÀ»;;;) $q_connect = mysql_query("select * from g4_login"); $count_no_mb = 0; $count_mb = 0; while($data=mysql_fetch_array($q_connect)) { if($data[mb_id] == "") $count_no_mb++; elseif($data[mb_id] != "yhs6374") $count_mb++; // yhs6374 ¸¦ °ü¸®ÀÚ ¾ÆÀ̵ð·Î... }
// ¿À´Ã »õ·Î ´©ÀûµÈ Æ÷ÀÎÆ®¿Í ÃÑ ´©ÀûµÈ Æ÷ÀÎÆ®¸¦ ±¸ÇÔ $q_point = mysql_query("select * from g4_point"); $new_point = 0; $all_point = 0; while($data=mysql_fetch_array($q_point)) { if(substr($data[po_datetime],0,10)==date("Y-m-d")) $new_point += $data[po_point]; $all_point += $data[po_point]; }
// »õ ȸ¿ø ¼ö¿Í ÃÑ È¸¿ø ¼ö¸¦ ±¸ÇÔ $m_count = mysql_query("select * from g4_member"); $new_member = 0; $count_member = 0; while($data=mysql_fetch_array($m_count)) { if($data[mb_nick]=="[»èÁ¦µÊ]") continue; if(substr($data[mb_datetime],0,10)==date("Y-m-d")) $new_member++; $count_member++; }
// ¸ðµç °Ô½ÃÆÇ¿¡ ÷ºÎµÈ ÆÄÀÏÀÇ °¹¼ö¸¦ ±¸ÇÔ $d_count = mysql_query("select * from g4_board_file"); $count_data = 0; while(mysql_fetch_row($d_count)) { $count_data++; }
// °èÁ¤ÀÇ »ç¿ë·®À» ±¸ÇÔ $account_space = `du -sb $g4[path]`; $account_space = substr($account_space,0,strlen($account_space)-3);
// DATA Æú´õÀÇ ¿ë·®À» ±¸ÇÔ $data_space = `du -sb $g4[path]/data`; $data_space = substr($data_space,0,strlen($data_space)-8);
// DBÀÇ »ç¿ë·®À» ±¸ÇÔ $result = mysql_query("SHOW TABLE STATUS"); $db_using = 0; while($dbData=mysql_fetch_array($result)) { $db_using += $dbData[Data_length]+$dbData[Index_length]; } ?>
=============================================================
¼Ò½º°¡ ³¡³µ½À´Ï´Ù. ¾Æ·¡´Â Àû¿ëµÈ ¿¹Á¦ÀÔ´Ï´Ù.
<table cellpadding=0 cellspacing=0 width=160> <tr> <td align=center> - <b>°èÁ¤ Á¤º¸</b> - </td> </tr> <tr> <td style="font-size:8pt;"> File : <?=size($account_space)?><br> Data : <?=size($data_space)?><br> DB : <?=size($db_using)?><br> </td> </tr> <tr> <td align=center> - <b>°Ô½ÃÆÇ Á¤º¸</b> - </td> </tr> <tr> <td style="font-size:8pt;"> Board : <?=$count_board?><br> Data File : <?=number_format($count_data)?><br> New Article : <?=number_format($new_article)?><br> Total Article : <?=number_format($count_write)?><br> New Comment : <?=number_format($new_comment)?><br> Total Comment : <?=number_format($count_comment)?><br> New Member : <?=number_format($new_member)?><br> Total Member : <?=number_format($count_member)?><br> Connect : <?=number_format($count_no_mb+$count_mb)?><br> (Member : <?=number_format($count_mb)?>)<br> New Point : <?=number_format($new_point)?><br> Total Point : <?=number_format($all_point)?><br> </td> </tr> </table>
|
|
 |
| | |  | |  |
|
|
|
|
|
|