[code]
<?
@include DISCUZ_ROOT.'./forumdata/cache/cache_plugins.php';
$downcfg = getconfig('download');
$downinfo = $_DCACHE['plugins'][$p];
$navtitle = $downinfo['plug_title'];
$discuz_action = 235;
switch($acti) {
default:
break;
case 'softlist':
include "./plugins/download/softlist.php";
break;
case 'softview':
include "./plugins/download/softview.php";
break;
case 'getdown':
include "./plugins/download/getdown.php";
break;
case 'softadd':
include "./plugins/download/softadd.php";
break;
case 'softedit':
include "./plugins/download/softedit.php";
break;
case 'softmy':
include "./plugins/download/softmy.php";
break;
}
if(trim($acti)==''){
$query = $db->query("SELECT * FROM cdb_dsort ORDER BY idder");
$sortlist="<a href='plugins.php?p=download&acti=softlist'>全部软件</a>";
$brer=-1;
while($dsort=$db->fetch_array($query)){
$sortlist.=' - <a href="plugins.php?p=download&acti=softlist&sort='.$dsort['id'].'">'.$dsort['sort'].'</a>';
$brer++;
if($brer==$downcfg['titlenum']-1){
$brer=-1;
$sortlist.="<Br>";
}
}
//用户信息
$d_guset=$downcfg['ggetdown']==0?'':'及<font color=red>游客</font>';
$newall="<a href='plugins.php?p=download&acti=softlist'>更多软件…</a>";
$downall="<a href='plugins.php?p=download&acti=softlist&lister=downcount'>更多软件…</a>";
if($discuz_user){
$quest=0;
$query = $db->query("SELECT username, money, avatar, credit, putsum, audsum, groomsum, delesum FROM $table_members WHERE username='$discuz_user'");
while($duser=$db->fetch_array($query)){
$duseravatar = $duser['avatar'] ? image($duser['avatar']) : "<img border='0' src='images/download/noavatar.gif'>";
$dusername = $duser['username'];
$duserput = $duser['putsum'];
$duseraud = $duser['audsum'];
$dusergroom = $duser['groomsum'];
$dusercredit = $duser['credit'];
$dusermoney = $duser['money'];
}
}
else{
$quest=1;
}
//最新软件列表
$query = $db->query("SELECT id, name, downcount, auddate, putname FROM cdb_dsoft WHERE audit=1 ORDER BY id DESC LIMIT $downcfg[newtop]");
while($newlist=$db->fetch_array($query)){
$newlist['name']=strlen($newlist['name']) <21 ?substr(substr($newlist['name'],0,21),0,19):substr(substr($newlist['name'],0,18),0,17).".…";
$newloop[]=$newlist;
}
//下载排行列表
$query = $db->query("SELECT id, name, auddate, downcount, putname FROM cdb_dsoft WHERE audit=1 ORDER BY downcount DESC LIMIT $downcfg[ddtop]");
while($ddlist=$db->fetch_array($query)){
$ddlist['name']=strlen($ddlist['name']) <21 ?substr(substr($ddlist['name'],0,21),0,19):substr(substr($ddlist['name'],0,18),0,17).".…";
$ddloop[]=$ddlist;
}
//推荐软件产生列表
$lisql=$downcfg['homegr'];
$query = $db->query("SELECT id, name, sort, picture, putname FROM cdb_dsoft WHERE groom='1' ORDER BY id DESC LIMIT $lisql");
$i=0;
while($dsoft=$db->fetch_array($query)){
$dsoft['name']=strlen($dsoft['name']) <20 ?substr($dsoft['name'],0,20):substr($dsoft['name'],0,18)."…";
$dsoft['picture']=$dsoft['picture']==''?'<img border=0 src="images/download/download.jpg">':'<img border=0 src="'.$dsoft['picture'].'" width=120 height=120>';
$i++;
$grtable1.='<td align="center"><a href="plugins.php?p=download&acti=softview&softid='.$dsoft[id].'">'.$dsoft[picture].'</a>
<br>发布者:<a href="viewpro.php?username='.$dsoft[putname].'">'.$dsoft[putname].'</a>
<br><a href="plugins.php?p=download&acti=softview&softid='.$dsoft[id].'">'.$dsoft[name].'</a></td>';
}
$grtable='<marquee id="scrolltext" onmouseover=this.stop() onmouseout=this.start() scrollAmount=2 scrollDelay=50 width="100%" height="100%" direction="left" behavior="alternate"><table border="0" width="'.(($i*130)+50).'" cellpadding="0" cellspacing="0"><tr height="130"><td width="25"></td>';
$grtable=$grtable.$grtable1.'<td width="25"></td></tr></table></marquee>';
include template('download');
}
?>
[code]
plugins/download.php |