<?php  
//php判断客户端是否为手机  
$agent = $_SERVER['HTTP_USER_AGENT'];  
if(strpos($agent,"NetFront") || strpos($agent,"iPhone") || strpos($agent,"MIDP-2.0") || strpos($agent,"Opera Mini") || strpos($agent,"UCWEB") || strpos($agent,"Android") || strpos($agent,"Windows CE") || strpos($agent,"SymbianOS"))  
header("Location:m.php");  
?>
<?php
/*include './IP.class.php';   
$iplocation = new IpLocation();   */
require_once('include/config.php');
session_start();
//echo $_SESSION['checkcode'];

//===================================
//
// 功能：IP地址获取真实地址函数
// 参数：$ip - IP地址
//
//===================================
function convertip($ip) {
    //IP数据文件路径
    $dat_path = './qqwry.dat';

    //检查IP地址
    /*if(!preg_match("/^d{1,3}.d{1,3}.d{1,3}.d{1,3}$/", $ip)) {
        return 'IP Address Error';
    }*/
    
    //打开IP数据文件
    if(!$fd = @fopen($dat_path, 'r')){
        return 'IP date file not exists or access denied';
    }

    //分解IP进行运算，得出整形数
    $ip = explode('.', $ip);
    $ipNum = $ip[0] * 16777216 + $ip[1] * 65536 + $ip[2] * 256 + $ip[3];

    //获取IP数据索引开始和结束位置
    $DataBegin = fread($fd, 4);
    $DataEnd = fread($fd, 4);
    $ipbegin = implode('', unpack('L', $DataBegin));
    if($ipbegin < 0) $ipbegin += pow(2, 32);
    $ipend = implode('', unpack('L', $DataEnd));
    if($ipend < 0) $ipend += pow(2, 32);
    $ipAllNum = ($ipend - $ipbegin) / 7 + 1;
   
    $BeginNum = 0;
    $EndNum = $ipAllNum;

    //使用二分查找法从索引记录中搜索匹配的IP记录
    while($ip1num>$ipNum || $ip2num<$ipNum) {
        $Middle= intval(($EndNum + $BeginNum) / 2);

        //偏移指针到索引位置读取4个字节
        fseek($fd, $ipbegin + 7 * $Middle);
        $ipData1 = fread($fd, 4);
        if(strlen($ipData1) < 4) {
            fclose($fd);
            return 'System Error';
        }
        //提取出来的数据转换成长整形，如果数据是负数则加上2的32次幂
        $ip1num = implode('', unpack('L', $ipData1));
        if($ip1num < 0) $ip1num += pow(2, 32);
       
        //提取的长整型数大于我们IP地址则修改结束位置进行下一次循环
        if($ip1num > $ipNum) {
            $EndNum = $Middle;
            continue;
        }
        //取完上一个索引后取下一个索引
        $DataSeek = fread($fd, 3);
        if(strlen($DataSeek) < 3) {
            fclose($fd);
            return 'System Error';
        }
        $DataSeek = implode('', unpack('L', $DataSeek.chr(0)));
        fseek($fd, $DataSeek);
        $ipData2 = fread($fd, 4);
        if(strlen($ipData2) < 4) {
            fclose($fd);
            return 'System Error';
        }
        $ip2num = implode('', unpack('L', $ipData2));
        if($ip2num < 0) $ip2num += pow(2, 32);

        //没找到提示未知
        if($ip2num < $ipNum) {
            if($Middle == $BeginNum) {
                fclose($fd);
                return 'Unknown';
            }
            $BeginNum = $Middle;
        }
    }
    //下面的代码读晕了，没读明白，有兴趣的慢慢读
    $ipFlag = fread($fd, 1);
    if($ipFlag == chr(1)) {
        $ipSeek = fread($fd, 3);
        if(strlen($ipSeek) < 3) {
            fclose($fd);
            return 'System Error';
        }
        $ipSeek = implode('', unpack('L', $ipSeek.chr(0)));
        fseek($fd, $ipSeek);
        $ipFlag = fread($fd, 1);
    }

    if($ipFlag == chr(2)) {
        $AddrSeek = fread($fd, 3);
        if(strlen($AddrSeek) < 3) {
            fclose($fd);
            return 'System Error';
        }
        $ipFlag = fread($fd, 1);
        if($ipFlag == chr(2)) {
            $AddrSeek2 = fread($fd, 3);
            if(strlen($AddrSeek2) < 3) {
                fclose($fd);
                return 'System Error';
            }
            $AddrSeek2 = implode('', unpack('L', $AddrSeek2.chr(0)));
            fseek($fd, $AddrSeek2);
        } else {
            fseek($fd, -1, SEEK_CUR);
        }

        while(($char = fread($fd, 1)) != chr(0))
            $ipAddr2 .= $char;

        $AddrSeek = implode('', unpack('L', $AddrSeek.chr(0)));
        fseek($fd, $AddrSeek);

        while(($char = fread($fd, 1)) != chr(0))
            $ipAddr1 .= $char;
    } else {
        fseek($fd, -1, SEEK_CUR);
        while(($char = fread($fd, 1)) != chr(0))
            $ipAddr1 .= $char;

        $ipFlag = fread($fd, 1);
        if($ipFlag == chr(2)) {
            $AddrSeek2 = fread($fd, 3);
            if(strlen($AddrSeek2) < 3) {
                fclose($fd);
                return 'System Error';
            }
            $AddrSeek2 = implode('', unpack('L', $AddrSeek2.chr(0)));
            fseek($fd, $AddrSeek2);
        } else {
            fseek($fd, -1, SEEK_CUR);
        }
        while(($char = fread($fd, 1)) != chr(0)){
            $ipAddr2 .= $char;
        }
    }
    fclose($fd);

    //最后做相应的替换操作后返回结果
    if(preg_match('/http/i', $ipAddr2)) {
        $ipAddr2 = '';
    }
    $ipaddr = "$ipAddr1 $ipAddr2";
    $ipaddr = preg_replace('/5kun.com/is', '', $ipaddr);
    $ipaddr = preg_replace('/^s*/is', '', $ipaddr);
    $ipaddr = preg_replace('/s*$/is', '', $ipaddr);
    if(preg_match('/http/i', $ipaddr) || $ipaddr == '') {
        $ipaddr = 'Unknown';
    }
    $ipaddr=iconv('gb2312', 'utf-8', $ipaddr);
    preg_match('/(.*?)省/',$ipaddr,$city1);
    preg_match('/省(.*?市)/',$ipaddr,$city2);
	$city1[0]=str_replace('省','',$city1[0]);
	$city2[0]=str_replace('省','',$city2[0]);
	$city2[0]=str_replace('市','',$city2[0]);
	if(!($city1[0]=="" && $city2[0]=="")){
		return $city1[0]." · ".$city2[0] ."　　";
	}else{
		return $ipaddr."　　";
	}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Keywords" content="互动客厅,王小困互动客厅,王坤互动客厅,WKUN互动客厅,设计师王坤,王坤,湖南王坤,长沙王坤">
<meta name="description" content="王小困设计（互动客厅）是设计师王坤个人网站 WKUN DESIGN 的设计交流平台，我们对话讨论一切有关设计的话题。">
<title>互动客厅 - 王小困</title>
<link rel="stylesheet" type="text/css" href="css/index_v4.css">
<link rel="stylesheet" type="text/css" href="../css/global_2017.css">
<link rel="apple-touch-icon-precomposed" href="../images/touch-icon-new-ipad.png" />
<script src="https://www.layuicdn.com/layui/layui.js"></script>
<script type="text/javascript">
    layui.use(['laydate', 'laypage', 'layer', 'table', 'carousel', 'upload', 'element'], function() {
      var layer = layui.layer 
      ,upload = layui.upload //上传
      ,element = layui.element;
    //   layer.msg('Hello World');

      var uploadInst = upload.render({
        elem: '.upload' //绑定元素
        ,url: './up/up.php' //上传接口
        ,done: function(res){
          //上传完毕回调
            $("#picpath").val(res.data.src) 
            $(".shopimg").attr("src",'./images/upload/'+res.data.src);
            $("#gn_photo_3").css('display','block'); 
            $(".gn_photo_line").css('display','none');
        }
        ,error: function(){
          //请求异常回调
        }
      });
    });
</script>
<!--统计代码-->
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?976932debf26dfee0edee7a03fa1f72f";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>
</head>
<script>
lastScrollY=0;
function heartBeat(){
var diffY;
if (document.documentElement && document.documentElement.scrollTop)
diffY = document.documentElement.scrollTop;
else if (document.body)
diffY = document.body.scrollTop
else
{/*Netscape stuff*/}
percent=.1*(diffY-lastScrollY);
if(percent>0)percent=Math.ceil(percent);
else percent=Math.floor(percent);
document.getElementById("full").style.top=parseInt(document.getElementById("full").style.top)+percent+"px";
lastScrollY=lastScrollY+percent;
if(diffY == 0){document.getElementById("full").style.display = "none"}
else{document.getElementById("full").style.display = "block"}
}
suspendcode="<div id=\"full\" style='display:none; width:54px; height:54px; POSITION:absolute; left:50%; position:fixed; bottom:60px; margin-left:-22px; background-color: #FFF; box-shadow: 0 16px 80px rgba(0,0,0,.50); opacity: 0.90; border-radius: 54px; z-index:100; text-align:center;'><a href='#' title=返回顶部><img src='images/six/m/up_2.png' border=0 width=54 height=54 alt='返回顶部'></a></div>"
document.write(suspendcode);
window.setInterval("heartBeat()",1);
</script>
<script type="text/JavaScript">
function checkdata() 
{ 
first=document.message.content.value; 
second=document.message.username.value;
if(first=='写下你想说的，开始我们的对话'||second=='你的名字') 
{ 
	alert("所发布的内容和昵称不能为空"); 
return false; 
} 
else 
	document.message.submit(); 
} 
function textCounter(field, maxlimit) { 
 var str=field.value;
  var a=str.match(/[^\x00-\xff]|\w{1,2}/g);
  if (a.length > maxlimit)
	 field.value = a.length<maxlimit?str:a.slice(0,maxlimit).join("");	
  //else 
   //document.WRITEMSGTXT.remLen.value = maxlimit - a.length; 
 } 
</script> 
<body>
<!--顶部输入框开始-->

<!--导航-->
<div class="two_topk">
  <div class="two_top">
        <div class="two_logo"><a href="../" title="WKUN DESIGN - 王坤设计 / 王小困设计"></a></div>
        <div class="two_nav">
          <div class="two_nav_dhrs"><a href="../book" title="互动客厅 - 王小困"></a></div>
          <div class="two_nav_x"></div>
          <div class="two_nav_design"><a href="../design" title="设计作品 - 王小困"></a></div>
      </div>
  </div>
</div>
<div class="two_no"></div>
<!--顶部输入框结束-->
<!--留言列表开始-->
<div class="book_z">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top">
    <div class="list_z">
    <div class="top_y">
<form action="index_keting.php?act=index_keting" method="post" name="message">
    <input type="hidden" id="uploadmark">
    <input type="hidden" id="picpath" name="img">
        <div class="input_box">
        <div class="input_box2">
          <textarea name="content" cols="" rows=""  class="input scrollbar" id="content" onpropertychange="textCounter(this, 500)" onfocus="if (value =='写下你想说的，开始我们的对话'){value =''}" onblur="if (value ==''){value='写下你想说的，开始我们的对话'}">写下你想说的，开始我们的对话</textarea>
        </div>
          <div class="input_ok">
          <div class="function" style="position:relative;">
                    <div id="biaoqing">
                        <div id="function_close"><a href="javascript:;" id="bq_close" title="关闭"></a></div>
                        <div class="bq_line">
                          <dl>
                            <dd class="expression"><a href="javascript:;" title="微笑"><img src="images/six/bq/wx.gif"></a></dd>
                            <dd class="expression"><a href="javascript:;" title="晕"><img src="images/six/bq/y.gif"></a></dd>
                            <dd class="expression"><a href="javascript:;" title="心花怒放"><img src="images/six/bq/xhnf.gif"></a></dd>
                            <dd class="expression"><a href="javascript:;" title="鼓掌"><img src="images/six/bq/gz.gif"></a></dd>
                            <dd class="expression"><a href="javascript:;" title="哈欠"><img src="images/six/bq/hax.gif"></a></dd>
                            <dd class="expression"><a href="javascript:;" title="憨笑"><img src="images/six/bq/sx.gif"></a></dd>
                            <dd class="expression"><a href="javascript:;" title="汗"><img src="images/six/bq/han.gif"></a></dd>
                            <dd class="expression"><a href="javascript:;" title="吃惊"><img src="images/six/bq/cj.gif"></a></dd>
                            <dd class="expression"><a href="javascript:;" title="鄙视"><img src="images/six/bq/bs.gif"></a></dd>
                            <dd class="expression"><a href="javascript:;" title="闭嘴"><img src="images/six/bq/bz.gif"></a></dd>
                            <dd class="expression"><a href="javascript:;" title="呲牙"><img src="images/six/bq/cy.gif"></a></dd>
                            <dd class="expression"><a href="javascript:;" title="害羞"><img src="images/six/bq/hx.gif"></a></dd>
                            <dd class="expression"><a href="javascript:;" title="衰"><img src="images/six/bq/shuai.gif"></a></dd>
                            <dd class="expression"><a href="javascript:;" title="偷笑"><img src="images/six/bq/tx.gif"></a></dd>
                            <dd class="expression"><a href="javascript:;" title="折磨"><img src="images/six/bq/zm.gif"></a></dd>
                            <dd class="expression"><a href="javascript:;" title="难过"><img src="images/six/bq/ng.gif"></a></dd>
                            <dd class="expression"><a href="javascript:;" title="示爱"><img src="images/six/bq/sa.gif"></a></dd>
                            <dd class="expression"><a href="javascript:;" title="可爱"><img src="images/six/bq/ka.gif"></a></dd>
                            <dd class="expression"><a href="javascript:;" title="泪"><img src="images/six/bq/lei.gif"></a></dd>
                            <dd class="expression"><a href="javascript:;" title="酷"><img src="images/six/bq/cool.gif"></a></dd>
                            <dd class="expression"><a href="javascript:;" title="发呆"><img src="images/six/bq/fd.gif"></a></dd>
                            <dd class="expression"><a href="javascript:;" title="敲打"><img src="images/six/bq/qd.gif"></a></dd>
                            <dd class="expression"><a href="javascript:;" title="再见"><img src="images/six/bq/zj.gif"></a></dd>
                            <dd class="expression"><a href="javascript:;" title="强"><img src="images/six/bq/qiang.gif"></a></dd>
                            <dd class="expression"><a href="javascript:;" title="差劲"><img src="images/six/bq/cha.gif"></a></dd>
                            <dd class="expression"><a href="javascript:;" title="顶你"><img src="images/six/bq/ding.gif"></a></dd>
                            <dd class="expression"><a href="javascript:;" title="勾引"><img src="images/six/bq/gy.gif"></a></dd>
                            <dd class="expression"><a href="javascript:;" title="耶"><img src="images/six/bq/ye.gif"></a></dd>
                          </dl>
                        </div>
                    </div>
                    <div id="gn_photo">
                        <div class="gn_photo_line">
                            <div id="function_close"><a href="javascript:;" title="关闭" id="ph_close"></a></div>
                          <dl>
                            <dd class="tips">上传本地图片不能超过10M</dd>
                            <dd class="upload"><a href="javascript:;" title="上传图片">上传图片</a></dd>
                            <dd class="link"><a href="javascript:;" title="图片链接" id="show_url">图片链接</a></dd>
                          </dl>
                        </div> 
                            <div id="gn_photo_2">
                                <div id="function_close"><a href="javascript:;" title="关闭" id="url_close"></a></div>
                                <div class="gn_photo_link">
                                  <dl>
                                    <dd class="p_input"><input  type="text" class="photo_input" id="photo_url"></dd>
                                    <dd class="p_submit"><input name="photo_submit" type="button" class="photo_submit" value="确定">
                                    </dd>
                                  </dl>
                                </div>
                            </div>

                        <div id="gn_photo_3">
                            <div id="function_close"><a href="javascript:;" title="关闭" class="pic_close"></a></div>
                            <div class="gn_photo_img"><img class="shopimg" src=""></div>
                        </div>

                        <div id="gn_photo_4">
                            <div id="function_close"><a id="del_close" href="javascript:;" title="关闭"></a></div>
                            <div class="gn_photo_img">
                              <dl>
                                <dd class="tips2">确定删除吗？</dd>
                                <dd class="submit2"><a href="javascript:;" title="确定" id="ajax_del">确定</a></dd>
                              </dl>
                            </div>
                        </div>
                    </div>
                <dl>
                    <dd class="bq"><a href="javascript:;" id="show_bq" title="加入表情"></a></dd>
                    <dd class="img"><a href="javascript:;" title="添加图片" id="show_ph"></a></dd>
                </dl>
          </div>
          <div class="input_submit">
              <input  type="submit" class="botton" onClick="return checkdata();" value="发 布" />
            </div>
            <div class="input_name"><input name="username" type="text" class="name" id="username" value="<?php echo $_COOKIE['uu']?$_COOKIE['uu']:'你的名字'; ?>" onPropertyChange="textCounter(this, 6)" onfocus="if (value =='你的名字'){value =''}" onblur="if (value ==''){value='你的名字'}" />
          </div>
        </div>
        </div>
        </form>
    </div>
    <div class="book_ad" style="display:none;"><a href="../zt/5" title="进入5年5KUN" target="_blank"><img src="../book/images/six/five_years.gif"/></a></div>
    <div class="list_user" style="display:none;">
                    <div class="list_user_z"><a href="../t" title="王坤的社交媒体" target="_blank"><img src="images/six/wangkun.jpg" width="49" height="49" /></a></div>
<div class="list_user_content">
                       <div class="list_user_content_top">
                       <div class="list_user_content_message">
                         <p><a href="../t" title="王坤的社交媒体" target="_blank">王坤：</a>4年，当初的自己甚至不知道能不能将一件事情坚持4年，5KUN是我设计生涯中一个出彩的决定，让我认识你们，让我更加了解自己。这是一个桥梁，连接着自己与每一个你、每一次沟通，它促使我必须要更加努力，这使得我更有动力去继续做这件事，5・20四周年</p>
                     </div>
<div class="list_user_content_reply3">
                           <div class="list_user_content_no"></div>
                     </div>
                     <div class="content_information_me">
                     <div class="content_information_me_z" style="display:none;"><a href="https://weibo.com/wkun" title="王坤的新浪微博" target="_blank">新浪微博</a> | <a href="../book/me" title="这些年，那些话" target="_blank">《这些年，那些话》</a> | <a href="../zt/2" title="想象人生两周年" target="_blank">两周年</a></div>
                     <div class="content_information_me_y">置顶楼 | 05月19日</div>
                     </div>
                     <div class="list_user_content_d"></div>
                     </div>
            </div>
            <div class="fix"></div>
  </div>
 <?php
$page=isset($_GET['page'])?intval($_GET['page']):1;
$num=50;
$soa='';
$offset=($page-1)*$num;
$s = @addslashes($_GET['so']);  
if($s){
    $total=mysql_num_rows(mysql_query("select * from book where username like '%".$s."%' or content like '%".$s."%' or reply like '%".$s."%' or dream like '%".$s."%' or ip like '%".$s."%' or posttime like '%".$s."%'"));
    $soa = '&so='.$s; 
}else{
$total=mysql_num_rows(mysql_query("select * from book"));
}
$pagenum=ceil($total/$num);

if($page>$pagenum || $page==0)
{
    //header("location:index.php?page=1");
}
else{ 
    if ( $s ){
        $row=mysql_query("select * from book where username like '%".$s."%' or content like '%".$s."%' or reply like '%".$s."%' or dream like '%".$s."%' or ip like '%".$s."%' or posttime like '%".$s."%' order by id desc limit $offset,$num");
    }else{
$row=mysql_query("select * from book order by id desc limit $offset,$num");
} 
$row1=mysql_num_rows(mysql_query("select * from book order by id"));
$a = ($row1-(($page-1)*$num))+1;
if ( $s ){
$a = ($total-(($page-1)*$num))+1;
}
 //$a = ($page-1)*$num;
 
    //内容表情
    $arr = array(
        '[beautymeaning]'=>'images/six/bq/beautymeaning.gif',
        '[共成]'=>'images/six/bq/gchd.gif',
        '[新技能]'=>'images/six/bq/jineng.gif',
        '[湖南卫视]'=>'images/six/bq/hntv.gif',
        '[晕]'=>'images/six/bq/y.gif',
        '[微笑]'=>'images/six/bq/wx.gif',
        '[心花怒放]'=>'images/six/bq/xhnf.gif',
        '[鼓掌]'=>'images/six/bq/gz.gif',
        '[哈欠]'=>'images/six/bq/hax.gif',
        '[憨笑]'=>'images/six/bq/sx.gif',
        '[汗]'=>'images/six/bq/han.gif',
        '[吃惊]'=>'images/six/bq/cj.gif',
        '[鄙视]'=>'images/six/bq/bs.gif',
        '[闭嘴]'=>'images/six/bq/bz.gif',
        '[呲牙]'=>'images/six/bq/cy.gif',
        '[害羞]'=>'images/six/bq/hx.gif',
        '[衰]'=>'images/six/bq/shuai.gif',
        '[偷笑]'=>'images/six/bq/tx.gif',
        '[折磨]'=>'images/six/bq/zm.gif',
        '[难过]'=>'images/six/bq/ng.gif',
        '[示爱]'=>'images/six/bq/sa.gif',
        '[可爱]'=>'images/six/bq/ka.gif',
        '[泪]'=>'images/six/bq/lei.gif',
        '[酷]'=>'images/six/bq/cool.gif',
		'[发呆]'=>'images/six/bq/fd.gif',
		'[强]'=>'images/six/bq/qiang.gif',
		'[敲打]'=>'images/six/bq/qd.gif',
		'[再见]'=>'images/six/bq/zj.gif',
		'[差劲]'=>'images/six/bq/cha.gif',
		'[顶你]'=>'images/six/bq/ding.gif',
		'[勾引]'=>'images/six/bq/gy.gif',
		'[耶]'=>'images/six/bq/ye.gif'
    );
while($rs=mysql_fetch_array($row))
{
    foreach( $arr as $key=>$v ){
          $rs['content'] = str_replace($key,'<img src="'.$v.'" />',$rs['content']);
          $rs['reply'] = str_replace($key,'<img src="'.$v.'" />',$rs['reply']);
          }
//$a=$a+1;
$a=$a-1;
?>
      <div class="list_user_content">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="108" valign="top">
<div class="list_user_zdy"><a href="../book/?so=<?php echo $rs['username'];?>" title="只看有关“<?php echo $rs['username'];?>”的对话"><?php echo $rs['user_img'];?></a></div>
<div class="list_user_z">
					<?php
                      srand( microtime() * 10000000 );
                      $num = rand( 1, 7 );
                        
                      switch( $num )
                      {
                      case 1: $image_file = "images/six/user_2020_01.jpg";
                              break;
                      case 2: $image_file = "images/six/user_2020_02.jpg";
                              break;
                      case 3: $image_file = "images/six/user_2020_03.jpg";
                              break;
                      case 4: $image_file = "images/six/user_2020_04.jpg";
                              break;
                      case 5: $image_file = "images/six/user_2020_05.jpg";
                              break;
                      case 6: $image_file = "images/six/user_2020_06.jpg";
                              break;
                      case 7: $image_file = "images/six/user_2020_07.jpg";
                              break;
                      }
                      echo "<img src=$image_file />";
                    ?>
            </div>    </td>
    <td>
    <div class="list_user_content_top">
                   <div class="list_user_content_message">
                   <a href="../book/?so=<?php echo $rs['username'];?>" title="只看有关“<?php echo $rs['username'];?>”的对话"><?php echo $rs['username'];?><?php echo $rs['verify'];?></a>：<?php echo $rs['content'];?>
                   </div>
                   <?php if($rs['reply']){
					   echo "
					   <div class='list_user_content_reply2'>
                           <div class='reply_content'>".$rs['reply']." ／ ".substr($rs['replytime'],11,5)."</div>
					   </div>";
					   }
					   else
					   {
						   echo "<div class='list_user_content_reply3'>
                       <div class='list_user_content_no'></div>
                 </div>";
						   }
					   ?>
                   <div class="content_information_k">
                   <div class="content_information">
                   <?php echo substr($rs['posttime'],5,2),'月',substr($rs['posttime'],8,2),'日',substr($rs['posttime'],10,6);?>　　<?php if($rs['ip'] != ""){echo convertip($rs['ip']);}?><?php echo $rs['dream'];?>
				<?php if(isset($_SESSION['admin_name'])){?>　　<a href="msgreply.php?id=<?php echo $rs['id'];?>">回复</a>　　<a href="msgreply.php?act=del&id=<?php echo $rs['id'];?>" onClick="{if(confirm('您确定要删除此留言吗？')){return true;}return false;}">删除</a><?php }?></div>
					<div class="look_img"><?php if(!empty($rs['img'])){ ?><a href="<?php echo './images/upload/',$rs['img']; ?>" title="查看图片" target="_blank">查看图片</a><?php }else{echo '';} ?></div>
				   <div class="content_lc"><?php echo $a;?></div>
                   </div>
               </div></td>
  </tr>
</table>           
      <div class="fix"></div>
  </div>
    <?php
  } 
}
?>
</div>    </td>
    <td width="310" valign="top">
    <div class="wangkun_hi"><script language="javaScript">
		<!--
		now = new Date(),hour = now.getHours()
		if(hour < 6){document.write("早点休息吧，")}
		else if (hour < 9){document.write("早安！")}
		else if (hour < 12){document.write("上午好！")}
		else if (hour < 14){document.write("中午好！")}
		else if (hour < 17){document.write("下午好！")}
		else if (hour < 19){document.write("傍晚好！")}
		else if (hour < 22){document.write("晚上好，")}
		else {document.write("夜深了，")}
		// -->
		</script><a href="?so=<?php echo $_COOKIE['uu']?>" title="点击只看自己的对话"><strong><?php echo $_COOKIE['uu']?$_COOKIE['uu']:'我是王小困'; ?></strong></a>，欢迎你来到互动客厅，现在来与我对话吧。</div>
    <div class="list_y">
    <div class="search_top">
      <dl><form method="get" id="search">
        <dd class="s_input"><input type="text" class="search_input" id="photo_url" value="搜索你想要的" onfocus="if (value =='搜索你想要的'){value =''}" onblur="if (value ==''){value='搜索你想要的'}" /></dd>
        <dd class="s_submit"><a href="javascript:;" id="soso" title="搜索"></a></dd></form>
      </dl>
    </div>
    <div class="search_hot">
      <dl>
        <dd class="hot_wz">热搜</dd>
        <dd class="hot_keyword"><a href="?so=王小困" title="搜索王小困">王小困</a></dd>
        <dd class="hot_keyword"><a href="?so=微信" title="搜索来自微信的留言">微信</a></dd>
        <dd class="hot_keyword"><a href="?so=工作" title="搜索工作">工作</a></dd>
        <dd class="hot_keyword"><a href="?so=王坤" title="搜索王坤">王坤</a></dd>
      </dl>
    </div>
    <div class="search_hot">
      <dl>
        <dd class="hot_keyword"><a href="?so=色彩" title="搜索色彩">色彩</a></dd>
        <dd class="hot_keyword"><a href="?so=素材" title="搜索素材">素材</a></dd>
        <dd class="hot_keyword"><a href="?so=移动" title="搜索来自移动版的留言">移动版</a></dd>
        <dd class="hot_keyword"><a href="?so=设计分享" title="搜索设计分享">设计分享</a></dd>
      </dl>
    </div>
    <?php if($s){ ?>
    <div class="search_result">
      <dl>
        <dd class="result_key"><?php if ( !$s ) {echo '搜索一下'; }else{echo $s;} ?></dd>
        <dd class="result_close"><a href="../book/index.php" title="关闭返回"></a></dd>
        <dd class="result_quantity"><?php echo !empty($total)?$total:0; ?></dd>
        <dd class="result_tips">条相关对话 左侧为你呈现</dd>
      </dl>
    </div><?php } ?>
	<div class="youce_top">关注王坤微信公众号</div>
	<div class="wechat_qun">
	  <p><img src="images/six/wechat_wk.jpg" width="60%"/></p>
	  <p>微信搜索公众号：王小困</p>
	</div>
    <div class="youce_top">更好的推荐 给最好的你</div>
    <div class="recommend">
      <dl>
        <dd class="recommend_web">图片 - <a href="https://alpha.wallhaven.cc/" title="最伟大的高清图库站" target="_blank">Wallhaven</a></dd>
        <dd class="recommend_web">图片 - <a href="https://www.pexels.com/zh-cn/" title="可免费商用的高质量高清图" target="_blank">Pexels</a></dd>
		<dd class="recommend_web">摄影 - <a href="https://1x.com" title="拥有丰富分类的高质量高清图" target="_blank">1X.com</a></dd>
		<dd class="recommend_web">字体 - <a href="https://www.fonts.net.cn/" title="最全的字体下载网站" target="_blank">字体天下</a></dd>
        <dd class="recommend_web">灵感 - <a href="https://www.zcool.com.cn" title="最具人气的经验、分享与灵感平台" target="_blank">站酷ZCOOL</a></dd>
        <dd class="recommend_web">灵感 - <a href="https://www.behance.net/" title="Adobe官方设计分享网站" target="_blank">Behance</a></dd>
        <dd class="recommend_web">素材 - <a href="http://www.sccnn.com/" title="免费素材共享平台" target="_blank">素材中国</a></dd>
		<dd class="recommend_web">图标 - <a href="https://www.iconfont.cn/" title="最全矢量图标管理、交流平台" target="_blank">Iconfont</a></dd>
        <dd class="recommend_web">酷站 - <a href="https://www.awwwards.com/" title="评选全球设计最优秀的CSS3、HTML5网站" target="_blank">Awwwards</a></dd>
        <dd class="recommend_web">酷站 - <a href="https://cwd.68design.net/" title="拥有丰富分类的优秀网站推荐" target="_blank">68Design</a></dd>
		<dd class="recommend_web">抠图 - <a href="https://photoshop.adobe.com/" title="免费在线一键抠图" target="_blank">Photoshop</a></dd>
		<dd class="recommend_web">GIF - <a href="https://icons8.com/preloaders/" title="最强大的GIF、Loading自定义生成网站" target="_blank">Preloaders</a></dd>
      </dl>
      <div class="fix"></div>
    </div>
    <div class="youce_top">互动客厅 QQ群 （暂停加入）</div>
    <div class="qun">
      <dl>
        <dd class="qun1">26647298</dd>
        <dd class="qun_j"><a href="https://wp.qq.com/wpa/qunwpa?idkey=ecfca9bde381d811f6aa445410a2c3c343cd4ba8761048aa0107e2fccd7c89f9" title="加入互动客厅" target="_blank"></a></dd>
      </dl>
    </div>
    <div class="qun">
      <dl>
        <dd class="qun2">26647316</dd>
        <dd class="qun_j"><a href="https://wp.qq.com/wpa/qunwpa?idkey=c5e309516b9413e6949a923565d08423589c72a9327fc4c05ce0e0745dc1b083" title="加入互动客厅" target="_blank"></a></dd>
      </dl>
    </div>
    <div class="fb_weibo"><a href="https://widget.weibo.com/dialog/PublishWeb.php?default_text=%E8%BF%99%E6%98%AF%E4%B8%80%E6%9D%A1%E6%9D%A5%E8%87%AA%20WKUN%20%E7%9A%84%E5%BE%AE%E5%8D%9A&uid=1390455004&refer=y&language=zh_cn&uniqueID=15129838528291&app_src=1g7Iq2&button=pubilish" title="发布一条来自 WKUN 的微博" target="_blank"><img src="images/six/fb_weibo.png" width="29" height="24" /><strong>发布一条微博</strong></a></div>
    <div class="book7"><a href="../xiazai/book7.html" title="下载互动客厅 7.0 源码" target="_blank"></a></div>
    <div class="music"><a href="https://pan.baidu.com/s/1jG7Pynk" title="下载优秀的音乐素材" target="_blank"></a></div>
    <div class="xiazai_5kun"><a href="../xiazai/book3.html" title="下载互动客厅 3.0 源码" target="_blank"></a></div>
    <div class="m_5kun"><a href="../m" title="5KUN 移动版" target="_blank"></a></div>
    <div class="weixin_gz"><a href="../zt/weixin" title="来微信，来聊天" target="_blank"></a></div>
    <div class="banner"><a href="../design/old.html" title="5KUN Banner大合集" target="_blank"></a></div>
    <div class="font"><a href="https://pan.baidu.com/share/link?shareid=389418&uk=2114447430" title="前往下载王先生的字库" target="_blank"></a></div>
    <div class="book_weibo">WKUN.COM 互动客厅 2021</div>
</div>    </td>
  </tr>
</table>
</div>
    <div class="flip_z">
          <div class="pages"><a href="../book/" title="返回互动客厅首页">首页</a><?php
       echo "<a class=page>".$total." 条</a>";
           $sk = $page-1==0?1:$page-1;
         echo "<a class=page href='?page=".$sk.$soa."'>上一页</a>";
	   if($page>2 && $pagenum>=5)
				  {
					  echo "<a href='?page=1'".$soa." class=page>1</a><a href=''>...</a>";
				  }
	   if($pagenum>5)
	   {
			for($i=$page;$i<=$pagenum;$i++)
		   {
			  
			  if($i!=$page){
				  
				 echo "<a href='?page=".$i.$soa."' class=page>$i</a>";
				 if($i-$page>=5)
				 {
                     $sk = $page+1;
					 echo "<a href='?page=".$i.$soa."' class=page>...</a><a href='?page=".$pagenum.$soa."' class=page>".$pagenum."</a>";
                      echo "<a class=page href='?page=".$sk.$soa."'>下一页</a>";
					break;
				}
			  }
			  else{
				 echo "<b><a class='page active_pagea'>$i</a></b>";
			  }
			   
	   }
	   }
	   else
	   {
	   for($i=1;$i<=$pagenum;$i++)
	   {
	      if($i!=$page){
		     echo "<a href='?page=".$i.$soa."' class=page>$i</a>";
		
		  }
		  else{
		     echo "<b><a class=page>$i</a></b>";
		  }
	   }
	   }
	?>
          </div>
    </div>
    <!--留言列表结束-->
    <!--版权信息开始-->
<!--版权信息-->
<div class="copyright_k">
<div class="copyright">
  <div class="copyright_z">
        <dl>
        <dd class="copyright_wz"><a href="../about/index.html" target="_blank" title="关于 WKUN">关于 WKUN</a>　 　<a href="../time" target="_blank" title="记录">记录</a>　 　<a href="../about/copyright.html" target="_blank" title="版权声明">版权声明</a>　 　<a href="../about/links.html" target="_blank" title="友情链接">友情链接</a>　 　| 　　<a href="../about/contact.html" target="_blank" title="联系">联系</a>　 　<a href="../studio" target="_blank" title="合作">合作</a> 　　<a href="../about/jobs.html" target="_blank" title="工作机会">工作机会</a></dd>
        <dd class="m_icon"><a href="../m" target="_blank" title="WKUN 移动版">移动版</a></dd>
        </dl>
  </div>
    <div class="copyright_y">
      <div class="hda"><a href="../about/sjysj.html" title="湖南省文联设计艺术家协会会员" target="_blank">湖南省文联设计艺术家协会会员<br/>Hunan Designers Association</a></div>
    </div>
</div>
<div class="copyright_c">
<div class="copyright_icon">
        <dl>
        <dd class="c_wxk_logo"><a href="../about/index.html" target="_blank" title="王小困® 是王坤注册商标"></a>
        <dd class="c_wkun_logo"><a href="../" target="_blank" title="进入 WKUN.COM 首页"></a>
        </dl>
    </div>
<div class="copyright_certificate"><a href="https://beian.miit.gov.cn" target="_blank">湘ICP备07004809号-8</a>　　版权所有 © <a href="https://www.wkun.com/" target="_blank" title="王小困">王小困</a>　　Copyright © 2010 - <script>document.write( new Date().getFullYear() );</script> WKUN.com. All Rights Reserved.</div>
</div>
</div>
<!--版权信息结束-->
<script type="text/javascript" src="../js/jquery.min.js"></script> 
<script type="text/javascript" src="./up/up.min.js"></script> 
<script>
 //打开表情
$("#show_bq").click(function(){ 
    $("#biaoqing").css('display','block');
    $(".gn_photo_line").css('display','none');
     $("#gn_photo_2").css('display','none'); 
      $("#gn_photo_3").css('display','none');
      $("#gn_photo_4").css('display','none');
    if ( $("#content").val() == '写下你想说的，开始我们的对话' )
    {
        $("#content").val('');
    }
})
//关闭表情
$("#bq_close").click(function(){
     $("#biaoqing").css('display','none');
})
//选中表情
$(".bq_line").children().children().children().click(function(){ 
        var txt = $("#content").val(); 
        var att = '['+$(this).attr("title")+']';
        var res = txt+att; 
        $("#content").val(res);
})

//打开图片上传
$("#show_ph").click(function(){ 
    $(".gn_photo_line").css('display','block'); 
    $("#biaoqing").css('display','none');
    $("#gn_photo_2").css('display','none');
         $("#gn_photo_3").css('display','none');
         $("#gn_photo_4").css('display','none');
})
//关闭图片框
$("#ph_close").click(function(){
     $(".gn_photo_line").css('display','none'); 
})

//打开URL输入框
$("#show_url").click(function(){
    $("#gn_photo_2").css('display','block'); 
    $(".gn_photo_line").css('display','none');
})
//关闭URL框
$("#url_close").click(function(){
     $("#gn_photo_2").css('display','none');
})
//搜索提交
$("#soso").click(function(){
    if ($(".search_input").val()=='搜索你想要的')
    {
        alert('请输入关键词!');
        return false;
    }
    self.location="./index.php?so="+$(".search_input").val();
})
$(".search_input").keydown(function(e){ 
 var e = e || event;
var  keycode = e.which || e.keyCode;
 if (keycode==13) { 

        self.location="./index.php?so="+$(".search_input").val();
        return false;
 }
});
//远程图片提交
$(".photo_submit").click(function(){ 
    var url = $("#photo_url").val();
    $.ajax({ 
               type: "get", 
				url: "chkimg.php?url="+url, 
				dataType: "html", 
				success: function (data) {   
					if (data == "-1")
					{
						alert('请提交正确的图片地址');
						return false;
					}
					//开始替换节点
					$(".shopimg").attr("src",'./images/upload/'+data);
					$("#gn_photo_3").css('display','block');
					$("#gn_photo_2").css('display','none');
									$("#uploadmark").val("ok");
									$("#picpath").val(data);
					//$("#photo_url").val('获取成功');
				}, 
				error: function (XMLHttpRequest, textStatus, errorThrown) { 
						 
				} 
		}); 
})

//显示删除提示框
$(".pic_close").click(function(){
    $("#gn_photo_4").css('display','block');
})
 //关闭删除提示框
$("#del_close").click(function(){
    $("#gn_photo_4").css('display','none');
})
//删除
$("#ajax_del").click(function(){
    $("#gn_photo_4").css('display','none');
     $.ajax({ 
	   type: "get", 
			url: "chkimg.php?ajax_del="+$(".shopimg").attr("src"),
			dataType: "html", 
			success: function (data) {   
				if (data == "1")
				{
					alert('删除成功');
					$("#uploadmark").val('');
					$("#picpath").val('');

				
				//开始替换节点 
				$("#gn_photo_3").css('display','none');  
				}
			}, 
			error: function (XMLHttpRequest, textStatus, errorThrown) { 
					 
			} 
	});    
})
</script>
</body>
</html>