📄 main.php
字号:
<?php
class CModule extends CUserApp
{
function execute()
{
$this->showMain();
}
function showClass()
{
$aCategory = new CCategory;
$aClass = new CClass;
$aCategory->open();
$aClass->open();
$box_title = "分类信息";
if(!$aCategory->moveFirst()) exit;
for($i = 0; $i < $aCategory->getRecordCount(); $i ++)
{
$id = $aCategory->getAbsolutePosition();
$posList = $aClass->FilterByCategory($id);
for($j = 0; $j < count($posList); $j ++)
{
$aClass->setAbsolutePosition($posList[$j]);
$classList .= "<a href=index.php?modules=list&categoryid=$id&classid={$posList[$j]}>$aClass->class_name</a> ";
}
eval ("\$classInfo .= \"".$this->getTemplate("mainClassBody")."\";");
$aCategory->moveNext();
$classList = "";
}
$aCategory->close();
$aClass->close();
eval ("\$result .= \"".$this->getTemplate("mainClass")."\";");
return $result;
}
function showNew($categoryid, $classid)
{
$aSoft = new CSoft;
$aSoft->open();
$aClass = new CClass;
$aClass->open();
$posList = $aSoft->FilterByClass($categoryid, $classid, "1", $this->set[listnumNew]);
$box_title = "最新下载[{$this->set[listnumNew]}]";
for($i = 0; $i < count($posList); $i ++)
{
$id = $posList[$i];
$aSoft->setAbsolutePosition($id);
//取小类名
$aClass->find($aSoft->class_id);
$type2 = $aClass->class_name;
$sort1id = $aClass->class_category_id;
$updatetime = date($this->set[dateformat], $aSoft->updatetime);
$name = $this->strCat($aSoft->name);
$str = "[<a href = index.php?modules=list&categoryid=$aSoft->category_id&classid=$aSoft->class_id>$type2</a>] ";
$box_content .= $str."<a href=index.php?modules=show&id=$id target = _blank title={$aSoft->name}>$name</a>(<font color = red>$updatetime</font>)<br>";
}
$aClass->close();
$aSoft->close();
$box_right = "<a href=index.php?modules=list><img src={$this->tplPath}/images/more.gif border=0></a>";
eval ("\$new .= \"".$this->getTemplate("box")."\";");
return $new;
}
function showMain()
{
$header = $this->Header("首页");
$downtop = $this->showDownTop("", "");
$new = $this->showNew("", "");
$comment = $this->showComment("", "");
$classinfo = $this->showClass();
$sysinfo = $this->getDownInfo();
$announcement = $this->getAnnouncement();
$banner = $this->printBanner($this->input[categoryid], $this->input[classid], "index.php?modules=list");
eval("\$this->output(\"".$this->getTemplate("main")."\");");
}
function getDownInfo()
{
$aSoft = new CSoft;
$aSoft->open();
$num = $aSoft->getRecordCount();
$flag = $aSoft->moveFirst();
$now_time=date("m").date("d");
$todayUpdate = 0;
$todayDown = 0;
$totalDown = 0;
$totalView = 0;
while($flag)
{
if ($now_time == $aSoft->lastdowntime) $todayDown += $aSoft->daydowntimes;
if(date($this->set[dateformat], $aSoft->updatetime) == date($this->set[dateformat], time())) $todayUpdate++;
$totalDown += $aSoft->downnum;
$totalView += $aSoft->viewnum;
$flag = $aSoft->moveNext();
}
$aSoft->close();
$box_title = "系统信息";
$box_content .= "管理信箱:<a href = mailto:{$this->set[mgrEmail]}>{$this->set[mgrEmail]}</a><br>";
$box_content .= "软件总数:{$num}个<br>";
$box_content .= "今日更新数量:{$todayUpdate}个<br>";
$box_content .= "今日下载软件:{$todayDown}个<br>";
$box_content .= "总共下载软件:{$totalDown}个<br>";
$box_content .= "总共查看次数:{$totalView}次<br>";
$box_content .= "当前模板:{$this->set[tplMode]}<br>";
$now_time = date($this->set[dateformat], time());
$box_content .= "此统计于:{$now_time}";
eval ("\$sysinfo .= \"".$this->getTemplate("box")."\";");
return $sysinfo;
}
function getAnnouncement ()
{
$box_title = "最新消息";
$box_content = $this->set[Announcement ];
eval ("\$result .= \"".$this->getTemplate("box")."\";");
return $result;
}
} //end class
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -