<?php

if(!defined('OT_ROOT')) {
	exit('Access Denied');
}



class UcNews{

	public static function Jud(){
		global $userSysArr;
		if ($userSysArr['US_isNews'] == 1){ return true; }else{ return false; }
	}

	public static function Show($str, $def=''){
		if (self::Jud()){
			return $str;
		}else{
			return $def;
		}
	}

	// 用户菜单
	public static function UminiMenu($mode='pc'){
		if (! self::Jud()){ return ''; }
		if ($mode == 'home'){
			return '<div id="homeLogin_news"><a href="'. Users::SysUrl('addNews','','./') .'" class="font2_1" >[发表文章]</a></div>';
		}else{
			return '<div id="uebox_news" class="left" style="padding-left:8px;"><a href="'. Users::SysUrl('addNews','','./') .'" class="font2_1" >[投稿]</a></div>';
		}
	}

	// 会员中心信息统计栏
	public static function UcInfo($userID){
		if (! self::Jud()){ return ''; }

		global $DB;
		$whereTime = TimeDate::Add('d',-30,TimeDate::Get());
		$infoAddNum = $infoAuditNum = 0;
		$infoAddNum = $DB->GetOne('select count(IF_ID) from '. OT_dbPref .'info where IF_userID='. $userID .' and IF_time>='. $DB->ForTime($whereTime));
		if ($infoAddNum > 0){
			$infoAuditNum = $DB->GetOne('select count(IF_ID) from '. OT_dbPref .'info where IF_userID='. $userID .' and IF_isAudit=1 and IF_time>='. $DB->ForTime($whereTime));
		}

		return '
			<div class="widgets-icons mx-auto rounded-circle">
				<a href="usersCenter.php?m=newsManage"><span class="img-avatar img-avatar-48 bg-lightgray"><i class="fa fa-newspaper-o"></i></span></a>
			</div>
			<p class="mb-0 m-t-10 p-t-10">30天投稿数<span class="text-danger"> '. $infoAddNum .' </span>篇</p>
			<p class="mb-0">审核通过<span class="text-danger"> '. $infoAuditNum .' </span>篇</p>
			';
	}

	public static function UcMenu(){
		if (! self::Jud()){ return ''; }

		return '
			<li><a href="usersCenter.php?m=addNews">发布文章</a></li>
			<li><a href="usersCenter.php?m=newsManage">文章管理</a></li>
			';
	}

