⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 picture.php

📁 phpcms网站管理系统  很不错的 有需要的就下载看看八 
💻 PHP
📖 第 1 页 / 共 3 页
字号:
	$pages=phppages($number,$page,$pagesize,$url);
	$query="SELECT * FROM ".TABLE_PICTURE." WHERE status='$status' AND recycle=0 AND channelid='$channelid' $addquery ORDER BY $dordertype LIMIT $offset,$pagesize";
	$result=$db->query($query);
	if($db->num_rows($result)>0)
	{
		while($r=$db->fetch_array($result))
		{
			$p->set_catid($r[catid]);
			$r[url] = $p->get_itemurl($r[pictureid],$r[addtime]);
			$r[caturl] = $p->get_listurl(0);
	        $r[thumb] = $r[thumb] ? (preg_match("/^http:\/\//i",$r[thumb]) ? $r[thumb] : PHPCMS_PATH.$r[thumb]) : PHPCMS_PATH."images/nopic.gif";
			$r[title] = titleformat($r[title],$r[titlefontcolor],$r[titlefonttype],'');
			$r[adddate]=date("Y-m-d",$r[addtime]);
			$r[addtime]=date("Y/md",$r[addtime]);
			$pictures[]=$r;
		}
	}	include admintpl('picture_manage');
break;

//我添加的图片
case 'myitem':

	@extract($db->get_one("SELECT COUNT(*) AS num_3 FROM ".TABLE_PICTURE." WHERE status=3 AND username='$_username' AND recycle=0 AND channelid='$channelid'"));
	@extract($db->get_one("SELECT COUNT(*) AS num_1 FROM ".TABLE_PICTURE." WHERE status=1 AND username='$_username' AND recycle=0 AND channelid='$channelid'"));
	@extract($db->get_one("SELECT COUNT(*) AS num_0 FROM ".TABLE_PICTURE." WHERE status=0 AND username='$_username' AND recycle=0 AND channelid='$channelid'"));
	@extract($db->get_one("SELECT COUNT(*) AS num_2 FROM ".TABLE_PICTURE." WHERE status=2 AND username='$_username' AND recycle=0 AND channelid='$channelid'"));

    $status = isset($status) ? $status : 3;
	$referer=urlencode("?mod=picture&file=picture&action=mypicture&channelid=".$channelid."&catid=".$catid."&status=".$status."&keyword=".$keyword."&ontop=".$ontop."&elite=".$elite."&ordertype=".$ordertype."&srchtype=".$srchtype."&page=".$page."&username=".$_username);
	$catid=$catid ? $catid : 0;
	$thecatid=$catid;
	if(!$page)
	{
		$page=1;
		$offset=0;
	}
	else
	{
		$offset=($page-1)*$pagesize;
	}

	$query="SELECT COUNT(*) as num FROM ".TABLE_PICTURE." WHERE username='$_username' and status='$status' AND recycle=0 AND channelid='$channelid' $addquery";
	$result=$db->query($query);
	$r=$db->fetch_array($result);
	$number=$r["num"];
	$url="?mod=picture&file=picture&action=mypicture&channelid=".$channelid."&catid=".$catid."&status=".$status."&keyword=".$keyword."&ontop=".$ontop."&elite=".$elite."&ordertype=".$ordertype."&srchtype=".$srchtype."&page=".$page."&username=".$_username;
	$pages=phppages($number,$page,$pagesize,$url);
	$query="SELECT * FROM ".TABLE_PICTURE." WHERE username='$_username' and status='$status' AND recycle=0 AND channelid='$channelid' $addquery ORDER BY $dordertype LIMIT $offset,$pagesize";
	$result=$db->query($query);
	if($db->num_rows($result)>0)
	{
		while($r=$db->fetch_array($result))
		{
			$p->set_catid($r[catid]);
			$r[url] = $p->get_itemurl($r[pictureid],$r[addtime]);
			$r[caturl] = $p->get_listurl(0);
	        $r[thumb] = $r[thumb] ? (preg_match("/^http:\/\//i",$r[thumb]) ? $r[thumb] : PHPCMS_PATH.$r[thumb]) : PHPCMS_PATH."images/nopic.gif";
			$r[title] = titleformat($r[title],$r[titlefontcolor],$r[titlefonttype],'');
			$r[adddate]=date("Y-m-d",$r[addtime]);
			$r[addtime]=date("Y/md",$r[addtime]);
			$pictures[]=$r;
		}
	}
	include admintpl('picture_myitem');

break;

//图片审核管理
case 'check':
	$referer=urlencode("?mod=".$mod."&file=".$file."&action=check&channelid=".$channelid."&catid=".$catid."&srchtype=".$srchtype."&keywords=".$keywords."&ordertype=".$ordertype."&page=".$page);
	if(!$page)
	{
		$page=1;
		$offset=0;
	}
	else
	{
		$offset=($page-1)*$pagesize;
	}

	$query="SELECT COUNT(*) AS num FROM ".TABLE_PICTURE." WHERE status=1 AND recycle=0 AND channelid='$channelid' $addquery";
	$result=$db->query($query);
	$r=$db->fetch_array($result);
	$number=$r["num"];
	$url="?mod=".$mod."&file=".$file."&action=check&channelid=".$channelid."&catid=".$catid."&srchtype=".$srchtype."&keyword=".$keyword."&ordertype=".$ordertype."&page=".$page;
	$pages=phppages($number,$page,$pagesize,$url);
	$query="SELECT * FROM ".TABLE_PICTURE." WHERE status=1 AND recycle=0 AND channelid='$channelid' $addquery ORDER BY $dordertype LIMIT $offset,$pagesize";
	$result=$db->query($query);
	if($db->num_rows($result)>0)
	{
		while($r=$db->fetch_array($result))
		{
			$p->set_catid($r[catid]);
			$r[url] = $p->get_itemurl($r[pictureid],$r[addtime]);
			$r[caturl] = $p->get_listurl(0);
	        $r[thumb] = $r[thumb] ? (preg_match("/^http:\/\//i",$r[thumb]) ? $r[thumb] : PHPCMS_PATH.$r[thumb]) : PHPCMS_PATH."images/nopic.gif";
			$r[title] = titleformat($r[title],$r[titlefontcolor],$r[titlefonttype],'');
			$r[adddate]=date("Y-m-d",$r[addtime]);
			$r[addtime]=date("Y/md",$r[addtime]);
			$pictures[]=$r;
		}
	}	include admintpl('picture_check');

break;

case 'special':
	$referer=urlencode('?mod='.$mod.'&file='.$file.'&action=special&channelid='.$channelid.'&specialid='.$specialid.'&srchtype='.$srchtype.'&keyword='.$keyword.'&ontop='.$ontop.'&elite='.$elite.'&ordertype='.$ordertype.'&page='.$page);
	if(!$page)
	{
		$page=1;
		$offset=0;
	}
	else
	{
		$offset=($page-1)*$pagesize;
	}

	if(!empty($keywords))
	{
		$keyword=str_replace(' ','%',$keywords);
		$keyword=str_replace('*','%',$keyword);
		switch($srchtype)
		{
		case '0':
				$addquery=" AND title LIKE '%$keyword%' ";
		break;
		case '1':
				$addquery=" AND content LIKE '%$keyword%' ";
		break;
		case '2':
				$addquery=" AND author LIKE '%$keyword%' ";
		break;
		case '3':
				$addquery=" AND username LIKE '%$keyword%' ";
		break;
		default :
				$addquery=" AND (title LIKE '%$keyword%' or titleintact LIKE '%$keyword%' or subheading LIKE '%$keyword%') ";
		}
	}

	$addquery .= $specialid ? " AND specialid=$specialid " : "";
	$addquery .= $elite ? " AND elite=1 " : "";
	$addquery .= $ontop ? " AND ontop=1 " : "";
	$addquery .= $time ? sql_time($time) : "";
	switch($ordertype)
	{
		case 1:
			$dordertype=" pictureid DESC ";
		break;
		case 2:
			$dordertype=" pictureid ";
		break;
		case 3:
			$dordertype=" hits DESC ";
		break;
		case 4:
			$dordertype=" hits ";
		break;
		default :
			$dordertype=" pictureid DESC ";
	}
	$r = $db->get_one("SELECT COUNT(*) AS num FROM ".TABLE_PICTURE." a WHERE status=3 AND recycle=0 AND specialid>0 AND channelid='$channelid' $addquery");
	$number=$r["num"];
	$url="?mod=".$mod."&file=".$file."&action=special&channelid=".$channelid."&catid=".$catid."&specialid=".$specialid."&srchtype=".$srchtype."&keyword=".$keyword."&ontop=".$ontop."&elite=".$elite."&ordertype=".$ordertype."&page=".$page;
	$pages=phppages($number,$page,$pagesize,$url);
	$result=$db->query("SELECT * FROM ".TABLE_PICTURE." WHERE status=3 AND recycle=0 AND specialid>0 AND channelid='$channelid' $addquery ORDER BY $dordertype LIMIT $offset,$pagesize");
	while($r=$db->fetch_array($result))
	{
	    $s = $db->get_one("SELECT specialid,specialname,addtime FROM ".TABLE_SPECIAL." a WHERE specialid=$r[specialid]");
		$p->set_catid($r[catid]);
		$r[url] = $p->get_itemurl($r[pictureid],$r[addtime]);
		$r[specialname] = wordscut($s[specialname],24,1);
		$r[specialurl] = $p->get_specialitemurl($s[specialid],$s[addtime]);
		$r[title] = titleformat($r[title],$r[titlefontcolor],$r[titlefonttype],$r[includepic]);
		$r[adddate]=date("Y-m-d",$r[addtime]);
		$pictures[]=$r;
	}
	$special_list = special_select($channelid,'specialid','请选择专题',$specialid);
	$special_select = special_select($channelid,'jump','请选择专题进行管理',$specialid,'onchange="if(this.options[this.selectedIndex].value!=\'\'){location=\'?mod='.$mod.'&file='.$file.'&action=special&channelid='.$channelid.'&specialid=\'+this.options[this.selectedIndex].value;}"');
	include admintpl('picture_special');
