抢先预览效果:

2023-05-13T07:04:11.png
2023-05-13T07:17:35.png

使用说明:

  • 1.将万物互联.zip上传至网站根目录解压出来
  • 2.把hulian.dll上传至根目录的Bin文件夹内
  • 3.在根目录App_Code文件夹的Include.aspx.cs文件第44行左右添加以下代码【顶部需要添加using HuLian;】:
    06701-24nads3arv3.png
     //跨区聊天室人数
            if(MyId != 0)
            {
               if(DK.ExecuteScalar("SELECT [id] FROM [wap_online] WHERE [id] = "+ MyId+" AND [yumin] = 'pcno.cn'") == null)
                {
                    DK.ExecuteNonQuery("INSERT INTO [wap_online] ([id],[yumin],[btype],[uidname]) VALUES ("+ MyId+",'pcno.cn','1','"+UserName(MyId)+"')");
                }
                else
                {
                    if (Request.RawUrl.IndexOf("/hl/bbs/ls/") !=0)//判断离开聊天室
                    {
               
                        if(Convert.ToInt32(DK.ExecuteScalar("SELECT [btype] FROM [wap_online] WHERE [id] = "+ MyId+" AND [yumin] = 'pcno.cn'")) ==2)
                        {
                            DK.ExecuteNonQuery("UPDATE [wap_online] SET [btype]=1,[uidname]='"+UserName(MyId)+"' WHERE [id] = "+ MyId+" AND [yumin] = 'pcno.cn'");
                        }
                    }
                }
            }
            DK.ExecuteNonQuery("UPDATE [wap_online] SET [btype]=1 WHERE [endtime]<'" + SvrTime.AddMinutes(-20) + "'");//更新在线
    //跨区聊天室人数结束
  • 4.在根目录xml/home/文件夹内的my_home.aspx.cs文件适当位置添加以下代码【顶部需要添加using HuLian;】:
//万物互联
int ROCount = (int)DK.ExecuteScalar("SELECT COUNT([bbsid]) FROM [wap_online] WHERE [btype]=2 AND [bbsid]=1");
TextString += "<br/><div class=\"hengxian\">\r\n";
TextString += "<b><a href=\"/hl/bbs/ls/room.aspx?id=1" + NuoHa.String1 + "\">万物互联</a> 在线(" + ROCount + ")人</b><br/>\r\n";
TextString += "</div>\r\n";
int nh = 0;
SqlDataReader Rs1 = DK.ExecuteReader("SELECT TOP 3 [uid],[vid],[type],[intro],[content],[addtime],[uyumin],[vyumin],[uidname],[vidname] FROM [wap_bbs_room_chat] WHERE [bid]=1 ORDER BY [id] DESC");
        while (Rs1.Read())
        {
            int uid = Convert.ToInt32(Rs1[0]);
            int vid = Convert.ToInt32(Rs1[1]);
            string uidname = NuoHa.ConToStr(Rs1[8]);
            string vidname = NuoHa.ConToStr(Rs1[9]);
            string uyumin = NuoHa.ConToStr(Rs1[6]);
            string vyumin = NuoHa.ConToStr(Rs1[7]);
                string uym = uyumin;
                string vym = vyumin;
                if(DK.ExecuteScalar("SELECT [名称] FROM [wap_yumin] WHERE [域名] LIKE '%"+uym+"%'") != null)
                {
                    uym = DK.ExecuteScalar("SELECT [名称] FROM [wap_yumin] WHERE [域名] LIKE '%"+uym+"%'").ToString();
                }
                if(DK.ExecuteScalar("SELECT [名称] FROM [wap_yumin] WHERE [域名] LIKE '%"+vym+"%'") != null)
                {
                    vym = DK.ExecuteScalar("SELECT [名称] FROM [wap_yumin] WHERE [域名] LIKE '%"+vym+"%'").ToString();
                }
                  nh = nh + 1;
if (nh % 2 == 0)
                {
                }
                else
                {
                }
                if (uid == 0)
                {
TextString += "[室内广播]:" + NuoHa.TextDecode(Rs1[4].ToString()) + " (" + NuoHa.TimeEncode(Rs1[5]) + ")<br/>\r\n";
                }
                else
                {
                    if (vid == 0)
                    {
TextString += "<div class=\"xianzhi\">\r\n";//限制图片大小
TextString += ""+uym+"<a href=\"/hl/bbs/ls/talk_add.aspx?id=1&amp;vid=" + uid + "&amp;yumin="+uyumin+"" + NuoHa.String1 + "\">" + uidname + "</a>说:" + NuoHa.TextDecode(Rs1[4].ToString()) + " (" + NuoHa.TimeEncode(Rs1[5]) + ")<br/>\r\n";
TextString += "</div>\r\n";
                    }
                    else
                    {
                        if (Convert.ToInt32(Rs1[2]) == 0)
                        {//限制图片大小
TextString += "<div class=\"xianzhi\">\r\n";
TextString += ""+uym+"<a href=\"/hl/bbs/ls/talk_add.aspx?id=1&amp;vid=" + uid + "&amp;yumin="+uyumin+"" + NuoHa.String1 + "\">" + uidname + "</a>对"+vym+"<a href=\"/hl/bbs/ls/talk_add.aspx?id=1&amp;vid=" + vid + "&amp;yumin="+vyumin+"" + NuoHa.String1 + "\">" + vidname + "</a>说:" + NuoHa.TextDecode(Rs1[4].ToString()) + " (" + NuoHa.TimeEncode(Rs1[5]) + ")<br/>\r\n";
TextString += "</div>\r\n";
                        }
                        else
                        {
                            if (uid == NuoHa.MyId || vid == NuoHa.MyId)
                            {//限制图片大小
TextString += "<div class=\"xianzhi\">\r\n";
TextString += "[悄悄话]"+uym+"<a href=\"/hl/bbs/ls/talk_add.aspx?id=1&amp;vid=" + uid + "&amp;yumin="+uyumin+"" + NuoHa.String1 + "\">" + uidname + "</a>对"+vym+"<a href=\"/hl/bbs/sl/talk_add.aspx?id=1&amp;vid=" + vid + "&amp;yumin="+vyumin+"" + NuoHa.String1 + "\">" +vidname + "</a>说:" + NuoHa.TextDecode(Rs1[4].ToString()) + " (" + NuoHa.TimeEncode(Rs1[5]) + ")<br/>\r\n";
TextString += "</div>\r\n";//限制图片大小
                            }
                        }
                    }
                }
    }
//万物互联END