程序安装简便容易

源代码在线查看: article_check.php

软件大小: 461 K
上传用户: maryyxl
关键词: 程序安装
下载地址: 免注册下载 普通下载 VIP

相关代码

								!$_SERVER['PHP_SELF'] && $_SERVER['PHP_SELF']=$_SERVER['SCRIPT_NAME'];
				substr($_SERVER['PHP_SELF'],-9,-4)!=='admin' && exit('Forbidden');
				
				include_once(R_P.'cache/set.php');
				
				$query=query("SELECT * FROM duoxun_sort ORDER BY vieworder ASC,sid ASC");
				while($rs=fetch_array($query)) {
					$sortdb[]=$rs;
				}
				
				$s_sid=empty($_GET['sort']) ? 'all' : $_GET['sort'];
				$all_selected=$s_sid=='all' ? ' selected' : '';
				$perpage=empty($_GET['perpage']) ? 35 : $_GET['perpage'];
				
				$sql=$s_sid=='all' ? "SELECT COUNT(*) AS count FROM duoxun_subject WHERE ifshow=0" : "SELECT COUNT(*) AS count FROM duoxun_subject WHERE sid=$s_sid AND ifshow=0";
				$rs=get_one($sql);
				$num=$rs['count'];
				$pages=ceil($num/$perpage);
				
				if(empty($_GET['page']) || $_GET['page']					$page=1;
					$start=0;
				} elseif($_GET['page']>$pages) {
					$page=$pages;
					$start=($page-1)*$perpage;
				} else {
					$page=$_GET['page'];
					$start=($page-1)*$perpage;
				}
				
				$sql=$s_sid=='all' ? "SELECT * FROM duoxun_subject WHERE ifshow=0 ORDER BY postdate DESC,aid DESC LIMIT $start,$perpage" : "SELECT * FROM duoxun_subject WHERE sid=$s_sid AND ifshow=0 ORDER BY postdate DESC,aid DESC LIMIT $start,$perpage";
				$query=query($sql);
				while($rs=fetch_array($query)) {
					$catedb[]=$rs;
				}
				
				$mpurl="admin.php?job=article_check&sort=$s_sid&perpage=$perpage";
				$fenye=admin_fenye($num,$perpage,$page,$mpurl,0);
				
				$s_num=!empty($catedb) ? count($catedb) : 0;
				
				if($s_sid=='all') {
					$s_name='全部待审核文章';
					$s_out='总共有'.$s_num.'条主题文章待审核';
				} else {
					$rs=get_one("SELECT name FROM duoxun_sort WHERE sid=$s_sid");
					$s_name=$rs['name'];
					$s_out='分类'.$s_name.'现有'.$s_num.'条主题文章待审核';
				}
				
				if(!empty($_GET['do'])) {
					if($_GET['do']=='show') {
						$sort=$_POST['sort'];
						$perpage=$_POST['perpage'];
						echo "";
						exit;
					} elseif($_GET['do']=='pass') {
						$aid=$_GET['id'];
						$query=query("UPDATE duoxun_subject SET ifshow='1' WHERE aid='$aid'");
						if($query) {
							echo "alert(\"通过审核操作成功!\")";
							echo "";			
							exit;
						} else {
							echo "alert(\"通过审核操作失败!请重试!\")";
							echo "";			
							exit;
						}
					} elseif($_GET['do']=='del') {
						$aid=$_GET['id'];
						query("DELETE FROM duoxun_subject WHERE aid=$aid");
						query("DELETE FROM duoxun_content WHERE aid=$aid");
						query("DELETE FROM duoxun_comment WHERE aid=$aid");
						echo "alert(\"删除成功!\")";
						echo "";			
						exit;
					} elseif($_GET['do']=='admin') {
						if(!empty($_POST['action']) && !empty($_POST['aids'])) {
							if($_POST['action']=='pass') {
								foreach($_POST['aids'] as $aid) {
									query("UPDATE duoxun_subject SET ifshow='1' WHERE aid='$aid'");
								}
								echo "alert(\"操作成功!\")";
								echo "";			
								exit;
							} elseif($_POST['action']=='del') {
								foreach($_POST['aids'] as $aid) {
									query("DELETE FROM duoxun_subject WHERE aid=$aid");
									query("DELETE FROM duoxun_content WHERE aid=$aid");
									query("DELETE FROM duoxun_comment WHERE aid=$aid");
								}
								echo "alert(\"删除成功!\")";
								echo "";			
								exit;
							}
						}
					} elseif($_GET['do']=='check') {
						$aid=$_GET['id'];
						
						$subject=get_one("SELECT * FROM duoxun_subject WHERE aid=$aid");
						  $select_color_a=$subject['title_color']=='White' ? ' selected' : '';
						  $select_color_b=$subject['title_color']=='Black' ? ' selected' : '';
						  $select_color_c=$subject['title_color']=='Red' ? ' selected' : '';
						  $select_color_d=$subject['title_color']=='Yellow' ? ' selected' : '';
						  $select_color_e=$subject['title_color']=='Pink' ? ' selected' : '';
						  $select_color_f=$subject['title_color']=='Green' ? ' selected' : '';
						  $select_color_g=$subject['title_color']=='Orange' ? ' selected' : '';
						  $select_color_h=$subject['title_color']=='Purple' ? ' selected' : '';
						  $select_color_i=$subject['title_color']=='Blue' ? ' selected' : '';
						  $select_color_j=$subject['title_color']=='Beige' ? ' selected' : '';
						  $select_color_k=$subject['title_color']=='Brown' ? ' selected' : '';
						  $select_color_l=$subject['title_color']=='Teal' ? ' selected' : '';
						  $select_color_m=$subject['title_color']=='Navy' ? ' selected' : '';
						  $select_color_n=$subject['title_color']=='Maroon' ? ' selected' : '';
						  $select_color_o=$subject['title_color']=='LimeGreen' ? ' selected' : '';
				
						  $select_extra_a=$subject['title_extra']=='b' ? ' selected' : '';
						  $select_extra_b=$subject['title_extra']=='i' ? ' selected' : '';
						  $select_extra_c=$subject['title_extra']=='u' ? ' selected' : '';
				
						  $select_comment_a=$subject['ifcommect']==1 ? ' checked' : '';
						  $select_comment_b=$subject['ifcommect']==0 ? ' checked' : '';
				
						  $select_commect_check_a=$subject['commect_check']==1 ? ' checked' : '';
						  $select_commect_check_b=$subject['commect_check']==0 ? ' checked' : '';
						  
				
						$query=query("SELECT * FROM duoxun_content WHERE aid=$aid ORDER BY pid ASC");
						while($rs=fetch_array($query)) {
							$contentdb[]=$rs;
						}
				
						$pid=$contentdb[0]['pid'];		
						$pid=empty($_GET['pid']) ? $pid : $_GET['pid'];
						$pid_num=!empty($contentdb) ? count($contentdb) : 0;
						for($i=0;$i							if($contentdb[$i]['pid']==$pid) {
								$pid_p=$i;
								$pid_pid=$i+1;
							}
						}			
					} elseif($_GET['do']=='change') {
						$aid=$_POST['aid'];
						$pid=$_POST['pid'];
						$subject=$_POST['subject'];
						$title_color=$_POST['title_color'];
						$title_extra=$_POST['title_extra'];
						$sid=$_POST['sid'];
						$topped=$_POST['topped'];
						$ifcommect=$_POST['ifcommect'];
						$commect_check=$_POST['commect_check'];
						$content=$_POST['content'];
						query("UPDATE duoxun_subject SET subject='$subject',title_color='$title_color',title_extra='$title_extra',sid='$sid',topped='$topped',ifcommect='$ifcommect',commect_check='$commect_check' WHERE aid='$aid'");
						query("UPDATE duoxun_content SET content='$content' WHERE aid='$aid' AND pid='$pid'");
						echo "alert(\"修改成功!\")";
						echo "";
						exit;
					}
				}
				
				require_once template('article_check','admin');
				
				?>			

相关资源