?? typeview1.php
字號:
<html>
<head>
<title>中華網---個人主頁分類平均排名</title>
<style type="text/css">
<!--
body.t{ font-family: "宋體", "Arial", "Times New Roman"; font-size: 9pt;
line-height: 150%; letter-spacing: 1px}
.tt3{ font-family: "!宋體", "!Arial", "!Times New Roman"; font-size:11pt;
line-height: 130%; color: #000000;}
-->
</style></head>
<body class="tt3" bgcolor="#666699" text="#000000" link="#00AA80" vlink="#000000" alink="#000000">
<? include "./db_mysql.inc" ;
$maintypepath[0]="arts";
$maintypepath[1]="money";
$maintypepath[2]="technology";
$maintypepath[3]="education";
$maintypepath[4]="entertainment";
$maintypepath[5]="health";
$maintypepath[6]="sports";
$maintypepath[7]="lifestyle";
$shortmaintypename[0]="ac";
$shortmaintypename[1]="bm";
$shortmaintypename[2]="ct";
$shortmaintypename[3]="ed";
$shortmaintypename[4]="en";
$shortmaintypename[5]="he";
$shortmaintypename[6]="sp";
$shortmaintypename[7]="li";
$subtypename[0]="graphics arts (圖像藝術)";
$subtypename[1]="paintings (繪畫)";
$subtypename[2]="reading & writing (閱讀寫作)";
$subtypename[3]="photography (攝影)";
$subtypename[4]="personal finance (個人理財)";
$subtypename[5]="career (事業)";
$subtypename[6]="employment (求職廣場)";
$subtypename[7]="realty (房地產)";
$subtypename[8]="stocks (股市)";
$subtypename[9]="Internet (互聯網)";
$subtypename[10]="Programming (程式設計)";
$subtypename[11]="PC (個人電腦)";
$subtypename[12]="Mac (蘋果電腦)";
$subtypename[13]="Telecommunication (電子通訊)";
$subtypename[14]="Primary School (小學)";
$subtypename[15]="Secondary School (中學)";
$subtypename[16]="University (大學)";
$subtypename[17]="Training (專業訓練)";
$subtypename[18]="Movies (電影)";
$subtypename[19]="Music (音樂)";
$subtypename[20]="Comics (漫畫)";
$subtypename[21]="Games (游戲)";
$subtypename[22]="Stars (明星)";
$subtypename[23]="healthy living (健康生活)";
$subtypename[24]="exercise & fitness (強身健體)";
$subtypename[25]="soccer (足球)";
$subtypename[26]="basketball (籃球)";
$subtypename[27]="car racing (賽車)";
$subtypename[28]="racing (賽馬)";
$subtypename[29]="bridge (棋牌)";
$subtypename[30]="fashion (時裝)";
$subtypename[31]="cuisine (飲食)";
$subtypename[32]="travel (旅游)";
$subtypename[33]="romance (愛情)";
$shortsubtypename[0]="acga";
$shortsubtypename[1]="acpa";
$shortsubtypename[2]="acrw";
$shortsubtypename[3]="acph";
$shortsubtypename[4]="bmpf";
$shortsubtypename[5]="bmca";
$shortsubtypename[6]="bmem";
$shortsubtypename[7]="bmre";
$shortsubtypename[8]="bmst";
$shortsubtypename[9]="ctin";
$shortsubtypename[10]="ctpr";
$shortsubtypename[11]="ctpc";
$shortsubtypename[12]="ctma";
$shortsubtypename[13]="ctte";
$shortsubtypename[14]="edps";
$shortsubtypename[15]="edss";
$shortsubtypename[16]="edun";
$shortsubtypename[17]="edtr";
$shortsubtypename[18]="enmo";
$shortsubtypename[19]="enmu";
$shortsubtypename[20]="enco";
$shortsubtypename[21]="enga";
$shortsubtypename[22]="enst";
$shortsubtypename[23]="hehl";
$shortsubtypename[24]="heef";
$shortsubtypename[25]="spso";
$shortsubtypename[26]="spgo";
$shortsubtypename[27]="spcr";
$shortsubtypename[28]="sphr";
$shortsubtypename[29]="spmj";
$shortsubtypename[30]="lifa";
$shortsubtypename[31]="licu";
$shortsubtypename[32]="litr";
$shortsubtypename[33]="liro";
$subtypepath[0]="graphics";
$subtypepath[1]="paintings";
$subtypepath[2]="reading";
$subtypepath[3]="photography";
$subtypepath[4]="finance";
$subtypepath[5]="career";
$subtypepath[6]="employment";
$subtypepath[7]="realty";
$subtypepath[8]="stocks";
$subtypepath[9]="internet";
$subtypepath[10]="programming";
$subtypepath[11]="pc";
$subtypepath[12]="mac";
$subtypepath[13]="telecom";
$subtypepath[14]="primaryschool";
$subtypepath[15]="secondaryschool";
$subtypepath[16]="university";
$subtypepath[17]="training";
$subtypepath[18]="movies";
$subtypepath[19]="music";
$subtypepath[20]="comics";
$subtypepath[21]="games";
$subtypepath[22]="stars";
$subtypepath[23]="living";
$subtypepath[24]="fitness";
$subtypepath[25]="soccer";
$subtypepath[26]="golf";
$subtypepath[27]="carracing";
$subtypepath[28]="horse";
$subtypepath[29]="mahjong";
$subtypepath[30]="fashion";
$subtypepath[31]="cuisine";
$subtypepath[32]="travel";
$subtypepath[33]="romance";
?>
<table align="center" border="0" cellPadding="0" cellSpacing="0" width="100%" class="tt3">
<td width="14%" bgcolor="#4e4e82" valign="top"><p align="center"><a href="allview1.php"><font color="CCFFCC">總平均排名</font></a></p>
<? $j=0;
while($j<34){
$p1=strpos($subtypename[$j],"(")+1;
$p2=strrpos($subtypename[$j],")")-1;
?>
<a href="typeview1.php?type=<? echo $shortsubtypename[$j];?>" ><font color="f0f0f0"><? echo substr($subtypename[$j],$p1,$p2);?></font></a><br>
<? $j+=1;
}
?><br></td>
<td width="86%" bgcolor="#666699" valign="top">
<?
//-------------取得站點類型-------------------------
$j=0;
while($j<34){
if (strcmp($shortsubtypename[$j],$type)==0){
$p1=strpos($subtypename[$j],"(")+1;
$p2=strrpos($subtypename[$j],")")-1;
$countresult[6]=substr($subtypename[$j],$p1,$p2);
break;
}
$j+=1;
}
if ($j==34)
$countresult[6]="類別未知";
$newdb=new DB_Sql;
$sqlstr="select t2.username,t2.title,t1.starttime,t1.totalhits,to_days(now())-to_days(starttime) as days, totalhits/(to_days(now())-to_days(starttime)+1) as avghits,t1.sitetype from stat t1,userinfo t2 where t1.uid=t2.uid and t2.ok=1 and t1.sitetype='$type' order by avghits desc limit 0,100";
$newdb->query($sqlstr);
$total_rec_num=$newdb->num_rows();
if ($total_rec_num<=0){?>
<br>
<p align="center"><b><font color="#FFCC00" size="+1">HOME4U分類統計平均名次</font></b></p>
<p align="center"><b><font color="#ffff00" ><? echo $countresult[6];?></font></b></p>
<p></p>
<p align="center">沒有該類別的統計信息</p>
</td></table>
</body>
</html>
<?
die;}
else {
$pg_row_num=25;
if($total_rec_num%$pg_row_num==0)
$max_pg_num=$total_rec_num/$pg_row_num;
else
$max_pg_num=floor($total_rec_num/$pg_row_num)+1;
if(isset($first) or trim($pg)=="" or (int)$pg<1)
$pg=1;
if(isset($last) or (int)$pg>$max_pg_num)
$pg=$max_pg_num;
$pos=$pg_row_num*($pg-1);
$newdb->seek($pos);
?>
<div align="center"><center>
<br>
<p><b><font color="#FFCC00" size="+1">HOME4U分類統計平均名次</font></b></p>
<p><b><font color="#ffff00" ><? echo $countresult[6];?></font></b></p>
<table border="0" width="80%" bgcolor="#f0f0f0" cellspacing="0"
cellpadding="2" class="tt3">
<tr bgcolor="#4e4e82">
<td align="center"><font color="ffffff">名次</font></td>
<td align="left"><font color="ffffff">站點名稱</font></td>
<td align="center"><font color="ffffff">登記時間</font></td>
<td align="right"><font color="f0f0f0">平均人數</font></td>
<td align="right"><font color="ffffff">總人數</font></td>
<td align="right"><font color="ffffff">天數</font></td>
<td align="center"><font color="ffffff">網站類別</font></td>
</tr>
</center></div>
<? $i=0;
while ($newdb->next_record() and $i<$pg_row_num) {
$i=$i+1;
$ii=$pos+$i;
//從username獲得dns 絕對路徑
$username=$newdb->Record["username"];
$url1=substr($username,0,2);
$url2=substr($username,0,4);
$url3=substr($username,4);
$j=0;
while($j<8){
if (strcmp($shortmaintypename[$j],$url1)==0){
$url11=$maintypepath[$j];
break;
}
$j+=1;
}
if ($j<>8){
$k=0;
while($k<34){
if (strcmp($shortsubtypename[$k],$url2)==0){
$url22=$subtypepath[$k];
break;
}
$k+=1;
}
$countresult[1]="http://home4u.china.com/".$url11."/".$url22."/".$url3."/";
}
else
{
$countresult[1]="";}
$countresult[0]=$newdb->Record["title"];
$countresult[2]=substr($newdb->Record["starttime"],0,10);
$countresult[3]=$newdb->Record["totalhits"];
$countresult[5]=$newdb->Record["days"]+1;
$countresult[7]=round($newdb->Record["avghits"]);
if ($countresult[7]==0)
$countresult[7]="小于1人";
?>
<tr>
<td align="center"><? echo $ii;?></td>
<? if ($countresult[1]=="") {?>
<td align="left"><? echo $countresult[0];?></td>
<?}else{?>
<td align="left"><a href=<? echo $countresult[1];?> target="_blank"><? echo $countresult[0];?></a></td>
<?}?>
<td align="center"><? echo $countresult[2];?></td>
<td align="right"><? echo $countresult[7];?> </td>
<td align="right"><? echo $countresult[3];?> </td>
<td align="right"><? echo $countresult[5];?></td>
<td align="center"><? echo $countresult[6];?></td>
</tr>
<?}
?>
</table>
<p>
<table border="0" class="tt3" width="80%" align="center" cellspacing="0" cellpadding="0">
<tr>
<td width="80%" height="60" align="right">
<? $k=0;
while ($k<$max_pg_num-1){
$k1=$k*$pg_row_num+1;
$k2=($k+1)*$pg_row_num;
?>
<a href="typeview1.php?type=<? echo $type;?>&pg=<? echo $k+1;?>">第<? echo $k1;?>-<? echo $k2;?>名</a>
<? $k=$k+1;}
?>
<a href="typeview1.php?type=<? echo $type;?>&pg=<? echo $k+1;?>">第<? echo ($max_pg_num-1)*$pg_row_num+1;?>-<? echo $total_rec_num;?>名</a>
</td>
</tr>
</table>
<?
}?></td></table>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -