<?php
/**
	用户主页最新模板
**/
require_once(dirname(__FILE__)."/../qm_user/config.php");

//php 批量过滤post,get敏感数据
if (get_magic_quotes_gpc()) {
$_GET = stripslashes_array($_GET);
$_POST = stripslashes_array($_POST);
}
 
function stripslashes_array(&$array) {
while(list($key,$var) = each($array)) {
if ($key != 'argc' && $key != 'argv' && (strtoupper($key) != $key || ''.intval($key) == "$key")) {
if (is_string($var)) {
$array[$key] = stripslashes($var);
}
if (is_array($var))  {
$array[$key] = stripslashes_array($var);
}
}
}
return $array;
}
//--------------------------
 
// 替换HTML尾标签,为过滤服务
//--------------------------
function lib_replace_end_tag($str)
{
if (empty($str)) return false;
$str = htmlspecialchars($str);
$str = str_replace( '/', "", $str);
$str = str_replace("\\", "", $str);
$str = str_replace("&gt", "", $str);
$str = str_replace("&lt", "", $str);
$str = str_replace("<SCRIPT>", "", $str);
$str = str_replace("</SCRIPT>", "", $str);
$str = str_replace("<script>", "", $str);
$str = str_replace("</script>", "", $str);
$str=str_replace("select","select",$str);
$str=str_replace("join","join",$str);
$str=str_replace("union","union",$str);
$str=str_replace("where","where",$str);
$str=str_replace("insert","insert",$str);
$str=str_replace("delete","delete",$str);
$str=str_replace("update","update",$str);
$str=str_replace("like","like",$str);
$str=str_replace("drop","drop",$str);
$str=str_replace("create","create",$str);
$str=str_replace("modify","modify",$str);
$str=str_replace("rename","rename",$str);
$str=str_replace("alter","alter",$str);
$str=str_replace("cas","cast",$str);
$str=str_replace("&","&",$str);
$str=str_replace(">",">",$str);
$str=str_replace("<","<",$str);
$str=str_replace(" ",chr(32),$str);
$str=str_replace(" ",chr(9),$str);
$str=str_replace("    ",chr(9),$str);
$str=str_replace("&",chr(34),$str);
$str=str_replace("'",chr(39),$str);
$str=str_replace("<br />",chr(13),$str);
$str=str_replace("''","'",$str);
$str=str_replace("css","'",$str);
$str=str_replace("CSS","'",$str);
 
return $str;
 
}
if(is_numeric($channel)){
?>
document.getElementById("Comment").innerHTML="<?php
  $dsql->GetOne("select * from `#@__archives` WHERE channel='$channel' order by id DESC limit 8");
  $dsql->Execute('me');
  while ($row = $dsql->GetArray('me')){
	  if($row['flag'] == "c,p"){
		  	$tj = "<i class='tj'></i>";
		  }else{
			$tj = "";
		  }
		  if($row['litpic'] == ''){
			$row['litpic'] = $cfg_cmsurl."/images/defaultpic.gif";  
		   }
  ?><li><a href='<?php echo $cfg_cmsurl; ?>/moban/<?php echo $row['id']; ?>.html' target='_blank' title='<?php echo $row['title']; ?>'><img src='<?php echo $row['litpic']; ?>' height='100%' /><?php echo $tj; ?></a><span class='title' title='<?php echo $row['title']; ?>'><a href='<?php echo $cfg_cmsurl; ?>/moban/<?php echo $row['id']; ?>.html' target='_blank'><?php echo $row['title']; ?></a></span></li><?php
  }  print_r($row);
  
?>";
 
<?
}else{
	ShowMsg("非法操作！","javascript:window.close();");
	exit(0);
}
