예제 #1
0
 public void commentsGet()
 {
     StringBuilder sb = new StringBuilder();
     Hashtable[] comments;
     comments = myTopic.commentsGet( Convert.ToInt32(thePost["id"]));
     int i = 1;
     moyu.User.Web myUser = new User.Web();
     Hashtable theUser = new Hashtable();
     string uName = "";
     foreach (Hashtable comment in comments)
     {
         sb.Append("<div class=\"comment\">");
         sb.Append("<ul class=\"comment_info clearfix\">");
         sb.Append("<li><span class=\"comment_floor\">"+i+"</span> F</li>");
         if (Convert.ToInt32(comment["uid"]) == 0)
         {
             uName = "匿名网友";
         }
         else
         {
             theUser = myUser.get(Convert.ToInt32(comment["uid"]));
             uName = theUser["niceName"].ToString();
         }
         sb.Append("<li>"+uName+"</li>");
         sb.Append("<li>发表于:<span class=\"topic_date\">" + comment["date"] + "</span></li>");
         sb.Append("</ul>");
         sb.Append("<div class=\"comment_body\">" + comment["body"] + "</div>");
         sb.Append("<img class=\"usersAvatar\" src=\"" + (uName == "匿名网友" ? "/Images/avatar.png" : theUser["avatar"].ToString().Replace("320_320", "64_64")) + "\"/>");
         sb.Append("</div>");
         i++;
     }
     Response.Write(sb);
 }
예제 #2
0
 public void getComment()
 {
     Hashtable[] comments;
     comments=(type=="t"?myTopic.commentsGet( Convert.ToInt32(thePost["id"])):myGroup.commentGet(Convert.ToInt32(thePost["id"])));
     StringBuilder sb = new StringBuilder();
     int index = 1;
     string uName = "";
     moyu.User.Web myUser = new User.Web();
     Hashtable theUser = new Hashtable();
     foreach (Hashtable comment in comments)
     {
         if (Convert.ToInt32(comment["uid"]) == 0)
         {
             uName = "匿名网友";
         }
         else
         {
             theUser = myUser.get(Convert.ToInt32(thePost["uid"]));
             uName = theUser["niceName"].ToString();
         }
         sb.Append("<li class=\"commentItem\">");
         sb.Append("<div class=\"commentItemBody\">");
         sb.Append(type == "t" ? comment["body"].ToString() : comment["comment"].ToString());
         sb.Append("</div>");
         sb.Append("<div class=\"commentItemInfo\">");
         sb.Append("<span>"+index+"楼 </span>");
         sb.Append("<span> "+uName+"</span>");
         sb.Append("<span> " + (type == "t" ? comment["date"] : comment["postDate"]) + "</span>");
         sb.Append("</div>");
         sb.Append("</li>");
         index++;
     }
     Response.Write(sb);
 }
예제 #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     q= HttpUtility.UrlDecode(Request.Params["q"]).Replace("?", "").Replace("?", "");
     string strSql;
     Hashtable[] keyWords;
     if (Cache["weixinRobotKeywords"] == null)
     {
         strSql = "select * from weixin_robot_rules_keyWords";
         keyWords = moyu.Data.Type.dtToHash(myDb.GetQuerySql(strSql, "rt"));
         Cache.Insert("weixinRobotKeywords", keyWords, null, DateTime.Now.AddHours(1), TimeSpan.Zero);
     }
     else
     {
         keyWords = (Hashtable[])Cache["weixinRobotKeywords"];
     }
     strSql = "select * from weixin_robot_rules where id =";
     foreach (Hashtable keyWord in keyWords)
     {
         if (q.IndexOf(keyWord["keyWord"].ToString()) > -1)
         {
             strSql += Convert.ToInt32(keyWord["rulesId"]).ToString();
             rules = moyu.Data.Type.dtToHash(myDb.GetQuerySql(strSql,"rt"))[0];
             isShowTeach = false;
             moyu.User.Web myUser = new User.Web();
             user= myUser.get(Convert.ToInt32(rules["uid"]));
             break;
         }
     }
 }
예제 #4
0
파일: header.aspx.cs 프로젝트: inlost/moyo
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.Params["wu"] != null && Session["isLogin"]==null)
     {
         Api.WeiXin myWeiXin = new Api.WeiXin();
         int uid = myWeiXin.getWeiUserId(Request.Params["wu"]);
         if (uid != 0)
         {
             Hashtable theUser = new Hashtable();
             moyu.User.Web myUser = new User.Web();
             theUser = myUser.get(uid);
             Session["isLogin"] = "******";
             Session["guid"] = theUser["id"].ToString();
             foreach (DictionaryEntry infoPar in theUser)
             {
                 Session[infoPar.Key.ToString()] = infoPar.Value.ToString();
             }
             Session["password"] = null;
         }
     }
 }
