Hãy đăng nhập để được xem nhiều hơn nhé
Bạn phải đăng nhập để xem được nội dung, nếu bạn chưa có tài khoản? hãy Đăng ký
x
Down 2 file đính kèm, cái thong_ke.zip giải nén được thư mục thong_ke các bác up
ngang hàng thư mục includes (root)
Giải nén file thong_ke.lbi.zip được file thong_ke.lbi các bác mở ra xem cách chèn rồi
làm lại theo tùy style nhé. Cái đó làm theo bản phukienmaytinh.vn. Còn em đã làm cho
bản default, bác nào có nhu cầu PM Yahoo fanhuynet, em online thì send cho các bác.
Rồi đến code:
1. Mở file lib_main.php trong includes ra. Ctrl+F gõ vào
get_os() tìm tới đoạn
- elseif (strpos($agent, 'nt 6.0') !== false)
- {
- $os = 'Windows Vista';
- }
- và chèn ngay sau nó đoạn mã:
- elseif (strpos($agent, 'nt 6.1') !== false)
- {
- $os = 'Windows 7';
- }
Sao chép mã
2. tiếp, cũng là file lib_main luôn:
Chèn
- function quoc_gia ($ip)
- {
- $numbers = preg_split( "/\./", $ip );
- $ranges = $countries = array();
- $ma_quoc_gia = $three_letter_country_code = $quoc_gia= "";
- include ( ROOT_PATH . "/thong_ke/ip_files/" . $numbers[0] . ".php" );
- $code = ( $numbers[0] * 16777216 ) + ( $numbers[1] * 65536 ) + ( $numbers[2] * 256 ) + (
- $numbers[3] );
- if ( ! empty( $ranges ) )
- {
- foreach ( $ranges as $key => $value )
- {
- if ( $key <= $code )
- {
- if ( $ranges[$key][0] >= $code )
- {
- $ma_quoc_gia = $ranges[$key][1];
- break;
- }
- }
- }
- }
- include ( ROOT_PATH . "/thong_ke/ip_files/countries.php" );
- $three_letter_country_code = $countries[$ma_quoc_gia][0];
- $quoc_gia= $countries[$ma_quoc_gia][1];
- $ma_quoc_gia = ($ma_quoc_gia!='') ? strtolower($ma_quoc_gia) : 'xx';
- $ket_qua=array(
- 'quoc_gia' => $quoc_gia,
- 'co' => 'http://api.hostip.info/images/flags/' .$ma_quoc_gia. '.gif',
- );
- return $ket_qua;
- }
Sao chép mã
chèn chỗ nào cũng được, miễn sao đừng nhè giữa các function khác mà phang là được ^^
3. Tiếp nè, Trong hàm visit_star()
tìm
xong xóa nó luôn, rồi thay cái này vào:
- $kv = quoc_gia($ip);
- $area = $kv['quoc_gia'];
Sao chép mã
Vậy là xong lib_main, giờ qua lib_insert.php nè:
Các bác chèn cái này vào
- function insert_thong_ke()
- {
- $today = local_strtotime(local_date('Y-m-d'));
- $gio=date('H',$today);
- $ngay=local_date('d');
- $truc_tuyen=$GLOBALS['db']->getOne("SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('sessions'));
- $tong_truy_cap=$GLOBALS['db']->getOne("SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('stats'));
- $truy_cap_tuan=$GLOBALS['db']->getOne("SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('stats').
- "WHERE access_time >= '($today - 86400 * 7)' AND access_time <= '$today'");
- $truy_cap_thang=$GLOBALS['db']->getOne("SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('stats').
- "WHERE access_time >= '($today - 86400 * ($ngay-1))' AND access_time <= '$today'");
- $truy_cap_ngay=$GLOBALS['db']->getOne("SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('stats').
- "WHERE access_time >= '$today- 86400'");
- $tongcong = str_pad($tong_truy_cap, 10, "0", STR_PAD_LEFT );
- $truc_tuyen = str_pad($truc_tuyen, 3, "0", STR_PAD_LEFT );
- $truy_cap_ngay = str_pad($truy_cap_ngay, 4, "0", STR_PAD_LEFT );
- $truy_cap_tuan = str_pad($truy_cap_tuan, 5, "0", STR_PAD_LEFT );
- $truy_cap_thang = str_pad($truy_cap_tuan, 5, "0", STR_PAD_LEFT );
- $ngay='';
- $tuan='';
- $thang='';
- $tt='';
- $tc='';
- for($i=0;$i<3;$i++)
- {
- $j=intval(substr($truc_tuyen,$i,1));
- $tt .='<img src="thong_ke/bo_dem/'.$j.'.png" align="absmiddle" width="12">';
- }
- for($i=0;$i<4;$i++)
- {
- $j=intval(substr($truy_cap_ngay,$i,1));
- $ngay .='<img src="thong_ke/bo_dem/'.$j.'.png" align="absmiddle" width="12">';
- }
- for($i=0;$i<5;$i++)
- {
- $j=intval(substr($truy_cap_tuan,$i,1));
- $tuan .='<img src="thong_ke/bo_dem/'.$j.'.png" align="absmiddle" width="12">';
- $j=intval(substr($truy_cap_thang,$i,1));
- $thang .='<img src="thong_ke/bo_dem/'.$j.'.png" align="absmiddle" width="12">';
- }
- for($i=0;$i<10;$i++)
- {
- $j=intval(substr($tongcong,$i,1));
- $tc.='<img src="thong_ke/bo_dem/'.$j.'.png" width="16">';
- }
- $content ='<table width=100%>';
- $content.='<tr><td align="left" >Đang trực tuyến:</td><td align="right"> '.$tt.'</td></tr>';
- $content.='<tr><td align="left" >Truy cập trong 24h:</td><td align="right" > '. $ngay.'</td></tr>';
- $content.='<tr><td align="left" >Truy cập trong tuần:</td><td align="right" >'.$tuan.'</td></tr>';
- $content.='<tr><td align="left" >Truy cập trong tháng:</td><td align="right">'.$thang.'</td></tr>';
- $content.='<tr><td colspan="2" align="center"><b>Tổng số lượt truy cập:</b></td></tr>';
- $content.='<tr><td colspan="2" align="center">'.$tc.'</td></tr>';
- $content.='</table>';
- return $content;
- }
- function insert_thong_tin()
- {
- $hinh_trinh_duyet='thong_ke/khac.gif';
- $hinh_dhd='thong_ke/khac.gif';
- $trinh_duyet=get_user_browser();
- $hdh=get_os();
- $ips=preg_split( "/\./",real_ip());
- $ip='';
- for($i=0;$i<4;$i++)
- {
- $m=$ips[$i];
- for ($j=0;$j<strlen($m);$j++)
- {
- $k=intval(substr($m,$j,1));
- $ip.='<img src="thong_ke/bo_dem/1/'.$k.'.png" width="13px">';
- }
- if ($i<3) $ip.='.';
- }
- if (strpos($trinh_duyet, 'IE') !== false)
- {
- $hinh_trinh_duyet='thong_ke/trinh_duyet/ie.jpg';
- }
- elseif (strpos($trinh_duyet, 'FireFox') !== false)
- {
- $hinh_trinh_duyet='thong_ke/trinh_duyet/firefox.jpg';
- }
- elseif (strpos($trinh_duyet, 'Opera') !== false)
- {
- $hinh_trinh_duyet='thong_ke/trinh_duyet/opera.jpg';
- }
- elseif (strpos($trinh_duyet, 'Netscape') !== false)
- {
- $hinh_trinh_duyet='thong_ke/trinh_duyet/netscape.jpg';
- }
- elseif (strpos($trinh_duyet, 'Chrome') !== false)
- {
- $hinh_trinh_duyet='thong_ke/trinh_duyet/chrome.jpg';
- }
- $hdh=get_os();
- if (strpos($hdh, 'Win') !== false)
- {
- if ($hdh=='Windows 7')
- {
- $hinh_hdh='thong_ke/hdh/win7.jpg';
- }
- else if ($hdh=='Windows 98')
- {
- $hinh_hdh='thong_ke/hdh/win98.jpg';
- }
- else
- {
- $hinh_hdh='thong_ke/hdh/winxp.jpg';
- }
- }
- elseif ($hdh=='Linux')
- {
- $hinh_hdh='thong_ke/hdh/linux.jpg';
- }
- $content.='<table width=100%>';
- $content.='<tr><td align="left" width=45%>Trình duyệt</td><td align="right" width=55%> <img
- src="'.$hinh_trinh_duyet.'" align="absmiddle" width="16px"> '. $trinh_duyet . '</td></tr>';
- $content.='<tr><td align="left" width=45%>Hệ điều hành</td><td align="right" width=55%> <img
- src="'.$hinh_hdh.'" align="absmiddle" width="16px"> '.$hdh. '</td></tr>';
- $kv=quoc_gia(real_ip());
- $content.='<tr><td align="left" width=45%>Quốc gia:</td><td align="right" width=55%> <img src="'.$kv['co'].'"
- align="absmiddle" width="16px"> '.$kv['quoc_gia'].'</td></tr>';
- $content.='<tr><td align="center" colspan="2"><img src="thong_ke/ip.jpg" width=20px>'.$ip.'</td></tr>';
- $content .='</table>';
- return $content;
- }
Sao chép mã
LINK DOWNLOAD:
http://www.mediafire.com/?sfsj8u372m61z16
http://www.mediafire.com/?68spiaw676m71rk
|
|