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

📄 job.php

📁 php论坛源码论坛软件系统亦称电子公告板(BBS)系统
💻 PHP
字号:
<?php
!function_exists("readover") && die("Forbidden");
define('AJAX','1');
require_once(R_P.'require/ajaxfunc.php');
header("Content-Type: text/html;charset=utf-8");
ob_end_clean();
$db_obstart == 1 && function_exists('ob_gzhandler') ? ob_start('ob_gzhandler') : ob_start();
InitGP(array('did','aid'));
$did=(int)$did;
$aid=(int)$aid;
if ($action == "obverse"){
	InitGP(array('pid'),P);
	$pid=(int)$pid;
	if(empty($winduid)){
		Showmsg('not_login');
	}
	$votes=$msg='';
	if($pid==1){
		$votes	= 'obvote=obvote+1';
		$msg	= 'debate_obverse';
	}elseif($pid==2){
		$votes	= 'revote=revote+1';
		$msg	= 'debate_revote';
	}
	$rt=$db->get_one("SELECT voteuid FROM pw_debatethreads WHERE did='$did'");
	if(strpos(",$rt[voteuid],",",$winduid,")===false){
		$voteuid=$rt['voteuid'];
		$voteuid.=$voteuid ? ",$winduid" : $winduid;
		$db->update("UPDATE pw_debatethreads SET voteuid='$voteuid',$votes WHERE did = '$did'");
		Showmsg($msg);
	}else{
		Showmsg('debate_voted');
	}
} elseif ($action == "del"){
	!$winduid && Showmsg('not_login');
	$where=!$admincheck ? "AND authorid='$winduid'" : '';
	$rt=$db->get_one("SELECT aid,authorid FROM pw_debatereplys  WHERE aid='$aid' $where");
	!$rt && Showmsg('delreply_error');

	require_once(R_P."require/credit.php");
	UserCredit($winduid,$debate_replytype,'set',"-$debate_replymoney");

	$db->update("DELETE FROM pw_debatereplys WHERE aid='$aid' $where");
	Showmsg('debate_reply_del');
} elseif ($action == "agree"){	
	if(empty($winduid)){
		Showmsg('not_login');
	}
	if($aid){
		$dd=GetCookie($winduid.$aid."_vote");
		if($dd){
			Showmsg('debate_voted');
		}else{
			$db->update("UPDATE pw_debatereplys SET vote=vote+1 WHERE aid='$aid'");
			cookie($winduid.$aid."_vote",$onlineip);			
			Showmsg('debate_vote');
		}
	}
} elseif ($action == "modify"){
	InitGP(array('title','content'),P,1);
	$title	 = Char_cv($title);
	$content = Char_cv($content);
	if(empty($title) || empty($content)){
		Showmsg('debate_noreply');
	}
	if(empty($winduid)){
		Showmsg('not_login');
	}
	if($db_charset!='utf-8'){
		$title   = ajax_convert($title,$db_charset);
		$content = ajax_convert($content,$db_charset);
	}
	if($aid){
		$db->update("UPDATE pw_debatereplys SET title='$title',content='$content' WHERE aid='$aid' AND authorid='$winduid'");
		echo 1;exit;
	}
} elseif ($action == "dedigest"){
	if(empty($winduid)){
		echo 4;exit;
	}
	if($admincheck){
		$rt=$db->get_one("SELECT digest FROM pw_debatethreads WHERE did='$did'");
		if($rt['digest']){
			$db->update("UPDATE pw_debatethreads SET digest=0 WHERE did='$did'");
			echo 2;exit;
		}else{
			$db->update("UPDATE pw_debatethreads SET digest=1 WHERE did='$did'");
			echo 1;exit;
		}
	}else{
		Showmsg('undefined_action');
	}
} elseif($action == "viewdebate"){
	require_once(R_P.'require/bbscode.php');
	InitGP(array('page','tid'));
	$sql='';
	$tid=(int)$tid;
	$tid && $sql=" AND debatetype='$tid'";
	$db_readperpage=5;
	(!is_numeric($page) || $page < 1) && $page = 1;
	$limit	= "LIMIT ".($page-1)*$db_readperpage.",$db_readperpage";
	$rt		= $db->get_one("SELECT COUNT(*) AS sum FROM pw_debatereplys WHERE did='$did' $sql");
	$pages	= ajaxpage($rt['sum'],$page,ceil($rt['sum']/$db_readperpage),$did,$tid);
	$debatedb=array();
	$lastDate=$dateLeft=$hourLeft=$minuteLeft=$secondLeft=$temp='';
	$query = $db->query("SELECT * FROM pw_debatereplys WHERE did='$did' $sql ORDER BY dateline DESC $limit");
	while ($rt = $db->fetch_array($query)){
		$rt['datetime']=$timestamp-$rt['dateline'];
		$lastDate = $rt['datetime'];
		$dateLeft = floor($lastDate/86400);
		$hourLeft = floor($lastDate/3600);
		$minuteLeft = floor($lastDate/60);
		$secondLeft = $lastDate;
		if($dateLeft>0){
			$temp=$dateLeft.'天前';
		}else{
			if($hourLeft>0){
				$temp=$hourLeft.'小时前';
			}else{
				if($minuteLeft>0){
					$temp=$minuteLeft.'分钟前';
				}else{
					if($lastDate<60){
						$temp=$lastDate.'秒前';
					}
				}
			}
		}
		$rt['nowtime']=$temp;
		$rt['decontent']= $rt['content'];
		if(strpos($rt['content'],'[p:')!==false || strpos($rt['content'],'[s:')!==false){
			$rt['content'] = showface($rt['content']);
		}
		$rt['content'] = str_replace("\n","<br />",$rt['content']);
		$rt['content'] = convert($rt['content'],$db_windpost);
		$obdebatedb[]=$rt;
	}
	require_once(PrintHack('viewidea'));ajax_footer();
} elseif($action == "judgment"){
	InitGP(array('judg','judgcontent'),P);
	$judg		= Char_cv($judg);
	$judgcontent= Char_cv($judgcontent);
	if($db_charset!='utf-8'){
		$judg = ajax_convert($judg,$db_charset);
		$judgcontent = ajax_convert($judgcontent,$db_charset);
	}
	$db->update("UPDATE pw_debatethreads SET judg='$judg',judgcontent='$judgcontent' WHERE did='$did' AND judgment='$windid'");
	$output="战况: $judg <p class=\"gray\" style=\"margin:.5em auto 1em\"><b>裁判说明:</b>$judgcontent</p>";
	echo $output;ajax_footer();
}
?>

⌨️ 快捷键说明

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