今日夜猫ubb拓展

作者: 龙哥 分类: 技术 发布时间: 2014-01-20 14:17 ė1,065 次浏览

我们下载柯林的UBB扩展,下载后用Visual Studio 2012(我是用这个版本)打开UBB_Expand.sln

20140120141548

 

点图片看大图

代码如下:

public static string StartIntercept(string WapHtmlStr, wml wmlVo)
{

if (WapHtmlStr.IndexOf(“[yemao]”) > 0)
{
string tempstr = “”;
string sql = “select top 1 userid from [wap_qiandao] where year(date)= ” + DateTime.Now.Year.ToString() + ” and month(date)= ” + DateTime.Now.Month.ToString() + ” and day(date)= ” + DateTime.Now.Day.ToString() + ” order by id asc”;
DataSet ds = DbHelperSQL.ExecuteDataset(KeLin.ClassManager.Tool.WapTool._ConnStr, CommandType.Text, sql);
if (ds != null && ds.Tables[0].Rows.Count > 0)
{
tempstr = ds.Tables[0].Rows[0][0].ToString();
string tempstr2 = “”;
string sql2 = “select top 1 nickname from [user] where userid=” + tempstr;
DataSet ds2 = DbHelperSQL.ExecuteDataset(KeLin.ClassManager.Tool.WapTool._ConnStr, CommandType.Text, sql2);
if (ds2 != null && ds2.Tables[0].Rows.Count > 0)
{
tempstr2 = ds2.Tables[0].Rows[0][0].ToString();
}
else
{
tempstr2 = “查询失败”;
}
tempstr = “<a href=\”/bbs/userinfo.aspx?siteid=” + wmlVo.siteid + “&amp;touserid=” + tempstr + “&amp;sid=” + wmlVo.sid + “\”>” + tempstr2 + “</a>.<a href=\”/bbs/FriendList.aspx?action=addfriend&amp;friendtype=0&amp;siteid=” + wmlVo.siteid + “&amp;touserid=” + tempstr + “&amp;sid=” + wmlVo.sid + “\”>喜欢TA</a>”;
}
else
{
tempstr = “今日夜猫尚未产生,快去抢签吧!”;
}
WapHtmlStr = WapHtmlStr.Replace(“[yemao]”, tempstr);
}

代码弄好后点【生成】【生成解决方案】

在UBB_Expand文件夹的bin文件夹找到UBB_Expand.dll文件

发送至网站根目录的bin文件夹中即可。

本文出自 俞凌龙博客,转载时请注明出处及相应链接。

本文永久链接: https://blog.jlwz.cn/71

Ɣ回顶部