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); }
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); }
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); }
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; } } }
public void getTopicList() { StringBuilder sb = new StringBuilder(); Hashtable[] topics; topics = myTopic.get(cid, last, 20); string topicTitle = ""; moyu.User.Web myUser = new User.Web(); Hashtable theUser = new Hashtable(); foreach (Hashtable topic in topics) { topicTitle = topic["topic_title"].ToString().Length > 20 ? getStr(topic["topic_title"].ToString(), 45, "…") : topic["topic_title"].ToString(); sb.Append("<li><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></li>"); } Response.Write(sb); }
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; } } }
/// <summary> /// 获取新用户返回信息 /// </summary> /// <param name="userData">用户信息</param> /// <returns>返回信息</returns> private Hashtable[] getNewUserRequestItems(Hashtable userData) { User.Web myUser = new User.Web(); Hashtable theUser = myUser.reg(userData["@FromUserName"].ToString().Substring(0,6), "", true, System.DateTime.Now, "", 13333333333, ""); myUser.bindWeixin(System.Convert.ToInt32(theUser["id"]), userData["@FromUserName"].ToString()); Hashtable[] rt = new Hashtable[1]; rt[0] = new Hashtable(); rt[0]["id"] = 0; rt[0]["messageType"] = 2; rt[0]["title"] = "欢迎加入左邻大家庭,从此我们和你在一起"; rt[0]["body"] = "左邻是定西人的微信平台\n关注左邻之后,你可以:\n1.足不出户知晓定西发生的新鲜事\n" + "2.随时随地查询定西的各种信息\n" + "3.和定西在微信上的朋友聊天交流,分享喜怒哀乐和你的见闻\n" + "4.认识更多趣味相投的朋友\n" + "5.每天签到抽奖,换取代金券,享受定西商家们为左邻会员提供的各种优惠,参与左邻举办的各种活动\n" + "……\n点击\"查看全文\"教你如何玩转左邻"; rt[0]["picSmall"] = "http://www.ai0932.com/images/weixin/newUser.jpg"; rt[0]["picBig"] = "http://www.ai0932.com/images/weixin/newUser.jpg"; rt[0]["url"] = "http://www.ai0932.com/Mobile/help.aspx"; rt[0]["orders"] = 90; return rt; }
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>"); }
/// <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; }