<? 
require("datafile/config.php"); 
require("datafile/style.php");
require("global.php");
require("header.php");
if (empty($page)) $page=1;
navi_bar('论坛发贴排行榜','','no');
?> 
<table width="50%" border="0" cellspacing="0" cellpadding="0" align="center"> 
<tr align="center"> 
</tr> 
</table> 
<table width="50%" border="0" cellspacing="0" cellpadding="0" bordercolor="<? echo $color2; ?>" align="center"> 
<tr align="center"> 
<td><b>论坛发贴排行榜</b></td> 
</tr> 
</table> 
<table width="75%" border="0" cellspacing="0" cellpadding="0" align="center"> 
<tr> 
<td> </td> 
</tr> 
</table> 
<table width=500 align="center" cellspacing=0 cellpadding=1> 
<tr><td> 
<table width="100%" border="0" cellspacing="1" cellpadding="1" bordercolor="<? echo $color2; ?>" align="center"> 
<tr> 
<td colspan=3><b><font face="Verdana, Arial, Helvetica, sans-serif">Top Users</font></b></td> 
</tr> 
<tr><td colspan=3> </td></tr> 
<?php 
$dh=opendir("$id_unique/"); 
while ($userfile=readdir($dh)) { 
if (($userfile!=".") && ($userfile!="..") && ($userfile!="") && !strpos($userfile,".msg") && !strpos($userfile,".old")) { 
$user_info_str=file("$id_unique/".$userfile); 
$user_info=explode("|",$user_info_str[0]); 
if (empty($user_info[12])) $user_info=0; 
$rank_array[$user_info[0]]=$user_info[12]; 


closedir($dh); 
arsort($rank_array); 
reset($rank_array); 
for ($counter=1; $counter<=25; $counter++) { //那个10代表前10,可以自己修改~
$key=key($rank_array); 
if ($counter==1) $maxpoint=$rank_array[$key]; 
$img_width=300*($rank_array[$key])/($maxpoint); 
echo '<tr>'; 
echo '<td>'.$key.'</td>'; 
echo '<td>发表文章数:'.$rank_array[$key].'</td>'; 
echo '<td><img src="http://wayou.51.net/bar1.gif" width='.$img_width.' height=10></td>'; )echo '</tr>'; 
if (!(next($rank_array))) break; 

?> 
<tr><td colspan=3> </td></tr> 
<tr> 
<td colspan=3><center><input type="button" value="论坛首页" 
onClick="location.href='index.php'" 
style="color: #000000; background-color: #f3f3f3; border-style: solid; border-width: 1" onMouseOver ="this.style.backgroundColor='#FFFFFF'" onMouseOut ="this.style.backgroundColor='#f3f3f3'"> 
<input type="button" value="返回前页" 
onClick="location.href='javascript:history.back(1)';" 
style="color: #000000; background-color: #f3f3f3; border-style: solid; border-width: 1" onMouseOver ="this.style.backgroundColor='#FFFFFF'" onMouseOut ="this.style.backgroundColor='#f3f3f3'"></center></td> 
</tr> 
</table> 
</td></tr></table><br> 
<table width=100% border=0 cellspacing=0 cellpadding=1><tr bgcolor=636385><td colspan=2><font color=FFFFFF face=Verdana><center>&nbsp;&copy;版权所有
</body> 
</html>

解决方案 »

  1.   

    提示就是答案Permission denied 英文译:允许拒绝
    也就是没有读写该目录文件的权限
    建议你:1/看是否存在此目录文件,
            2/如存在将其修改一下权限.
      

  2.   

    怎样修改权限呢
    我的是win2000
    好象没有什么权限的吧
      

  3.   

    $id_unique 是从哪里来的啊?是页面参数吗?"f:/phpworks/bbs6/datafile"这种写法肯定是不行的,这是 windows 系统作为 PC 系统的文件路径,而不是 Web Server 上文件的路径Web Server 的文件定位是以你设置的站点根目录为根的,绝对不能有 "c:" 之类的东西假如你的 Web 根目录是 "f:/phpworks"
    (在 Apache 的 httpd.conf 里设 DocumentRoot )
    那么上面的文件路径应该是 "/bbs6/datafile"而且,为防止上传到服务器后出现权限问题,最好用相对路径,最好用 unix 的文件名格式(用 / 不要用 \ ),例如:./datafile  当前目录下的 datafile 文件
    ../datafile  上级目录下的 datafile 文件
    (你用的是 Apache 吧,如果不是,上面的作废)