	// 添加/修改文章
	public static function AddOrRev(){
		global $DB,$mudi,$userSysArr,$userRow,$systemArr,$webPathPart;

		$infoSysArr = Cache::PhpFile('infoSys');

		$UE_ID			= $userRow['UE_ID'];
		$UE_username	= $userRow['UE_username'];

		$dataID = OT::GetInt2( OT::ParaArr('id') );

		$beforeURL = UcBase::BeforeURL();

		if (! self::Jud()){
			return '<div class="hui-alert hui-alert-info">文章功能已关闭，有问题请联系管理员</div>';
		}

		$retStr = '';
		$writerAddiStr = '';
		if ($mudi == 'revNews'){
			if ($userSysArr['US_isNewsRev'] == 0){
				return '<div class="hui-alert hui-alert-danger">不允许修改文章，有问题请联系管理员</div>';
			}
			
			$revexe = $DB->query('select IF_ID,IF_theme,IF_isOri,IF_source,IF_writer,IF_typeStr,IF_tabID,IF_content,IF_upImgStr,IF_pageNum,IF_themeKey,IF_contentKey,IF_mediaFile,IF_file,IF_fileName,IF_fileStr,IF_isRenameFile,IF_isUserFile,IF_isNew,IF_isHomeThumb,IF_isThumb,IF_isFlash,IF_isImg,IF_isMarquee,IF_isRecom,IF_isTop,IF_img,IF_voteMode,IF_isReply,IF_isCheckUser,IF_score1,IF_score2,IF_score3,IF_cutScore1,IF_cutScore2,IF_cutScore3,IF_isEnc,IF_encContent,IF_addition,IF_topicList,IF_topAddiID,IF_addiID,IF_freeGroupList,IF_userGroupList,IF_cutQuickMoney,IF_mediaFile,IF_videoID from '. OT_dbPref .'info where IF_ID='. $dataID);
				if (! $row = $revexe->fetch()){
					return '<div class="hui-alert hui-alert-danger">获取不到指定的记录</div>';
				}
				$IF_ID			= $row['IF_ID'];
				$IF_theme		= $row['IF_theme'];
				$IF_isOri		= $row['IF_isOri'];
				$IF_source		= $row['IF_source'];
				$IF_writer		= $row['IF_writer'];
				$IF_typeStr		= $row['IF_typeStr'];
				if ($row['IF_tabID'] > 0){
					$IF_content	= Info::GetTabContent($row['IF_tabID'], $dataID);
				}else{
					$IF_content	= $row['IF_content'];
				}
					$imgUrl = $beforeURL . InfoImgDir;
					$IF_content	= str_replace(InfoImgAdminDir,$imgUrl,$IF_content);
				$IF_upImgStr	= $row['IF_upImgStr'];
				$IF_pageNum		= $row['IF_pageNum'];
				$IF_themeKey	= $row['IF_themeKey'];
				$IF_contentKey	= $row['IF_contentKey'];
				$IF_mediaFile	= $row['IF_mediaFile'];
				$IF_file		= $row['IF_file'];
				$IF_fileName	= $row['IF_fileName'];
				$IF_fileStr		= $row['IF_fileStr'];
					if (strlen($IF_fileStr) == 0 && strlen($IF_file) > 0){
						$IF_fileStr = $IF_file .'|'. $IF_fileName .'|';
						$IF_fileName = '';
						$IF_file = '';
					}
				$IF_isRenameFile= $row['IF_isRenameFile'];
				$IF_isUserFile	= $row['IF_isUserFile'];
				$IF_isNew		= $row['IF_isNew'];
				$IF_isHomeThumb	= $row['IF_isHomeThumb'];
				$IF_isThumb		= $row['IF_isThumb'];
				$IF_isFlash		= $row['IF_isFlash'];
				$IF_isImg		= $row['IF_isImg'];
				$IF_isMarquee	= $row['IF_isMarquee'];
				$IF_isRecom		= $row['IF_isRecom'];
				$IF_isTop		= $row['IF_isTop'];
				$IF_img			= $row['IF_img'];
				$IF_voteMode	= $row['IF_voteMode'];
				$IF_isReply		= $row['IF_isReply'];
				$IF_topicList	= $row['IF_topicList'];
				$IF_topAddiID	= $row['IF_topAddiID'];
				$IF_addiID		= $row['IF_addiID'];
				$IF_isCheckUser	= $row['IF_isCheckUser'];
				$IF_freeGroupList = $row['IF_freeGroupList'];
				$IF_userGroupList = $row['IF_userGroupList'];
				$IF_score1		= $row['IF_score1'];
				$IF_score2		= $row['IF_score2'];
				$IF_score3		= $row['IF_score3'];
				$IF_cutScore1	= $row['IF_cutScore1'];
				$IF_cutScore2	= $row['IF_cutScore2'];
				$IF_cutScore3	= $row['IF_cutScore3'];
				$IF_isEnc		= $row['IF_isEnc'];
				$IF_encContent	= $row['IF_encContent'];
				$IF_addition	= $row['IF_addition'];
				$IF_cutQuickMoney = $row['IF_cutQuickMoney'];
				$IF_mediaFile	= $row['IF_mediaFile'];
				$IF_videoID		= $row['IF_videoID'];
			unset($revexe);

			$ug = new UserGroup($UE_ID);
			$infoScore1	= $ug->row['UG_infoScore1'];
			$infoScore2	= $ug->row['UG_infoScore2'];
			$infoScore3	= $ug->row['UG_infoScore3'];
			if (strpos(''. $ug->row['UG_event'],'|禁止投稿|') !== false){
				return '<div class="hui-alert hui-alert-danger">您所在用户组禁止投稿，如有问题请联系管理员</div>';
			}

			$mudiCN = '修 改';
		}else{
			if ($userSysArr['US_isNewsAdd'] == 0){
				return '<div class="hui-alert hui-alert-danger">文章发表已关闭，如有问题请联系管理员</div>';
			}

			$ug = new UserGroup($UE_ID);
			$infoScore1	= $ug->row['UG_infoScore1'];
			$infoScore2	= $ug->row['UG_infoScore2'];
			$infoScore3	= $ug->row['UG_infoScore3'];
			if (strpos(''. $ug->row['UG_event'],'|禁止投稿|') !== false){
				return '<div class="hui-alert hui-alert-danger">您所在用户组禁止投稿，如有问题请联系管理员</div>';
			}

			// 总投稿数限制
			$retArr = $ug->InfoTotalNumArr();
				if ($retArr['res']){
					if (strlen($retArr['note']) > 0){
						$retStr .= '<div class="hui-alert hui-alert-info">'. $retArr['note'] .'</div>';
					}
				}else{
					return '<div class="hui-alert hui-alert-info">'. $retArr['note'] .'</div>';
				}
			
			// 每日投稿限制
			$retArr = $ug->InfoDayNumArr();
				if ($retArr['res']){
					if (strlen($retArr['note']) > 0){
						$retStr .= '<div class="hui-alert hui-alert-info">'. $retArr['note'] .'</div>';
					}
				}else{
					return '<div class="hui-alert hui-alert-info">'. $retArr['note'] .'</div>';
				}

			$nasStr = $nas2Str = '';
			$newsAddScoreArr = Users::ScoreArr('newsAdd');
			if ($newsAddScoreArr['US_score1'] < 0){
				$nasStr .= $userSysArr['US_score1Name'] .'：'. $newsAddScoreArr['US_score1'] .'&ensp;&ensp;';
			}
			if ($userSysArr['US_isScore2'] == 1 && $newsAddScoreArr['US_score2'] < 0){
				$nasStr .= $userSysArr['US_score2Name'] .'：'. $newsAddScoreArr['US_score2'] .'&ensp;&ensp;';
			}
			if ($userSysArr['US_isScore3'] == 1 && $newsAddScoreArr['US_score3'] < 0){
				$nasStr .= $userSysArr['US_score3Name'] .'：'. $newsAddScoreArr['US_score3'] .'&ensp;&ensp;';
			}
			if (strlen($nasStr) > 0){
				$state0Num = $DB->GetOne('select count(IF_ID) from '. OT_dbPref .'info where IF_userID='. $UE_ID .' and IF_isAudit<>1 and IF_isGetScore=0');
				$state0Score1	= $newsAddScoreArr['US_score1'] * $state0Num;
				$state0Score2	= $newsAddScoreArr['US_score2'] * $state0Num;
				$state0Score3	= $newsAddScoreArr['US_score3'] * $state0Num;
				
				$urs = $DB->GetRow('select UE_realname,UE_score1,UE_score2,UE_score3 from '. OT_dbPref .'users where UE_ID='. $UE_ID);
				if ($urs['UE_score1'] + $newsAddScoreArr['US_score1'] + $state0Score1 < 0){
					$nas2Str .= '<div class="hui-alert hui-alert-danger">您当前 '. $userSysArr['US_score1Name'] .'：'. $urs['UE_score1'] .'，不足以扣除 '. abs($newsAddScoreArr['US_score1']) . ($state0Score1 < 0 ? ' + <span style="color:blue;">'. abs($state0Score1) .'(未审核文章'. $state0Num .'篇)</span>' : '') .'</div>';
				}
				if ($userSysArr['US_isScore2'] == 1 && $urs['UE_score2'] + $newsAddScoreArr['US_score2'] + $state0Score2 < 0){
					$nas2Str .= '<div class="hui-alert hui-alert-danger">您当前 '. $userSysArr['US_score2Name'] .'：'. $urs['UE_score2'] .'，不足以扣除 '. abs($newsAddScoreArr['US_score2']) . ($state0Score2 < 0 ? ' + <span style="color:blue;">'. abs($state0Score2) .'(未审核文章'. $state0Num .'篇)</span>' : '') .'</div>';
				}
				if ($userSysArr['US_isScore3'] == 1 && $urs['UE_score3'] + $newsAddScoreArr['US_score3'] + $state0Score3 < 0){
					$nas2Str .= '<div class="hui-alert hui-alert-danger">您当前 '. $userSysArr['US_score3Name'] .'：'. $urs['UE_score3'] .'，不足以扣除 '. abs($newsAddScoreArr['US_score3']) . ($state0Score3 < 0 ? ' + <span style="color:blue;">'. abs($state0Score3) .'(未审核文章'. $state0Num .'篇)</span>' : '') .'</div>';
				}
				if (strlen($nas2Str) > 0){
					$alertStr = ' ';
					if (AppMoneyAlipay::Jud() || AppMoneyWeixin::Jud()){
						$alertStr .= '，<div class="hui-alert hui-alert-danger">您可以先 <a href="'. $webPathPart .'usersCenter.php?m=onlinePay&isBack=1" target="_blank" style="font-weight:bold;text-decoration:underline;color:red;">在线充值</a> 然后再投稿 </div>';
					}
					return '<div class="hui-alert hui-alert-danger">发布文章需要 '. $nasStr . $alertStr .'</div>'. $nas2Str;
				}
			}

			$IF_ID			= 0;
			$IF_theme		= '';
			$IF_isOri		= 0;
			$IF_source		= $userSysArr['US_newsSource'];
			$IF_writer		= $userSysArr['US_newsWriter'];
				if (strpos($IF_writer,'{username}') !== false){
					$IF_writer		= str_replace('{username}', $UE_username, $IF_writer);
				}elseif (strpos($IF_writer,'{会员用户名}') !== false){
					$IF_writer		= str_replace('{会员用户名}', $UE_username, $IF_writer);
				}elseif (strpos($IF_writer,'{会员用户名部分隐藏}') !== false){
					$IF_writer		= str_replace('{会员用户名部分隐藏}', Str::PartHide($UE_username), $IF_writer);
				}
				if (strpos($IF_writer,'{会员昵称}') !== false){
					if (isset($urs['UE_realname'])){
						$realname = $urs['UE_realname'];
					}else{
						$realname = $DB->GetOne('select UE_realname from '. OT_dbPref .'users where UE_ID='. $UE_ID);;
					}
					if ($IF_writer == '{会员昵称}' && strlen($realname) == 0){
						$writerAddiStr = '<span style="color:red;">（昵称为空，可以到 个人资料修改 - 姓名/昵称 填写下）</span>';
					}
					$IF_writer		= str_replace('{会员昵称}', $realname, $IF_writer);
				}
			$IF_typeStr		= $userSysArr['US_newsTypeStr'];
			$IF_content		= '';
			$IF_upImgStr	= '';
			$IF_pageNum		= '';
			$IF_themeKey	= '';
			$IF_contentKey	= '';
			$IF_mediaFile	= '';
			$IF_file		= '';
			$IF_fileName	= '';
			$IF_fileStr		= '';
			$IF_isRenameFile= 0;
			$IF_isUserFile	= 0;
			$IF_isNew		= 1;
			$IF_isHomeThumb	= 0;
			$IF_isThumb		= 0;
			$IF_isFlash		= 0;
			$IF_isImg		= 0;
			$IF_isMarquee	= 0;
			$IF_isRecom		= 0;
			$IF_isTop		= 0;
			$IF_img			= '';
			$IF_voteMode	= 1;
			$IF_isReply		= 1;
			$IF_topicList	= '';
			$IF_topAddiID	= 0;
			$IF_addiID		= 0;
			$IF_isCheckUser	= 0;
			$IF_freeGroupList = '';
			$IF_userGroupList = '';
			$IF_score1		= '';
			$IF_score2		= '';
			$IF_score3		= '';
			$IF_cutScore1	= '';
			$IF_cutScore2	= '';
			$IF_cutScore3	= '';
			$IF_isEnc		= 0;
			$IF_encContent	= '';
			$IF_addition	= '';
			$IF_cutQuickMoney = '';
			$IF_videoID		= 0;

			$mudiCN = '发 表';
		}

		if ($userSysArr['US_isRevSource'] == 1){
			$sourceStr = '<input type="text" id="source" name="source" class="form-control" value="'. Str::MoreReplace($IF_source,'input') .'" />';
		}else{
			$sourceStr = $IF_source .'<input type="hidden" id="source" name="source" value="'. Str::MoreReplace($IF_source,'input') .'" />';
		}
		if ($userSysArr['US_isRevWriter'] == 1){
			$writerStr = '<input type="text" id="writer" name="writer" class="form-control" value="'. Str::MoreReplace($IF_writer,'input') .'" />';
		}else{
			$writerStr = $IF_writer . $writerAddiStr .'<input type="hidden" id="writer" name="writer" value="'. Str::MoreReplace($IF_writer,'input') .'" />';
		}

		if (strlen(trim(''. Str::RegExp($userSysArr['US_addNewsAnnoun'],'html'))) >= 3){
			$retStr .= '<div class="announ hui-alert hui-alert-danger">'. $userSysArr['US_addNewsAnnoun'] .'</div>';
		}

		$retStr .= '
		<script language="javascript" type="text/javascript" src="js/usersNews.js?v='. OT_VERSION .'"></script>
		<script language="javascript" type="text/javascript" src="js/inc/editor.js?v='. OT_VERSION .'"></script>

		<div class="hui-alert hui-alert-danger">带 * 号为必填项，其他项可选。</div>
		<form id="dealForm" name="dealForm" method="post" action="usersNews_deal.php?m=deal" onsubmit="return CheckNewsForm();" class="form-horizontal">
		<script language="javascript" type="text/javascript">document.write(\'<input type="hidden" name="backURL" value="\'+ document.location.href +\'" />\')</script>
		<input type="hidden" id="dataID" name="dataID" value="'. $IF_ID .'" />
		<input type="hidden" id="beforeURL" name="beforeURL" value="'. $beforeURL .'" />
		<input type="hidden" id="userID" name="userID" value="'. $UE_ID .'" />
		<input type="hidden" id="isScore1" name="isScore1" value="'. $userSysArr['US_isScore1'] .'" />
		<input type="hidden" id="isScore2" name="isScore2" value="'. $userSysArr['US_isScore2'] .'" />
		<input type="hidden" id="isScore3" name="isScore3" value="'. $userSysArr['US_isScore3'] .'" />
		<input type="hidden" id="score1Name" name="score1Name" value="'. $userSysArr['US_score1Name'] .'" />
		<input type="hidden" id="score2Name" name="score2Name" value="'. $userSysArr['US_score2Name'] .'" />
		<input type="hidden" id="score3Name" name="score3Name" value="'. $userSysArr['US_score3Name'] .'" />
		<input type="hidden" id="infoScore1" name="infoScore1" value="'. $infoScore1 .'" />
		<input type="hidden" id="infoScore2" name="infoScore2" value="'. $infoScore2 .'" />
		<input type="hidden" id="infoScore3" name="infoScore3" value="'. $infoScore3 .'" />

		<div class="row">
			<div class="col-sm-6">
				<div class="form-group">
					<label class="col-sm-4 control-label"><span class="font2_2">*</span>标题：</label>
					<div class="col-sm-8">
						<input id="theme" name="theme" class="form-control" type="text" value="'. Str::MoreReplace($IF_theme,'input') .'">
						<a href="javascript:void(0);" onclick="CheckRepeatTheme();return false;" style="text-decoration:underline;">检测重复标题</a>
					</div>
				</div>
			</div>
			<div class="col-sm-6" style="'. self::CssDisplay($userSysArr['US_newsCloseArea'], 'isOri') .'">
				<div class="form-group">
					<label class="col-sm-4 control-label">是否原创：</label>
					<div class="col-sm-8">
						<label class="uc-switch switch-solid switch-primary">
							 <input type="checkbox" name="isOri" value="1" '. Is::Checked($IF_isOri,1) .'>
							 <span></span>
						</label>
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-sm-6">
				<div class="form-group">
					<label class="col-sm-4 control-label">来源：</label>
					<div class="col-sm-8">
						'. $sourceStr .'
					</div>
				</div>
			</div>
			<div class="col-sm-6">
				<div class="form-group">
					<label class="col-sm-4 control-label">作者：</label>
					<div class="col-sm-8">
						'. $writerStr .'
						<!-- <label class="uc-switch switch-solid switch-primary"></label> -->
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-sm-6">
				<div class="form-group">
					<label class="col-sm-4 control-label"><span class="font2_2">*</span>栏目：</label>
					<div class="col-sm-8">
						<select id="typeStr" name="typeStr" class="form-control">
						<option value=""></option>
						';
						$typeNum = 0;
						$typeexe = $DB->query('select * from '. OT_dbPref .'infoType where IT_state=1 and IT_level=1 and IT_isUser=1 order by IT_rank ASC');
						if (! $row = $typeexe->fetch()){
							$retStr .= '
							<option value="">无栏目，需到后台 常规设置-栏目管理 开启[用户投稿]</option>
							';
						}else{
							do {
								$typeNum ++;
								$type2exe = $DB->query('select * from '. OT_dbPref .'infoType where IT_state=1 and IT_level=2 and IT_fatID='. $row['IT_ID'] .' and IT_isUser=1 order by IT_rank ASC');
								if (! $row2 = $type2exe->fetch()){
									$retStr .= '<option value=",'. $row['IT_ID'] .'," '. Is::InstrSelected($IF_typeStr,','. $row['IT_ID'] .',') .'>'. $typeNum .'、'. $row['IT_theme'] .'</option>';
								}else{
									$retStr .= '<optgroup label="'. $typeNum .'、'. $row['IT_theme'] .'" style="font-weight:normal;"></optgroup>';
									do{
										$retStr .= '<option value=",'. $row['IT_ID'] .','. $row2['IT_ID'] .'," '. Is::InstrSelected($IF_typeStr,','. $row2['IT_ID'] .',') .'>&ensp;&ensp;&ensp;┣&ensp;'. $row2['IT_theme'] .'</option>';
									}while ($row2 = $type2exe->fetch());
								}
								$type2exe=null;
							}while ($row = $typeexe->fetch());
						}
						unset($typeexe);

						$retStr .= '
						</select>&ensp;
						<span class="font2_2">如果有二级栏目,一级栏目不能选择</span><span onclick=\'if($id("bugBox").style.display==""){$id("bugBox").style.display="none";}else{$id("bugBox").style.display="";}\'>&ensp;</span><label id="bugBox" style="display:none;"><input type="checkbox" id="bugMode" name="bugMode" value="1" />调试模式</label>
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-sm-12">
				<div class="form-group">
					<label class="col-sm-2 control-label"><span class="font2_2">*</span>内容：</label>
					<div class="col-sm-10">
						<textarea id="content" name="content" cols="40" rows="4" style="width:100%;height:500px;" class="text" onclick=\'LoadEditor("content",0,800,"");\' title="点击开启编辑器模式">'. $IF_content .'</textarea>
						<div>
							<input type="button" onclick=\'InsertStrToEditor("content", "[OT_page]");\' value="插入分页符" />
							'. AppBase::UsersNewsBox1($userSysArr['US_isNewsUpImg'], 'content', $dataID) .'
							<input type="hidden" id="infoFileDir" name="infoFileDir" value="'. InfoImgDir .'" />
							<input type="hidden" id="upImgStr" name="upImgStr" value="'. $IF_upImgStr .'" />
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="row" style="'. self::CssDisplay($userSysArr['US_newsCloseArea'], 'pageNum') .'">
			<div class="col-sm-12">
				<div class="form-group">
					<label class="col-sm-2 control-label">自动分页字数：</label>
					<div class="col-sm-10">
						<input type="text" id="pageNum" name="pageNum" class="form-control" size="50" value="'. $IF_pageNum .'" />
						<span class="font2_2">页数=内容总字数÷自动分页字数；如果在内容中加入了手动分页符或不想分页,请填写0或留空</span>
					</div>
				</div>
			</div>
		</div>
		<div class="row" style="'. self::CssDisplay($userSysArr['US_newsCloseArea'], 'themeKey') .'">
			<div class="col-sm-12">
				<div class="form-group">
					<label class="col-sm-2 control-label">关键词(标签)：</label>
					<div class="col-sm-10">
							<input type="text" id="themeKey" name="themeKey" class="form-control" value="'. Str::MoreReplace($IF_themeKey,'input') .'" />
							<a href="javascript:void(0);" onclick=\'GetKeyWord("fc");return false;\' style="text-decoration:underline;">分词获取</a>
							<!-- &ensp;&ensp;<a href="javascript:void(0);" onclick=\'GetKeyWord("dz");return false;\' style="text-decoration:underline;">网络获取</a> -->
							<a href="javascript:void(0);" onclick=\'GetKeyWord("");return false;\' style="text-decoration:underline;">本地获取</a>
							<br /><span class="font2_2">多个关键词用空格、竖杆“|”或逗号“,”隔开</span>
							<span id="onloadThemeKey" class="font3_2"></span>
					</div>
				</div>
			</div>
		</div>
		<div class="row" style="'. self::CssDisplay($userSysArr['US_newsCloseArea'],'contentKey') .'">
			<div class="col-sm-12">
				<div class="form-group">
					<label class="col-sm-2 control-label">内容摘要：</label>
					<div class="col-sm-10">
						<textarea id="contentKey" name="contentKey" cols="40" rows="4" style="height:60px;" class="form-control">'. Str::MoreReplace($IF_contentKey,'input') .'</textarea>
						<a href="javascript:void(0);" onclick="ToContentKey();return false;" style="text-decoration:underline;">自动获取</a>
						<br /><span class="font2_2">内容摘要为空则自动获取</span>
					</div>
				</div>
			</div>
		</div>

		'. AppBase::UsersNewsBox2($userSysArr['US_isNewsUpFile'], $IF_isRenameFile, $IF_isUserFile, $IF_file, $IF_fileName, $IF_fileStr, $dataID, 'uc') .'
		';
		$addiStr = '';
		if (strpos($userSysArr['US_newsAddiStr'],'|new|') !== false){
			$addiStr .= '
			<label class="uc-switch switch-solid switch-primary m-r-5" title="出现在前台最新消息处">
				<input type="checkbox" id="isNew" name="isNew" onclick="CheckAddition()" value="1" '. Is::Checked($IF_isNew,1) .'><span></span>最新消息
			</label>';
		}
		if (strpos($userSysArr['US_newsAddiStr'],'|homeThumb|') !== false){
			$addiStr .= '
			<label class="uc-switch switch-solid switch-primary m-r-5" title="首页栏目显示图片文章需要此属性，同时所属栏目【在首页显示图片文章】需要开启">
				<input type="checkbox" id="isHomeThumb" name="isHomeThumb" onclick="CheckAddition()" value="1" '. Is::Checked($IF_isHomeThumb,1) .'><span></span>首页缩略图
			</label>&ensp;&ensp;';
		}
		if (strpos($userSysArr['US_newsAddiStr'],'|thumb|') !== false){
			$addiStr .= '
			<label class="uc-switch switch-solid switch-primary m-r-5" title="列表页中显示">
				<input type="checkbox" id="isThumb" name="isThumb" onclick="CheckAddition()" value="1" '. Is::Checked($IF_isThumb,1) .'><span></span>缩略图
			</label>&ensp;&ensp;';
		}
		if (strpos($userSysArr['US_newsAddiStr'],'|flash|') !== false){
			$addiStr .= '
			<label class="uc-switch switch-solid switch-primary m-r-5" title="首页左上角幻灯片">
				<input type="checkbox" id="isFlash" name="isFlash" onclick="CheckAddition()" value="1" '. Is::Checked($IF_isFlash,1) .'><span></span>幻灯片
			</label>&ensp;&ensp;';
		}
		if (strpos($userSysArr['US_newsAddiStr'],'|img|') !== false){
			$addiStr .= '
			<label class="uc-switch switch-solid switch-primary m-r-5" title="首页中部滚动图片">
				<input type="checkbox" id="isImg" name="isImg" onclick="CheckAddition()" value="1" '. Is::Checked($IF_isImg,1) .'><span></span>滚动图片
			</label>&ensp;&ensp;';
		}
		if (strpos($userSysArr['US_newsAddiStr'],'|marquee|') !== false){
			$addiStr .= '
			<label class="uc-switch switch-solid switch-primary m-r-5" title="页头滚动信息">
				<input type="checkbox" id="isMarquee" name="isMarquee" onclick="CheckAddition()" value="1" '. Is::Checked($IF_isMarquee,1) .'><span></span>滚动信息
			</label>&ensp;&ensp;';
		}
		if (strpos($userSysArr['US_newsAddiStr'],'|recom|') !== false){
			$addiStr .= '
			<label class="uc-switch switch-solid switch-primary m-r-5" title="出现在精彩推荐/本类推荐里">
				<input type="checkbox" id="isRecom" name="isRecom" onclick="CheckAddition()" value="1" '. Is::Checked($IF_isRecom,1) .'><span></span>推荐
			</label>&ensp;&ensp;';
		}
		if (strpos($userSysArr['US_newsAddiStr'],'|top|') !== false){
			$addiStr .= '
			<label class="uc-switch switch-solid switch-primary m-r-5" title="出现在最新消息第一条及列表页前几条">
				<input type="checkbox" id="isTop" name="isTop" onclick="CheckAddition()" value="1" '. Is::Checked($IF_isTop,1) .'><span></span>置顶
			</label>&ensp;&ensp;';
		}
		if (strlen($addiStr) > 0){
			$addiStr = '
				<div class="row" style="'. self::CssDisplay($userSysArr['US_newsCloseArea'],'isAttr') .'">
					<div class="col-sm-12">
						<div class="form-group">
							<label class="col-sm-2 control-label">文章属性：</label>
							<div class="col-sm-10">
								'. $addiStr .'
							</div>
						</div>
					</div>
				</div>
				';
		}

		$retStr .= $addiStr .'
		<div class="row" id="imgBox" style="display:none;">
			<div class="col-sm-12">
				<div class="form-group">
					<label class="col-sm-2 control-label">缩略图/图片：</label>
					<div class="col-sm-10">
						<input type="text" id="img" name="img" size="50" class="form-control" value="'. $IF_img .'" />
						<span style="position:relative;"><span style="position:absolute; left:-200px; top:22px;"><img id="imgView" src="" width="100" style="display:none;" onerror=\'if (this.value!="1"){this.value="1";this.src="'. $webPathPart .'inc_img/noPic.gif";}\' /></span></span>
						<input type="button" onclick=\'OT_OpenUpImg("input","img","info","&proType=info&proID='. $dataID .'")\' value="上传图片" />
						&ensp;<a href="javascript:void(0);" onclick="GetEditorImg();return false;" class="font1_2" style="text-decoration:underline;">从编辑器中获取</a>
						<div id="editorImgBox"></div>
					</div>
				</div>
			</div>
		</div>
		';
		if ($userSysArr['US_isNewsVote'] == 99){
			$retStr .= '
			<div class="row">
				<div class="col-sm-12">
					<div class="form-group">
						<label class="col-sm-2 control-label">投票方式：</label>
						<div class="col-sm-10">
							<label class="uc-radio radio-inline radio-info">
                    			<input type="radio" name="voteMode" value="0" '. Is::Checked($IF_voteMode,0) .'>
                    			<span>关闭</span>
                    		</label>
                    		<label class="uc-radio radio-inline radio-info">
                    			<input type="radio" name="voteMode" value="1" '. Is::Checked($IF_voteMode,1) .'>
                    			<span>心情</span>
                    		</label>
                    		<label class="uc-radio radio-inline radio-info">
                    			<input type="radio" name="voteMode" value="2" '. Is::Checked($IF_voteMode,2) .'>
                    			<span>顶踩</span>
                    		</label>
                    		<label class="uc-radio radio-inline radio-info">
                    			<input type="radio" name="voteMode" value="11" '. Is::Checked($IF_voteMode,11) .'>
                    			<span>百度喜欢按钮</span>
                    		</label>
						</div>
					</div>
				</div>
			</div>
			';
		}
		if ($userSysArr['US_isReply'] == 99){
			$retStr .= '
			<div class="row">
				<div class="col-sm-12">
					<div class="form-group">
						<label class="col-sm-2 control-label">评论区：</label>
						<div class="col-sm-10">
							<label class="uc-radio radio-inline radio-info">
                    			<input type="radio" name="isReply" value="1" '. Is::Checked($IF_isReply,1) .'>
                    			<span>显示</span>
                    		</label>
                    		<label class="uc-radio radio-inline radio-info">
                    			<input type="radio" name="isReply" value="0" '. Is::Checked($IF_isReply,0) .'>
                    			<span>隐藏</span>
                    		</label>
						</div>
					</div>
				</div>
			</div>
			';
		}
		if ($userSysArr['US_topicID'] == -1){
			$retStr .= AppTopic::UcNewsTrBox1($IF_topicList, 'uc');
		}
		if ($userSysArr['US_topAddiID'] == -1 || $userSysArr['US_addiID'] == -1){
			$topAddiOptionStr = $addiOptionStr = '';
			$addiexe=$DB->query("select IW_ID,IW_theme from ". OT_dbPref ."infoWeb where IW_type='news' order by IW_rank ASC");
			while ($row = $addiexe->fetch()){
				$topAddiOptionStr .= '<option value="'. $row['IW_ID'] .'" '. Is::Selected($IF_topAddiID,$row['IW_ID']) .'>'. $row['IW_theme'] .'</option>';
				$addiOptionStr .= '<option value="'. $row['IW_ID'] .'" '. Is::Selected($IF_addiID,$row['IW_ID']) .'>'. $row['IW_theme'] .'</option>';
			}
			unset($addiexe);

			if ($userSysArr['US_topAddiID'] == -1){
				$retStr .= '
				<div class="row">
					<div class="col-sm-6">
						<div class="form-group">
							<label class="col-sm-4 control-label">头附加内容：</label>
							<div class="col-sm-8">
								<select id="topAddiID" name="topAddiID" class="form-control">
								<option value="0">无</option>
								'. $topAddiOptionStr .'
								</select>
							</div>
						</div>
					</div>
				</div>
				';
			}
			if ($userSysArr['US_addiID'] == -1){
				$retStr .= '
				<div class="row">
					<div class="col-sm-6">
						<div class="form-group">
							<label class="col-sm-4 control-label">尾附加内容：</label>
							<div class="col-sm-8">
								<select id="addiID" name="addiID" class="form-control">
								<option value="0">无</option>
								'. $addiOptionStr .'
								</select>
							</div>
						</div>
					</div>
				</div>
				';
			}
		}
		if ($userSysArr['US_isCheckUser'] == 1){
			$scoreNum = 0;
			if ($userSysArr['US_isScore1'] == 1 && $infoScore1 > 0){ $score1Style = ''; $scoreNum ++; }else{ $score1Style = 'display:none;'; }
			if ($userSysArr['US_isScore2'] == 1 && $infoScore2 > 0){ $score2Style = ''; $scoreNum ++; }else{ $score2Style = 'display:none;'; }
			if ($userSysArr['US_isScore3'] == 1 && $infoScore3 > 0){ $score3Style = ''; $scoreNum ++; }else{ $score3Style = 'display:none;'; }
			if ($scoreNum == 0){ $noScoreStr = '<span style="color:blue;">[无法设置，您会员组尚未设置积分]</span>'; }else{ $noScoreStr = ''; }

			$freeGroupStr = $limitGroupStr = '';
			$groupexe = $DB->query('select UG_ID,UG_theme from '. OT_dbPref .'userGroup where UG_state=1 order by UG_rank ASC');
			while ($row = $groupexe->fetch()){
				$freeGroupStr .= '
				<label class="uc-switch switch-solid switch-primary">
					<input type="checkbox" name="freeGroupList[]" value="['. $row['UG_ID'] .']" '. Is::InstrChecked($IF_freeGroupList,'['. $row['UG_ID'] .']') .'><span></span>'. $row['UG_theme'] .'
				</label>&ensp;&ensp;';
				$limitGroupStr .= '
				<label class="uc-switch switch-solid switch-primary">
					<input type="checkbox" name="userGroupList[]" value="['. $row['UG_ID'] .']" '. Is::InstrChecked($IF_userGroupList,'['. $row['UG_ID'] .']') .'><span></span>'. $row['UG_theme'] .'
				</label>&ensp;&ensp;';
			}
			unset($groupexe);

			$retStr .= '
			<div class="row">
				<div class="col-sm-12">
					<div class="form-group">
						<label class="col-sm-2 control-label">限制阅读：</label>
						<div class="col-sm-10">
							<label class="uc-switch switch-solid switch-primary m-r-5">
								<input type="checkbox" id="addition_user" name="addition[]" value="|checkUser|" '. Is::InstrChecked($IF_addition,'|checkUser|') .' onclick="CheckCheckUser()" /><span></span>仅限会员阅读
							</label>&ensp;&ensp;
							<label class="uc-switch switch-solid switch-primary m-r-5">
								<input type="checkbox" id="addition_reply" name="addition[]" value="|checkReply|" '. Is::InstrChecked($IF_addition,'|checkReply|') .' onclick="CheckCheckUser()" /><span></span>会员回复可见
							</label>&ensp;&ensp;
							'. AppMoneyQuick::UcInfoCheckItem($IF_addition) .'
							'. AppNewsPwd::UcInfoCheckItem($IF_addition) .'
							'. AppXcxAd::UcInfoCheckItem($IF_addition) .'
                    		</label>
						</div>
					</div>
				</div>
			</div>
			<div id="checkUserBox" style="display:none;">
				<div class="row">
					<div class="col-sm-12">
						<div class="form-group">
							<label class="col-sm-2 control-label"></label>
							<div class="col-sm-10"><b>【仅限会员阅读】设置区</b></div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-sm-12">
						<div class="form-group">
							<label class="col-sm-2 control-label"></label>
							<div class="col-sm-10">
								<div class="floatW70" style="'. $score1Style .'">'. $userSysArr['US_score1Name'] .'</div>
								<div class="floatW70" style="'. $score2Style .'">'. $userSysArr['US_score2Name'] .'</div>
								<div class="floatW70" style="'. $score3Style .'">'. $userSysArr['US_score3Name'] .'</div>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-sm-12">
						<div class="form-group">
							<label class="col-sm-2 control-label"></label>
							<div class="col-sm-10">
								<div class="floatW70" style="'. $score1Style .'">≤'. $infoScore1 .'</div>
								<div class="floatW70" style="'. $score2Style .'">≤'. $infoScore2 .'</div>
								<div class="floatW70" style="'. $score3Style .'">≤'. $infoScore3 .'</div>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-sm-12">
						<div class="form-group">
							<label class="col-sm-2 control-label">限制阅读积分：</label>
							<div class="col-sm-10">
								<div class="floatW70" style="'. $score1Style .'"><input type="text" id="score1" name="score1" value="'. $IF_score1 .'" size="3" style="width:50px;display:inline;" onkeyUp="this.value=FiltInt(this.value)" class="form-control"></div>
								<div class="floatW70" style="'. $score2Style .'"><input type="text" id="score2" name="score2" value="'. $IF_score2 .'" size="3" style="width:50px;display:inline;" onkeyUp="this.value=FiltInt(this.value)" class="form-control"></div>
								<div class="floatW70" style="'. $score3Style .'"><input type="text" id="score3" name="score3" value="'. $IF_score3 .'" size="3" style="width:50px;display:inline;" onkeyUp="this.value=FiltInt(this.value)" class="form-control"></div>
								<span class="font2_2">'. $noScoreStr .'（用户积分达到才能阅读，不要求直接填0）</span>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-sm-12">
						<div class="form-group">
							<label class="col-sm-2 control-label">付费阅读积分：</label>
							<div class="col-sm-10">
								<div class="floatW70" style="'. $score1Style .'"><input type="text" id="cutScore1" name="cutScore1" value="'. $IF_cutScore1 .'" size="3" style="width:50px;display:inline;" onkeyUp="this.value=FiltInt(this.value)" class="form-control"></div>
								<div class="floatW70" style="'. $score2Style .'"><input type="text" id="cutScore2" name="cutScore2" value="'. $IF_cutScore2 .'" size="3" style="width:50px;display:inline;" onkeyUp="this.value=FiltInt(this.value)" class="form-control"></div>
								<div class="floatW70" style="'. $score3Style .'"><input type="text" id="cutScore3" name="cutScore3" value="'. $IF_cutScore3 .'" size="3" style="width:50px;display:inline;" onkeyUp="this.value=FiltInt(this.value)" class="form-control"></div>
								<span class="font2_2">'. $noScoreStr .'（用户扣积分才能阅读）</span>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-sm-12">
						<div class="form-group">
							<label class="col-sm-2 control-label">免费阅读组：</label>
							<div class="col-sm-10">
								'. $freeGroupStr .'
								<span class="font2_2">(【免费阅读组】优先于【限制/付费阅读组】)</span>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-sm-12">
						<div class="form-group">
							<label class="col-sm-2 control-label">限制/付费阅读组：</label>
							<div class="col-sm-10">
								'. $limitGroupStr .'
								<span class="font2_2">(都不选，等于允许所有用户组)</span>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div id="checkQuickBox" style="display:none;">
				'. AppMoneyQuick::UcInfoTrBox($IF_cutQuickMoney) .'
			</div>
			<div id="checkPwdBox" style="display:none;">
			</div>
			<div id="newsEncBox" style="display:none;">
				'. AppNewsEnc::UcInfoTrBox1($IF_isEnc, $IF_encContent, $IF_addition, $IF_ID, 'uc') .'
			</div>
			';
		}
		if (OT_OpenVerCode && strpos($systemArr['SYS_verCodeStr'],'|news|')!==false){
			$retStr .= '
			<div class="row">
				<div class="col-sm-12">
					<div class="form-group">
						<label class="col-sm-2 control-label">验证码：</label>
						<div class="col-sm-10">
							'. Area::VerCode('dealForm') .'
						</div>
					</div>
				</div>
			</div>
			';
		}
		$retStr .= '
		<div class="row">
			<div class="col-sm-12">
				<div class="form-group">
					<label class="col-xs-2 control-label"></label>
					<div class="col-xs-10">
                       	<input type="submit" value=" '. $mudiCN .' " class="btn btn-info m-r-5" />
						<span id="loadingStr"></span>
					</div>
				</div>
			</div>
		</div>

		</form>

		<script language="javascript" type="text/javascript">
		LoadEditor("content",0,800,"");
		try {
			CheckFile();
		}catch (e) {}
		try {
			CheckAddition();
		}catch (e) {}
		try {
			CheckCheckUser();
		}catch (e) {}
		try {
			$("#img").on("mouseover", function() {

				}).on("mouseenter", function() { 
					$("#imgView").css({"display":""});
					$id("imgView").src=$id("infoFileDir").value + $id("img").value;
				}).on("mouseleave", function(){
					$("#imgView").css({"display":"none"});
			});
		}catch (e) {}
		</script>
		';

		return $retStr;
	}



	// 文章管理
	public static function Manage(){
		global $DB,$mudi,$userRow,$userSysArr,$webPathPart;

		if (! self::Jud()){
			return '<div class="hui-alert hui-alert-danger">文章功能已关闭，有问题请联系管理员</div>';
		}

		$UE_ID		= $userRow['UE_ID'];

		$refTypeStr	= OT::GetRegExpStr('refTypeStr','sql+,');
	//	$refState	= OT::GetInt('refState',-1);
		$refTheme	= OT::GetRegExpStr('refTheme','sql');
		$refSource	= OT::GetRegExpStr('refSource','sql');
		$refWriter	= OT::GetRegExpStr('refWriter','sql');

		$SQLstr='select IF_ID,IF_theme,IF_time,IF_infoTypeDir,IF_datetimeDir,IF_readNum,IF_replyNum,IF_isAudit,IF_isGetScore,IF_auditNote from '. OT_dbPref .'info where IF_userID='. $UE_ID .'';

		if ($refTypeStr != ''){ $SQLstr .= " and IF_typeStr like '%". $DB->ForStr($refTypeStr,false) ."%'"; }
	//	if ($refState > -1){ $SQLstr .= " and IF_state=". $refState; }
		if ($refTheme != ''){ $SQLstr .= " and IF_theme like '%". $DB->ForStr($refTheme,false) ."%'"; }
		if ($refSource != ''){ $SQLstr .= " and IF_source like '%". $DB->ForStr($refSource,false) ."%'"; }
		if ($refWriter != ''){ $SQLstr .= " and IF_writer like '%". $DB->ForStr($refWriter,false) ."%'"; }

		$newsDelScoreArr = Users::ScoreArr('newsDel');

		$announ = '';
		if (strlen(trim(''. Str::RegExp($userSysArr['US_newsMngAnnoun'],'html'))) >= 3){
			$announ = '<div class="announ hui-alert hui-alert-danger">'. $userSysArr['US_newsMngAnnoun'] .'</div>';
		}

		$retStr = '
		<script language="javascript" type="text/javascript" src="js/usersNews.js?v='. OT_VERSION .'"></script>

		<input type="hidden" id="isScore1" name="isScore1" value="'. $userSysArr['US_isScore1'] .'" />
		<input type="hidden" id="isScore2" name="isScore2" value="'. $userSysArr['US_isScore2'] .'" />
		<input type="hidden" id="isScore3" name="isScore3" value="'. $userSysArr['US_isScore3'] .'" />
		<input type="hidden" id="score1Name" name="score1Name" value="'. $userSysArr['US_score1Name'] .'" />
		<input type="hidden" id="score2Name" name="score2Name" value="'. $userSysArr['US_score2Name'] .'" />
		<input type="hidden" id="score3Name" name="score3Name" value="'. $userSysArr['US_score3Name'] .'" />
		<input type="hidden" id="delScore1" name="delScore1" value="'. $newsDelScoreArr['US_score1'] .'" />
		<input type="hidden" id="delScore2" name="delScore2" value="'. $newsDelScoreArr['US_score2'] .'" />
		<input type="hidden" id="delScore3" name="delScore3" value="'. $newsDelScoreArr['US_score3'] .'" />

		'. $announ .'
		<div class="m-b-10">
			<form id="refForm" name="refForm" method="get" action="" onsubmit="return CheckRefNewsForm()">
			<input type="hidden" name="mudi" value="'. $mudi .'" />
			栏目：<select id="refTypeStr" name="refTypeStr" style="width:150px;display:inline" class="form-control m-r-5 m-b-5">
				<option value=""></option>
				';
				$typeNum = 0;
				$typeexe = $DB->query('select * from '. OT_dbPref .'infoType where IT_state=1 and IT_level=1 and IT_isUser=1 order by IT_rank ASC');
					while ($row = $typeexe->fetch()){
						$retStr .= '<option value=",'. $row['IT_ID'] .'," '. Is::InstrSelected($refTypeStr,','. $row['IT_ID'] .',') .'>'. $typeNum .'、'. $row['IT_theme'] .'</option>';

						$typeNum ++;
						$type2exe = $DB->query('select * from '. OT_dbPref .'infoType where IT_state=1 and IT_level=2 and IT_fatID='. $row['IT_ID'] .' and IT_isUser=1 order by IT_rank ASC');
							while ($row2 = $type2exe->fetch()){
								$retStr .= '<option value=",'. $row['IT_ID'] .','. $row2['IT_ID'] .'," '. Is::InstrSelected($refTypeStr,','. $row2['IT_ID'] .',') .'>&ensp;&ensp;&ensp;┣&ensp;'. $row2['IT_theme'] .'</option>';
							}
						$type2exe = null;
					}
				unset($typeexe);

				$retStr .= '
				</select>
			标题：<input type="text" id="refTheme" class="form-control m-r-5 m-b-5" name="refTheme" style="width:120px;display:inline;" value="'. $refTheme .'" />
			来源：<input type="text" id="refSource" class="form-control m-r-5 m-b-5" name="refSource" style="width:70px;display:inline;" value="'. $refSource .'" />
			作者：<input type="text" id="refWriter" class="form-control m-r-5 m-b-5" name="refWriter" style="width:70px;display:inline;" value="'. $refWriter .'" />
			<input type="submit" value="查 询" class="btn btn-info m-r-5 m-b-5 m-b-5" />
			<input type="button" value="重 置" onclick=\'document.location.href="?m=newsManage";\' class="btn btn-warning m-b-5" />
			</form>
		</div>

		<div class="table-responsive">
			<table class="table table-hover">
			<thead>
			<tr>
				<th>编号</th>
				<th>标题</th>
				<th>阅读量</th>
				<th>评论数</th>
				<th>状态</th>
				<th>发布时间</th>
				<th>操作</th>
			</tr>
			</thead>
			';
		$pageSize	= $userRow['UE_pageNum'];	// 每页条数
		$page		= OT::GetInt('page');
		$showRow=$DB->GetLimit($SQLstr .' order by IF_time DESC',$pageSize,$page);
		if (! $showRow){
			$retStr .= '</table></div><div class="hui-alert hui-alert-info">暂无内容</div>';
			return $retStr;
		}else{
			$recordCount=$DB->GetRowCount();
			$pageCount=ceil($recordCount/$pageSize);
			if ($page < 1 || $page > $pageCount){$page=1;}

			$retStr .= '<tbody>';
			$number=1+($page-1)*$pageSize;
			$rowCount = count($showRow);
			for ($i=0; $i<$rowCount; $i++){
				if ($i % 2 == 1){ $bgcolor='class="tabColorTr"'; }else{ $bgcolor=''; }
				$newsBtn = $auditNote = '';
				if ($showRow[$i]['IF_isAudit'] == 1){
					$auditCN = '<span style="color:green;">已审核</span>';
					$newsBtn = '<a class="m-r-5" href="'. Url::NewsID($showRow[$i]['IF_infoTypeDir'],$showRow[$i]['IF_datetimeDir'],$showRow[$i]['IF_ID'],0,UcBase::PcWapParDir()) .'" target="_blank">查看</a>';
				}elseif ($showRow[$i]['IF_isAudit'] == 2){
					$auditCN = '<span style="color:red;">被拒绝</span>';
					$auditNote = '<div style="padding-top:3px;color:red;">被拒绝原因：'. $showRow[$i]['IF_auditNote'] .'</div>';
				}else{
					$auditCN = '<span style="color:#000;">待审核</span>';
				}
				if ($userSysArr['US_isNewsAuditLook'] == 1 && strlen($newsBtn) == 0){
					$newsBtn = '<a class="m-r-5" href="'. UcBase::PcWapParDir() .'news/?'. $showRow[$i]['IF_ID'] .'.html&rnd=user'. $UE_ID .'" target="_blank">查看</a>';
				}
				$retStr .= '
				<tr id="data'. $showRow[$i]['IF_ID'] .'" '. $bgcolor .'>
					<td>'. $number .'</td>
					<td style="word-break:break-all;padding:5px;">'. $showRow[$i]['IF_theme'] . $auditNote .'</td>
					<td>'. $showRow[$i]['IF_readNum'] .'</td>
					<td>'. $showRow[$i]['IF_replyNum'] .'</td>
					<td>'. $auditCN .'</td>
					<td>'. TimeDate::Get('datetime3',$showRow[$i]['IF_time']) .'</td>
					<td>
						'. $newsBtn .'
                    	<a class="m-r-5" href="usersCenter.php?m=revNews&dataID='. $showRow[$i]['IF_ID'] .'">编辑</a>
                    	<a class="m-r-5" href="javascript:void(0);" onclick="DelNews('. $showRow[$i]['IF_ID'] .','. $showRow[$i]['IF_isGetScore'] .');return false;">删除</a>
					</td>
				</tr>
				';
				$number ++;
			}
		}
		unset($showRow);

		$retStr .= '
		</tbody></table></div>

		'. UcBase::Nav($page, $pageCount, $pageSize, $recordCount) .'
		';

		return $retStr;
	}


	// css display:none
	public static function CssDisplay($event, $str){
		if (strpos($event, '|'. $str .'|') !== false){
			return 'display:none;';
		}else{
			return '';
		}
	}

}
?>