예제 #5
0
 public void getInfo()
 {
     string uName="";
     moyu.User.Web myUser = new User.Web();
     Hashtable theUser = new Hashtable();
     if (Convert.ToInt32(thePost["uid"]) == 0)
     {
         uName="匿名网友";
     }
     else
     {
         theUser = myUser.get(Convert.ToInt32(thePost["uid"]));
         uName=theUser["niceName"].ToString();
     }
     Response.Write("<li>" + uName + "</li>");
     Response.Write("<li>发表于:<span  class=\"topic_date\">" + thePost["topic_date"] + "</span></li>");
     Response.Write("<li>帖子热度:" + thePost["showTime"] + "</li>");
     Response.Write("<li>最后回应时间:<span class=\"topic_date\">" + thePost["lastUpdate"] + "</span></li>");
 }
예제 #6
0
        public void getTopicList()
        {
            StringBuilder sb = new StringBuilder();
            Hashtable[] topics;
            topics = myTopic.get(cid, last, 20);
            int comments;
            string topicTitle = "";
            moyu.User.Web myUser = new User.Web();
            Hashtable theUser = new Hashtable();
            string uName="";

            thisPageLast =topics.Count()>0?  Convert.ToInt32(topics[topics.Count() - 1]["id"]):0;
            foreach (Hashtable topic in topics)
            {
                topicTitle = topic["topic_title"].ToString().Length > 12 ? getStr(topic["topic_title"].ToString(), 32,"…")  : topic["topic_title"].ToString();
                sb.Append("<tr  data-tid=\"" + topic["id"] + "\">");
                sb.Append("<th><a href=\"/" + topic["topic_title"] + "_定西吧_沁辰左邻/Markets---forum---TopicShow@aspx/name=" + thePlate["name"] + "&id=" + topic["id"] + "&last=" + last + "\" data-dst=\"Markets/forum/TopicShow.aspx?id=" + topic["id"] + "&last=" + last + "\" class=\"jump\" title=\"" + topic["topic_title"].ToString() + "\">" + topicTitle + "</a></th>");
                if(Convert .ToInt32( topic["uid"])==0)
                {
                    uName="匿名网友";
                }
                else
                {
                    theUser=myUser.get(Convert .ToInt32(topic["uid"]));
                    uName=theUser["niceName"].ToString();
                }
                sb.Append("<th>"+uName+"</th>");
                sb.Append("<th>" + topic["showTime"] + "</th>");
                comments = myTopic.getCommentsCount(Convert.ToInt32(topic["id"]));
                sb.Append("<th>"+(comments==0?"":comments.ToString())+"</th>");
                sb.Append("<th class=\"t_t_l_table_lastUpdate\">" + Convert.ToDateTime(topic["lastUpdate"]).ToShortDateString().Replace("2012/","") +" "+ Convert.ToDateTime(topic["lastUpdate"]).ToShortTimeString() + "</th>");
                sb.Append("</tr>");
            }
            Response.Write(sb);
        }
예제 #7
0
        /// <summary>
        /// 用户签到
        /// </summary>
        /// <param name="uid">用户编号</param>
        public int signIn(int uid)
        {
            Hashtable inQuer = new Hashtable();
            inQuer["@uid"] = uid;
            inQuer["@lastDate"] = DateTime.Now.AddDays(-1).ToShortDateString();
            inQuer["@nowDate"] = DateTime.Now.ToShortDateString();
            Information.group myGroup = new Information.group();
            User.Web myUser = new User.Web();
            Hashtable theUser = new Hashtable();
            theUser = myUser.get(uid);

            int tid;
            if (!isSigIn(uid))
            {
                myDb.ExecNoneQuery("user_signIn", inQuer);
                tid = myGroup.topicNewByWeixin("签到", theUser["niceName"].ToString() + "在" + System.DateTime.Now.ToString() + "在左邻签到", -2, uid, theUser["niceName"] + "在" + System.DateTime.Now.ToShortTimeString() + "默默地签了一个到,什么都没有说,然后就默默默默地走掉了……");
            }
            else
            {
                tid = getLastSiginTopic(uid);
            }
            return tid;
        }