break;

case 'sendback':

	if($submit)
	{
		if(empty($pictureid))
		{
			showmessage('非法参数!请返回!');
		}
		if($ifpm)
		{
			if(empty($title))
			{
				showmessage('对不起,标题不能为空!请返回!');
			}
			if(empty($content))
			{
				showmessage('对不起,内容不能为空!请返回!');
			}
			sendpm($username,$title,$content);
		}
		if($ifemail)
		{
			sendusermail($username,$title,$content);
		}
		$db->query("UPDATE ".TABLE_PICTURE." SET status=2,elite=0,ontop=0 WHERE pictureid='$pictureid' AND channelid='$channelid'");
		showmessage('操作成功!',$referer);

	}
	else
	{
		if(empty($pictureid))
		{
			showmessage('非法参数!请返回!');
		}
		$result=$db->query("SELECT title,catid,username,status FROM ".TABLE_PICTURE." WHERE pictureid='$pictureid' AND channelid='$channelid'");
		if($db->num_rows($result)>0)
		{
			$picture=$db->fetch_array($result);
			if($picture[status]!=1)
			{
				showmessage('无法进行此操作!请返回!');
			}
		}
		else
		{
			showmessage('图片不存在!请返回!');
		}
		include admintpl('picture_sendback');
	}
break;

case 'send':

	if(empty($pictureid))
	{
		showmessage('非法参数!请返回!');
	}
	
	$result=$db->query("SELECT status FROM ".TABLE_PICTURE." WHERE pictureid='$pictureid' AND channelid='$channelid'");
	if($db->num_rows($result)>0)
	{
		$picture=$db->fetch_array($result);
		if(($picture[status]!=2) && ($picture[status]!=0))
		{
			showmessage('无法进行此操作!请返回!');
		}
		else
		{
			$db->query("UPDATE ".TABLE_PICTURE." SET status=1 WHERE pictureid='$pictureid' AND channelid='$channelid'");
			showmessage('操作成功!',$referer);
		}
	}
	else
	{
		showmessage('图片不存在!请返回!',$referer);
	}
break;

//移动图片
case 'move':
	if($submit)
	{
		$specialid = intval($specialid);
		$targetcatid = intval($targetcatid);
		if(!$specialid && !$targetcatid) showmessage('非法参数!请返回!');
		if($targetcatid && $_CAT[$catid][child] && !$_CAT[$targetcatid]['enableadd']) showmessage('指定栏目不允许添加文章!请返回!');

		if($movetype==1)
		{
			if(empty($pictureid)) showmessage('非法参数!请返回!');
			$pictureids=is_array($pictureid) ? implode(',',$pictureid) : $pictureid;
			if($specialid) $db->query("UPDATE ".TABLE_PICTURE." SET specialid='$specialid' WHERE pictureid IN ($pictureids) AND status=3 AND channelid='$channelid' ");
			if($targetcatid) $db->query("UPDATE ".TABLE_PICTURE." SET catid='$targetcatid' WHERE pictureid IN ($pictureids) AND status=3 AND channelid='$channelid' ");
		}
		else
		{
			if(empty($batchcatid)) showmessage('非法参数!请返回!');
			$batchcatids=implode(",",$batchcatid);
			if($specialid) $db->query("UPDATE ".TABLE_PICTURE." SET specialid='$specialid' WHERE catid IN ($batchcatids) AND status=3 AND channelid='$channelid' ");
			if($targetcatid) $db->query("UPDATE ".TABLE_PICTURE." SET catid='$targetcatid' WHERE catid IN ($batchcatids) AND status=3 AND channelid='$channelid' ");
		}
		showmessage('操作成功!',$referer);
	}
	else
	{
		$referer=urlencode('?mod='.$mod.'&file='.$file.'&action=move&channelid='.$channelid);
		$pictureid=is_array($pictureid) ? implode(',',$pictureid) : $pictureid;
		$special_select = special_select($channelid,'specialid','请选择专题',$specialid);
		include admintpl('picture_move');
	}
break;

//回收站管理
case 'recycle':

	@extract($db->get_one("SELECT COUNT(*) AS num_3 FROM ".TABLE_PICTURE." WHERE status=3 AND username='$_username' AND recycle=1 AND channelid='$channelid'"));
	@extract($db->get_one("SELECT COUNT(*) AS num_1 FROM ".TABLE_PICTURE." WHERE status=1 AND username='$_username' AND recycle=1 AND channelid='$channelid'"));

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -