source/admin/comment.ctrl.php

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php
class commentControl extends skymvc{
	
	public function __construct(){
		parent::__construct();
	}
	
	public function onDefault(){
		$tablename=get_post("tablename","h");
		if(empty($tablename)){
			$tablename="article";
		} 
		$tableComment=$tablename."_comment";
		$where=" status in(0,1,2)";
		$type=get("type","h");
		$type_name="全部评论";
		switch($type){
			case "new":
				$where=" status=0 ";
				$type_name="待审评论";
				break;
			case "pass":
				$where=" status=1 ";
				$type_name="上架评论";
				break;
			case "forbid":
				$where=" status=2 ";
				$type_name="下架评论";
				break;
			default:
				break;
			
		} 
		$start=get("per_page","i");
		$limit=24;
		$url="/admin.php?m=comment&type=".$type."&tablename=".$tablename;
		
		$option=array(
			"where"=>$where,
			"start"=>$start,
			"limit"=>$limit,
			"order"=>"id ASC"
		);
		$rscount=true;
		$data=M($tableComment)->select($option,$rscount);
		if($data){
			foreach($data as $v){
				$uids[]=$v['userid'];
			}
			$us=M("user")->getUserByIds($uids);
			foreach($data as $k=>$v){
				$v['nickname']=$us[$v['userid']]['nickname'];
				$v['user_head']=images_site($us[$v['userid']]['user_head']);
				$v['timeago']=timeago(strtotime($v['createtime']));
				$data[$k]=$v;
			}
		}
		$this->smarty->goAssign(array(
			"data"=>$data,
			"type"=>$type,
后面还有 39 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。