本文整理汇总了C#中Discuz.Entity.ForumInfo类的典型用法代码示例。如果您正苦于以下问题:C# ForumInfo类的具体用法?C# ForumInfo怎么用?C# ForumInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ForumInfo类属于Discuz.Entity命名空间,在下文中一共展示了ForumInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: PostAuthority
/// <summary>
/// 发帖权限控制
/// </summary>
/// <param name="forum">版块信息</param>
/// <param name="usergroupinfo">当前用户的用户组信息</param>
/// <param name="userId">当前用户Id</param>
/// <returns></returns>
public static bool PostAuthority(ForumInfo forum, UserGroupInfo userGroupInfo, int userId, ref string msg)
{
if (!Forums.AllowPostByUserID(forum.Permuserlist, userId)) //判断当前用户在当前版块发主题权限
{
if (string.IsNullOrEmpty(forum.Postperm))//权限设置为空时,根据用户组权限判断
{
// 验证用户是否有发表主题的权限
if (userGroupInfo.Allowpost != 1)
{
msg = "您当前的身份 \"" + userGroupInfo.Grouptitle + "\" 没有发表主题的权限";
return false;
}
}
else//权限设置不为空时,根据板块权限判断
{
if (!Forums.AllowPost(forum.Postperm, userGroupInfo.Groupid))
{
msg = "您没有在该版块发表主题的权限";
return false;
}
}
}
return true;
}
开发者ID:ZeroneBit,项目名称:dnt3_src,代码行数:32,代码来源:UserAuthority.cs
示例2: ShowPage
protected override void ShowPage()
{
if (userid == -1)
{
AddErrLine("你尚未登录");
return;
}
string referer = ForumUtils.GetCookie("referer");
// 获取主题ID
topicid = DNTRequest.GetInt("topicid", -1);
albumid = DNTRequest.GetInt("albumid", -1);
blogid = DNTRequest.GetInt("postid", -1);
goodsid = DNTRequest.GetInt("goodsid", -1);
if (topicid != -1)//收藏的是主题
{
// 获取该主题的信息
TopicInfo topic = Topics.GetTopicInfo(topicid);
// 如果该主题不存在
if (topic == null)
{
AddErrLine("不存在的主题ID");
return;
}
topictitle = topic.Title;
forumid = topic.Fid;
forum = Forums.GetForumInfo(forumid);
forumname = forum.Name;
pagetitle = Utils.RemoveHtml(forum.Name);
forumnav = forum.Pathlist;
// 检查用户是否拥有足够权限
if (config.Maxfavorites <= Favorites.GetFavoritesCount(userid))
{
AddErrLine("您收藏的主题数目已经达到系统设置的数目上限");
return;
}
if (Favorites.CheckFavoritesIsIN(userid, topicid) != 0)
{
AddErrLine("您过去已经收藏过这个主题,请返回");
return;
}
if (Favorites.CreateFavorites(userid, topicid) > 0)
{
AddMsgLine("指定主题已成功添加到收藏夹中,现在将回到上一页");
SetUrl(referer);
SetMetaRefresh();
SetShowBackLink(false);
}
}
}
开发者ID:ichari,项目名称:ichari,代码行数:56,代码来源:favorites.aspx.cs
示例3: GetForumSpecialUser
public static ForumInfo[] GetForumSpecialUser(string username)
{
DataTable dt = new DataTable();
if (username == "")
dt = Data.Forums.GetForumTableBySpecialUser("");
else
dt = Data.Forums.GetForumTableBySpecialUser(username);
ForumInfo[] foruminfo = null;
if (dt.Rows.Count > 0)
{
foruminfo = new ForumInfo[dt.Rows.Count];
for (int i = 0; i < dt.Rows.Count; i++)
{
foruminfo[i] = new ForumInfo();
if (dt.Rows[i]["permuserlist"].ToString() != "")
{
if (username != "")
{
foreach (string s in dt.Rows[i]["permuserlist"].ToString().Split('|'))
{
if (username == s.Split(',')[0])
{
foruminfo[i].Permuserlist = s;
}
}
}
else
{
if (dt.Rows[i]["permuserlist"].ToString().Split('|').Length == 1)
{
foruminfo[i].Permuserlist = dt.Rows[i]["permuserlist"].ToString();
}
else
{
for (int j = 0; j < dt.Rows[i]["permuserlist"].ToString().Split('|').Length; j++)
{
foruminfo[i].Permuserlist += dt.Rows[i]["permuserlist"].ToString().Split('|')[j] + "|";
}
foruminfo[i].Permuserlist = foruminfo[i].Permuserlist.ToString().Substring(0, foruminfo[i].Permuserlist.ToString().Length - 1);
}
}
foruminfo[i].Fid = Utils.StrToInt(dt.Rows[i]["fid"].ToString(), 0);
foruminfo[i].Name = dt.Rows[i]["name"].ToString();
foruminfo[i].Moderators = dt.Rows[i]["moderators"].ToString();
}
}
}
return foruminfo;
}
开发者ID:ChalmerLin,项目名称:dnt_v3.6.711,代码行数:54,代码来源:AdminForums.cs
示例4: PostAuthority
/// <summary>
/// 发帖权限控制
/// </summary>
/// <param name="forum">版块信息</param>
/// <param name="usergroupinfo">当前用户的用户组信息</param>
/// <param name="userId">当前用户Id</param>
/// <returns></returns>
public static bool PostAuthority(ForumInfo forum, UserGroupInfo userGroupInfo, int userId, ref string msg)
{
if (!Forums.AllowPostByUserID(forum.Permuserlist, userId)) //判断当前用户在当前版块发主题权限
{
if (string.IsNullOrEmpty(forum.Postperm))//权限设置为空时,根据用户组权限判断
{
// 验证用户是否有发表主题的权限
if (userGroupInfo.Allowpost != 1)
{
msg = "您当前的身份 \"" + userGroupInfo.Grouptitle + "\" 没有发表主题的权限";
return false;
}
}
else//权限设置不为空时,根据板块权限判断
{
if (!Forums.AllowPost(forum.Postperm, userGroupInfo.Groupid))
{
msg = "您没有在该版块发表主题的权限";
return false;
}
}
}
//当用户拥有发帖权限但版块只允许发布特殊主题时,需要判断用户是否能发布特殊主题
if (forum.Allowspecialonly > 0)
{
//当版块设置了只允许特殊主题,但又没有开启任何特殊主题类型,则相当于关闭了版块的发主题功能
if (forum.Allowpostspecial <= 0)
{
msg = "您没有在该版块发表特殊主题的权限";
return false;
}
if ((forum.Allowpostspecial & 1) == 1 && userGroupInfo.Allowpostpoll != 1)
msg = "您当前的身份 \"" + userGroupInfo.Grouptitle + "\" 没有发布投票的权限";
else
return true;
if ((forum.Allowpostspecial & 4) == 4 && userGroupInfo.Allowbonus != 1)
msg = "您当前的身份 \"" + userGroupInfo.Grouptitle + "\" 没有发布悬赏的权限";
else
return true;
if ((forum.Allowpostspecial & 16) == 16 && userGroupInfo.Allowdebate != 1)
msg = "您当前的身份 \"" + userGroupInfo.Grouptitle + "\" 没有发起辩论的权限";
else
return true;
return false;
}
return true;
}
开发者ID:khaliyo,项目名称:DiscuzNT,代码行数:59,代码来源:UserAuthority.cs
示例5: LoadCurrentForumInfo
public void LoadCurrentForumInfo(int fid)
{
#region 提取基本信息
if (fid > 0)
{
forumInfo = Forums.GetForumInfo(fid);
}
else
{
return;
}
if (forumInfo.Allowsmilies == 1) setting.Items[0].Selected = true;
if (forumInfo.Allowrss == 1) setting.Items[1].Selected = true;
if (forumInfo.Allowbbcode == 1) setting.Items[2].Selected = true;
if (forumInfo.Allowimgcode == 1) setting.Items[3].Selected = true;
if (forumInfo.Recyclebin == 1) setting.Items[4].Selected = true;
if (forumInfo.Modnewposts == 1) setting.Items[5].Selected = true;
if (forumInfo.Modnewtopics == 1) setting.Items[6].Selected = true;
if (forumInfo.Jammer == 1) setting.Items[7].Selected = true;
if (forumInfo.Disablewatermark == 1) setting.Items[8].Selected = true;
if (forumInfo.Inheritedmod == 1) setting.Items[9].Selected = true;
if (forumInfo.Allowthumbnail == 1) setting.Items[10].Selected = true;
if (forumInfo.Allowtag == 1) setting.Items[11].Selected = true;
if ((forumInfo.Allowpostspecial & 1) != 0) setting.Items[12].Selected = true;
if ((forumInfo.Allowpostspecial & 16) != 0) setting.Items[13].Selected = true;
if ((forumInfo.Allowpostspecial & 4) != 0) setting.Items[14].Selected = true;
if ((forumInfo.Alloweditrules == 1)) setting.Items[15].Selected = true;
//DataTable dt = DatabaseProvider.GetInstance().GetUserGroupsTitle();
viewperm.SetSelectByID(forumInfo.Viewperm.Trim());
postperm.SetSelectByID(forumInfo.Postperm.Trim());
replyperm.SetSelectByID(forumInfo.Replyperm.Trim());
getattachperm.SetSelectByID(forumInfo.Getattachperm.Trim());
postattachperm.SetSelectByID(forumInfo.Postattachperm.Trim());
//dt = DatabaseProvider.GetInstance().GetAttachTypes();
attachextensions.SetSelectByID(forumInfo.Attachextensions.Trim());
#endregion
}
开发者ID:Vinna,项目名称:DeepInSummer,代码行数:43,代码来源:forum_forumbatchset.aspx.cs
示例6: VisitAuthority
/// <summary>
/// 访问权限控制
/// </summary>
/// <param name="forum">访问的版块信息</param>
/// <param name="usergroupinfo">当前用户的用户组信息</param>
/// <param name="userId">当前用户Id</param>
/// <returns></returns>
public static bool VisitAuthority(ForumInfo forum, UserGroupInfo userGroupInfo, int userId, ref string msg)
{
if (!Forums.AllowViewByUserId(forum.Permuserlist, userId)) //判断当前用户在当前版块浏览权限
{
if (string.IsNullOrEmpty(forum.Viewperm))//当板块权限为空时,按照用户组权限
{
if (userGroupInfo.Allowvisit != 1)
{
msg = "您当前的身份 \"" + userGroupInfo.Grouptitle + "\" 没有浏览该版块的权限";
return false;
}
}
else//当板块权限不为空,按照板块权限
{
if (!Forums.AllowView(forum.Viewperm, userGroupInfo.Groupid))
{
msg = "您没有浏览该版块的权限";
return false;
}
}
}
return true;
}
开发者ID:khaliyo,项目名称:DiscuzNT,代码行数:30,代码来源:UserAuthority.cs
示例7: RunForumStatic_Click
private void RunForumStatic_Click(object sender, EventArgs e)
{
#region 运行论坛统计
if (this.CheckCookie())
{
forumsstatic.Text = ViewState["forumsstatic"].ToString();
int fid = DNTRequest.GetInt("fid", -1);
if (fid > 0)
{
forumInfo = Forums.GetForumInfo(fid);
}
else
{
return;
}
int topiccount = 0;
int postcount = 0;
int lasttid = 0;
string lasttitle = "";
string lastpost = "";
int lastposterid = 0;
string lastposter = "";
int replypost = 0;
AdminForumStats.ReSetFourmTopicAPost(fid, out topiccount, out postcount, out lasttid, out lasttitle, out lastpost, out lastposterid, out lastposter, out replypost);
runforumsstatic = string.Format("<br /><br />运行结果<hr style=\"height:1px; width:600; color:#CCCCCC; background:#CCCCCC; border: 0; \" align=\"left\" />主题总数:{0}<br />帖子总数:{1}<br />今日回帖数总数:{2}<br />最后提交日期:{3}",
topiccount,
postcount,
replypost,
lastpost);
if ((forumInfo.Topics == topiccount) && (forumInfo.Posts == postcount) && (forumInfo.Todayposts == replypost) && (forumInfo.Lastpost.Trim() == lastpost))
{
runforumsstatic += "<br /><br /><br />结果一致";
}
else
{
runforumsstatic += "<br /><br /><br />比较<hr style=\"height:1px; width:600; color:#CCCCCC; background:#CCCCCC; border: 0; \" align=\"left\" />";
if (forumInfo.Topics != topiccount)
{
runforumsstatic += "主题总数有差异<br />";
}
if (forumInfo.Posts != postcount)
{
runforumsstatic += "帖子总数有差异<br />";
}
if (forumInfo.Todayposts != replypost)
{
runforumsstatic += "今日回帖数总数有差异<br />";
}
if (forumInfo.Lastpost != lastpost)
{
runforumsstatic += "最后提交日期有差异<br />";
}
}
}
this.TabControl1.SelectedIndex = 5;
DataGridBind("");
BindTopicType();
#endregion
}
开发者ID:Vinna,项目名称:DeepInSummer,代码行数:64,代码来源:forum_editforums.aspx.cs
示例8: LoadCurrentForumInfo
public void LoadCurrentForumInfo(int fid)
{
#region 加载相关信息
if (fid <= 0)
return;
forumInfo = Forums.GetForumInfo(fid);
if (forumInfo == null)
return;
if (forumInfo.Layer > 0)
{
tabPage2.Visible = true;
tabPage6.Visible = true;
}
else//如果是分类
{
//删除掉"高级设置"属性页
TabControl1.Items.Remove(tabPage2);
tabPage2.Visible = false;
//删除掉"权限设置"属性页
//TabControl1.Items.Remove(tabPage3);
//tabPage3.Visible = false;
//删除掉"特殊用户"属性页
//TabControl1.Items.Remove(tabPage4);
//tabPage4.Visible = false;
//删除掉"主题分类"属性页
TabControl1.Items.Remove(tabPage5);
tabPage5.Visible = false;
//删除掉"统计信息"属性页
TabControl1.Items.Remove(tabPage6);
tabPage6.Visible = false;
//templatestyle.Visible = false;
}
forumname.Text = forumInfo.Name.Trim();
name.Text = forumInfo.Name.Trim();
displayorder.Text = forumInfo.Displayorder.ToString();
status.SelectedValue = forumInfo.Status.ToString();
if (forumInfo.Colcount == 1)
{
showcolnum.Attributes.Add("style", "display:none");
colcount.SelectedIndex = 0;
}
else
{
showcolnum.Attributes.Add("style", "display:block");
colcount.SelectedIndex = 1;
}
colcount.Attributes.Add("onclick", "javascript:document.getElementById('" + showcolnum.ClientID + "').style.display= (document.getElementById('TabControl1_tabPage1_colcount_0').checked ? 'none' : 'block');");
colcountnumber.Text = forumInfo.Colcount.ToString();
//forumInfo.Templateid为0表示绑定到默认模板
templateid.SelectedValue = (forumInfo.Templateid == 0 && config.Templateid ==1) ? "1" : forumInfo.Templateid.ToString();
forumsstatic.Text = string.Format("主题总数:{0}<br />帖子总数:{1}<br />今日回帖数总数:{2}<br />最后提交日期:{3}",
forumInfo.Topics.ToString(),
forumInfo.Posts.ToString(),
forumInfo.Todayposts.ToString(),
forumInfo.Lastpost.ToString());
ViewState["forumsstatic"] = forumsstatic.Text;
if (forumInfo.Allowsmilies == 1) setting.Items[0].Selected = true;
if (forumInfo.Allowrss == 1) setting.Items[1].Selected = true;
if (forumInfo.Allowbbcode == 1) setting.Items[2].Selected = true;
if (forumInfo.Allowimgcode == 1) setting.Items[3].Selected = true;
if (forumInfo.Recyclebin == 1) setting.Items[4].Selected = true;
if (forumInfo.Modnewposts == 1) setting.Items[5].Selected = true;
if (forumInfo.Modnewtopics == 1) setting.Items[6].Selected = true;
if (forumInfo.Jammer == 1) setting.Items[7].Selected = true;
if (forumInfo.Disablewatermark == 1) setting.Items[8].Selected = true;
if (forumInfo.Inheritedmod == 1) setting.Items[9].Selected = true;
if (forumInfo.Allowthumbnail == 1) setting.Items[10].Selected = true;
if (forumInfo.Allowtag == 1) setting.Items[11].Selected = true;
//if (__foruminfo.Istrade == 1) setting.Items[11].Selected = true;
if ((forumInfo.Allowpostspecial & 1) != 0) setting.Items[12].Selected = true;
if ((forumInfo.Allowpostspecial & 16) != 0) setting.Items[13].Selected = true;
if ((forumInfo.Allowpostspecial & 4) != 0) setting.Items[14].Selected = true;
if ((forumInfo.Alloweditrules == 1)) setting.Items[15].Selected = true;
allowspecialonly.SelectedValue = forumInfo.Allowspecialonly.ToString();
if (forumInfo.Autoclose == 0)
{
showclose.Attributes.Add("style", "display:none");
autocloseoption.SelectedIndex = 0;
}
else
{
autocloseoption.SelectedIndex = 1;
}
autocloseoption.Attributes.Add("onclick", "javascript:document.getElementById('" + showclose.ClientID + "').style.display= (document.getElementById('TabControl1_tabPage2_autocloseoption_0').checked ? 'none' : 'block');");
autocloseday.Text = forumInfo.Autoclose.ToString();
//.........这里部分代码省略.........
开发者ID:Vinna,项目名称:DeepInSummer,代码行数:101,代码来源:forum_editforums.aspx.cs
示例9: SubmitInfo_Click
private void SubmitInfo_Click(object sender, EventArgs e)
{
#region 提交同级版块
if (this.CheckCookie())
{
if (DNTRequest.GetString("fid") != "")
{
forumInfo = Forums.GetForumInfo(DNTRequest.GetInt("fid", 0));
forumInfo.Name = name.Text.Trim();
forumInfo.Displayorder = Convert.ToInt32(displayorder.Text);
forumInfo.Status = Convert.ToInt16(status.SelectedValue);
if (colcount.SelectedValue == "1") //传统模式[默认]
{
forumInfo.Colcount = 1;
}
else
{
if (Convert.ToInt16(colcountnumber.Text) < 1 || Convert.ToInt16(colcountnumber.Text) > 9)
{
colcountnumber.Text = "";
base.RegisterStartupScript("", "<script>alert('列值必须在2~9范围内');</script>");
return;
}
forumInfo.Colcount = Convert.ToInt16(colcountnumber.Text);
}
if (rewritename.Text.Trim() != oldrewritename.Value && rewritename.Text.Trim() != "" && Discuz.Forum.Forums.CheckRewriteNameInvalid(rewritename.Text.Trim()))
{
rewritename.Text = "";
base.RegisterStartupScript("", "<script>alert('URL重写非法!');</script>");
return;
}
//forumInfo.Templateid为0表示绑定到默认模板
forumInfo.Templateid = (Convert.ToInt32(templateid.SelectedValue) == config.Templateid ? 0 : Convert.ToInt32(templateid.SelectedValue));
forumInfo.Allowhtml = 0;
forumInfo.Allowblog = 0;
forumInfo.Istrade = 0;
forumInfo.Alloweditrules = 0;
forumInfo.Allowsmilies = BoolToInt(setting.Items[0].Selected);
forumInfo.Allowrss = BoolToInt(setting.Items[1].Selected);
forumInfo.Allowbbcode = BoolToInt(setting.Items[2].Selected);
forumInfo.Allowimgcode = BoolToInt(setting.Items[3].Selected);
forumInfo.Recyclebin = BoolToInt(setting.Items[4].Selected);
forumInfo.Modnewposts = BoolToInt(setting.Items[5].Selected);
forumInfo.Modnewtopics = BoolToInt(setting.Items[6].Selected);
forumInfo.Jammer = BoolToInt(setting.Items[7].Selected);
forumInfo.Disablewatermark = BoolToInt(setting.Items[8].Selected);
forumInfo.Inheritedmod = BoolToInt(setting.Items[9].Selected);
forumInfo.Allowthumbnail = BoolToInt(setting.Items[10].Selected);
forumInfo.Allowtag = BoolToInt(setting.Items[11].Selected);
int temppostspecial = 0;
temppostspecial = setting.Items[12].Selected ? temppostspecial | 1 : temppostspecial & ~1;
temppostspecial = setting.Items[13].Selected ? temppostspecial | 16 : temppostspecial & ~16;
temppostspecial = setting.Items[14].Selected ? temppostspecial | 4 : temppostspecial & ~4;
forumInfo.Allowpostspecial = temppostspecial;
forumInfo.Alloweditrules = BoolToInt(setting.Items[15].Selected);
forumInfo.Allowspecialonly = Convert.ToInt16(allowspecialonly.SelectedValue);
if (autocloseoption.SelectedValue == "0")
forumInfo.Autoclose = 0;
else
forumInfo.Autoclose = Convert.ToInt32(autocloseday.Text);
forumInfo.Description = description.Text;
forumInfo.Password = password.Text;
//如果有上传的图片被提交上来,则执行文件保存操作,并返回保存后的文件路径,否则将icon.text控件中的值保存
forumInfo.Icon = HttpContext.Current.Request.Files.Count > 0 && !string.IsNullOrEmpty(HttpContext.Current.Request.Files[0].FileName)
? AdminForums.UploadForumIcon(forumInfo.Fid) : icon.Text;
forumInfo.Redirect = redirect.Text;
forumInfo.Attachextensions = attachextensions.GetSelectString(",");
AdminForums.CompareOldAndNewModerator(forumInfo.Moderators, moderators.Text.Replace("\r\n", ","), DNTRequest.GetInt("fid", 0));
forumInfo.Moderators = moderators.Text.Replace("\r\n", ",");
forumInfo.Rules = rules.Text.Trim();
forumInfo.Seokeywords = seokeywords.Text.Trim();
forumInfo.Seodescription = seodescription.Text.Trim();
forumInfo.Rewritename = rewritename.Text.Trim();
forumInfo.Viewperm = Request.Form["viewperm"];
forumInfo.Postperm = Request.Form["postperm"];
forumInfo.Replyperm = Request.Form["replyperm"];
forumInfo.Getattachperm = Request.Form["getattachperm"];
forumInfo.Postattachperm = Request.Form["postattachperm"];
forumInfo.Applytopictype = Convert.ToInt32(applytopictype.SelectedValue);
forumInfo.Postbytopictype = Convert.ToInt32(postbytopictype.SelectedValue);
forumInfo.Viewbytopictype = Convert.ToInt32(viewbytopictype.SelectedValue);
forumInfo.Topictypeprefix = Convert.ToInt32(topictypeprefix.SelectedValue);
forumInfo.Topictypes = GetTopicType();
forumInfo.Permuserlist = GetPermuserlist();
Discuz.Aggregation.AggregationFacade.ForumAggregation.ClearDataBind();
string result = AdminForums.UpdateForumInfo(forumInfo).Replace("'", "’");
//.........这里部分代码省略.........
开发者ID:Vinna,项目名称:DeepInSummer,代码行数:101,代码来源:forum_editforums.aspx.cs
示例10: ShowPage
private string condition = ""; //查询条件
protected override void ShowPage()
{
if (config.Enablemall == 0) //未启用交易模式
{
AddErrLine("系统未开启交易模式, 当前页面暂时无法访问!");
return;
}
else
goodscategoryfid = Discuz.Mall.GoodsCategories.GetGoodsCategoryWithFid();
forumnav = "";
forumallowrss = 0;
if (categoryid <= 0)
{
AddErrLine("无效的商品分类ID");
return;
}
if (config.Enablemall == 2) //开启高级模式
{
AddLinkRss("mallgoodslist.aspx?categoryid=" + categoryid, "商品列表");
AddErrLine("当前页面在开启商城(高级)模式下无法访问, 系统将会重定向到商品列表页面!");
return;
}
goodscategoryinfo = GoodsCategories.GetGoodsCategoryInfoById(categoryid);
if (goodscategoryinfo != null && goodscategoryinfo.Categoryid > 0)
{
forumid = GoodsCategories.GetCategoriesFid(goodscategoryinfo.Categoryid);
}
else
{
AddErrLine("无效的商品分类ID");
return;
}
///得到广告列表
///头部
headerad = Advertisements.GetOneHeaderAd("", forumid);
footerad = Advertisements.GetOneFooterAd("", forumid);
pagewordad = Advertisements.GetPageWordAd("", forumid);
doublead = Advertisements.GetDoubleAd("", forumid);
floatad = Advertisements.GetFloatAd("", forumid);
mediaad = Advertisements.GetMediaAd(templatepath, "", forumid);
disablepostctrl = 0;
if (userid > 0 && useradminid > 0)
admingroupinfo = AdminGroups.GetAdminGroupInfo(usergroupid);
if (admingroupinfo != null)
this.disablepostctrl = admingroupinfo.Disablepostctrl;
if (forumid == -1)
{
AddLinkRss("tools/rss.aspx", "最新商品");
AddErrLine("无效的商品分类ID");
return;
}
else
{
forum = Forums.GetForumInfo(forumid);
// 检查是否具有版主的身份
if (useradminid > 0)
ismoder = Moderators.IsModer(useradminid, userid, forumid);
#region 对搜索条件进行检索
string orderStr = "goodsid";
if (DNTRequest.GetString("search").Trim() != "") //进行指定查询
{
//所在城市信息
cond = DNTRequest.GetInt("locus_2", -1);
if (cond < 1)
condition = "";
else
{
locus = Locations.GetLocusByLID(cond);
condition = "AND [lid] = " + cond;
}
//排序的字段
order = DNTRequest.GetInt("order", -1);
switch (order)
{
case 2:
orderStr = "expiration"; //到期日
break;
case 1:
orderStr = "price"; //商品价格
break;
default:
orderStr = "goodsid";
break;
}
if (DNTRequest.GetInt("direct", -1) == 0)
//.........这里部分代码省略.........
开发者ID:wenysky,项目名称:dnt31-lite,代码行数:101,代码来源:showgoodslist.cs
示例11: SubmitBatchSet_Click
private void SubmitBatchSet_Click(object sender, EventArgs e)
{
#region 写入批量论坛设置信息
string targetlist = DNTRequest.GetString("Forumtree1");
if ((targetlist == "") || (targetlist == ",") || (targetlist == "0"))
{
base.RegisterStartupScript( "", "<script>alert('您未选中任何版块, 系统无法提交! ');</script>");
return;
}
__foruminfo = AdminForums.GetForumInfomation(DNTRequest.GetInt("fid", -1));
__foruminfo.Allowsmilies = BoolToInt(setting.Items[0].Selected);
__foruminfo.Allowrss = BoolToInt(setting.Items[1].Selected);
__foruminfo.Allowhtml = 0;
__foruminfo.Allowbbcode = BoolToInt(setting.Items[2].Selected);
__foruminfo.Allowimgcode = BoolToInt(setting.Items[3].Selected);
__foruminfo.Allowblog = 0;
__foruminfo.Istrade = 0;
__foruminfo.Alloweditrules = 0;
__foruminfo.Recyclebin = BoolToInt(setting.Items[4].Selected);
__foruminfo.Modnewposts = BoolToInt(setting.Items[5].Selected);
__foruminfo.Jammer = BoolToInt(setting.Items[6].Selected);
__foruminfo.Disablewatermark = BoolToInt(setting.Items[7].Selected);
__foruminfo.Inheritedmod = BoolToInt(setting.Items[8].Selected);
__foruminfo.Allowthumbnail = BoolToInt(setting.Items[9].Selected);
__foruminfo.Password = password.Text;
__foruminfo.Attachextensions = attachextensions.GetSelectString(",");
__foruminfo.Viewperm = viewperm.GetSelectString(",");
__foruminfo.Postperm = postperm.GetSelectString(",");
__foruminfo.Replyperm = replyperm.GetSelectString(",");
__foruminfo.Getattachperm = getattachperm.GetSelectString(",");
__foruminfo.Postattachperm = postattachperm.GetSelectString(",");
BatchSetParams bsp = new BatchSetParams();
bsp.SetPassWord = setpassword.Checked;
bsp.SetAttachExtensions = setattachextensions.Checked;
bsp.SetPostCredits = setpostcredits.Checked;
bsp.SetReplyCredits = setreplycredits.Checked;
bsp.SetSetting = setsetting.Checked;
bsp.SetViewperm = setviewperm.Checked;
bsp.SetPostperm = setpostperm.Checked;
bsp.SetReplyperm = setreplyperm.Checked;
bsp.SetGetattachperm = setgetattachperm.Checked;
bsp.SetPostattachperm = setpostattachperm.Checked;
if (AdminForums.BatchSetForumInf(__foruminfo, bsp, targetlist))
{
base.RegisterStartupScript( "PAGE", "window.location.href='forum_ForumsTree.aspx';");
}
else
{
base.RegisterStartupScript( "", "<script>alert('提交不成功!');window.location.href='forum_ForumsTree.aspx';</script>");
}
#endregion
}
开发者ID:ichari,项目名称:ichari,代码行数:58,代码来源:forum_forumbatchset.aspx.cs
示例12: CheckUsertAttachAuthority
/// <summary>
/// 检查用户下载附件的权限
/// </summary>
/// <param name="forum">版块信息</param>
/// <param name="userGroupInfo">当前用户的用户组信息</param>
/// <param name="userId">当前用户Id</param>
/// <param name="msg">提示信息</param>
/// <returns></returns>
public static bool CheckUsertAttachAuthority(ForumInfo forum, UserGroupInfo userGroupInfo, int userId, ref string msg)
{
if (!Forums.AllowGetAttachByUserID(forum.Permuserlist, userId))
{
if (Utils.StrIsNullOrEmpty(forum.Getattachperm) && userGroupInfo.Allowgetattach != 1)// 验证用户是否有下载附件的权限
{
msg = string.Format("您当前的身份 \"{0}\" 没有下载或查看附件的权限", userGroupInfo.Grouptitle);
}
else
{
if (!Forums.AllowGetAttach(forum.Getattachperm, userGroupInfo.Groupid))
{
msg = "您没有在该版块下载附件的权限";
return false;
}
}
}
return true;
}
开发者ID:khaliyo,项目名称:DiscuzNT,代码行数:27,代码来源:UserAuthority.cs
示例13: SaveForumsInfo
public void SaveForumsInfo(ForumInfo forumInfo)
{
SqlConnection conn = new SqlConnection(DbHelper.ConnectionString);
conn.Open();
using (SqlTransaction trans = conn.BeginTransaction())
{
try
{
DbParameter[] parms = {
DbHelper.MakeInParam("@parentid", (DbType)SqlDbType.SmallInt, 2, forumInfo.Parentid),
DbHelper.MakeInParam("@layer", (DbType)SqlDbType.Int, 4, forumInfo.Layer),
DbHelper.MakeInParam("@pathlist", (DbType)SqlDbType.NChar, 3000, Utils.StrIsNullOrEmpty(forumInfo.Pathlist) ? " " : forumInfo.Pathlist),
DbHelper.MakeInParam("@parentidlist", (DbType)SqlDbType.NChar, 300, Utils.StrIsNullOrEmpty(forumInfo.Parentidlist) ? " " : forumInfo.Parentidlist),
DbHelper.MakeInParam("@subforumcount", (DbType)SqlDbType.Int, 4, forumInfo.Subforumcount),
DbHelper.MakeInParam("@name", (DbType)SqlDbType.NChar, 50, forumInfo.Name),
DbHelper.MakeInParam("@status", (DbType)SqlDbType.Int, 4, forumInfo.Status),
DbHelper.MakeInParam("@colcount", (DbType)SqlDbType.SmallInt, 4, forumInfo.Colcount),
DbHelper.MakeInParam("@displayorder", (DbType)SqlDbType.Int, 4, forumInfo.Displayorder),
DbHelper.MakeInParam("@templateid", (DbType)SqlDbType.SmallInt, 2, forumInfo.Templateid),
DbHelper.MakeInParam("@topics", (DbType)SqlDbType.Int, 4, forumInfo.Topics),
DbHelper.MakeInParam("@curtopics", (DbType)SqlDbType.Int, 4, forumInfo.CurrentTopics),
DbHelper.MakeInParam("@posts", (DbType)SqlDbType.Int, 4, forumInfo.Posts),
DbHelper.MakeInParam("@todayposts", (DbType)SqlDbType.Int, 4, forumInfo.Todayposts),
DbHelper.MakeInParam("@lasttid", (DbType)SqlDbType.Int, 4, forumInfo.Lasttid),
DbHelper.MakeInParam("@lasttitle", (DbType)SqlDbType.NChar, 60, forumInfo.Lasttitle),
DbHelper.MakeInParam("@lastpost", (DbType)SqlDbType.DateTime, 8, forumInfo.Lastpost),
DbHelper.MakeInParam("@lastposterid", (DbType)SqlDbType.Int, 4, forumInfo.Lastposterid),
DbHelper.MakeInParam("@lastposter", (DbType)SqlDbType.NChar, 20, forumInfo.Lastposter),
DbHelper.MakeInParam("@allowsmilies", (DbType)SqlDbType.Int, 4, forumInfo.Allowsmilies),
DbHelper.MakeInParam("@allowrss", (DbType)SqlDbType.Int, 4, forumInfo.Allowrss),
DbHelper.MakeInParam("@allowhtml", (DbType)SqlDbType.Int, 4, forumInfo.Allowhtml),
DbHelper.MakeInParam("@allowbbcode", (DbType)SqlDbType.Int, 4, forumInfo.Allowbbcode),
DbHelper.MakeInParam("@allowimgcode", (DbType)SqlDbType.Int, 4, forumInfo.Allowimgcode),
DbHelper.MakeInParam("@allowblog", (DbType)SqlDbType.Int, 4, forumInfo.Allowblog),
DbHelper.MakeInParam("@istrade", (DbType)SqlDbType.Int, 4, forumInfo.Istrade),
DbHelper.MakeInParam("@allowpostspecial",(DbType)SqlDbType.Int,4,forumInfo.Allowpostspecial),
DbHelper.MakeInParam("@allowspecialonly",(DbType)SqlDbType.Int,4,forumInfo.Allowspecialonly),
DbHelper.MakeInParam("@alloweditrules", (DbType)SqlDbType.Int, 4, forumInfo.Alloweditrules),
DbHelper.MakeInParam("@allowthumbnail", (DbType)SqlDbType.Int, 4, forumInfo.Allowthumbnail),
DbHelper.MakeInParam("@allowtag",(DbType)SqlDbType.Int,4,forumInfo.Allowtag),
DbHelper.MakeInParam("@recyclebin", (DbType)SqlDbType.Int, 4, forumInfo.Recyclebin),
DbHelper.MakeInParam("@modnewposts", (DbType)SqlDbType.Int, 4, forumInfo.Modnewposts),
DbHelper.MakeInParam("@jammer", (DbType)SqlDbType.Int, 4, forumInfo.Jammer),
DbHelper.MakeInParam("@disablewatermark", (DbType)SqlDbType.Int, 4, forumInfo.Disablewatermark),
DbHelper.MakeInParam("@inheritedmod", (DbType)SqlDbType.Int, 4, forumInfo.Inheritedmod),
DbHelper.MakeInParam("@autoclose", (DbType)SqlDbType.SmallInt, 2, forumInfo.Autoclose),
DbHelper.MakeInParam("@fid", (DbType)SqlDbType.Int, 4, forumInfo.Fid),
DbHelper.MakeInParam("@password", (DbType)SqlDbType.NVarChar, 16, forumInfo.Password),
DbHelper.MakeInParam("@icon", (DbType)SqlDbType.VarChar, 255, forumInfo.Icon),
DbHelper.MakeInParam("@postcredits", (DbType)SqlDbType.VarChar, 255, forumInfo.Postcredits),
DbHelper.MakeInParam("@replycredits", (DbType)SqlDbType.VarChar, 255, forumInfo.Replycredits),
DbHelper.MakeInParam("@redirect", (DbType)SqlDbType.VarChar, 255, forumInfo.Redirect),
DbHelper.MakeInParam("@attachextensions", (DbType)SqlDbType.VarChar, 255, forumInfo.Attachextensions),
DbHelper.MakeInParam("@rules", (DbType)SqlDbType.NText, 0, forumInfo.Rules),
DbHelper.MakeInParam("@topictypes", (DbType)SqlDbType.Text, 0, forumInfo.Topictypes),
DbHelper.MakeInParam("@viewperm", (DbType)SqlDbType.Text, 0, forumInfo.Viewperm),
DbHelper.MakeInParam("@postperm", (DbType)SqlDbType.Text, 0, forumInfo.Postperm),
DbHelper.MakeInParam("@replyperm", (DbType)SqlDbType.Text, 0, forumInfo.Replyperm),
DbHelper.MakeInParam("@getattachperm", (DbType)SqlDbType.Text, 0, forumInfo.Getattachperm),
DbHelper.MakeInParam("@postattachperm", (DbType)SqlDbType.Text, 0, forumInfo.Postattachperm),
DbHelper.MakeInParam("@moderators", (DbType)SqlDbType.Text, 0, forumInfo.Moderators),
DbHelper.MakeInParam("@description", (DbType)SqlDbType.NText, 0, forumInfo.Description),
DbHelper.MakeInParam("@applytopictype", (DbType)SqlDbType.TinyInt, 1, forumInfo.Applytopictype),
DbHelper.MakeInParam("@postbytopictype", (DbType)SqlDbType.TinyInt, 1, forumInfo.Postbytopictype),
DbHelper.MakeInParam("@viewbytopictype", (DbType)SqlDbType.TinyInt, 1, forumInfo.Viewbytopictype),
DbHelper.MakeInParam("@topictypeprefix", (DbType)SqlDbType.TinyInt, 1, forumInfo.Topictypeprefix),
DbHelper.MakeInParam("@permuserlist", (DbType)SqlDbType.NText, 0, forumInfo.Permuserlist),
DbHelper.MakeInParam("@seokeywords", (DbType)SqlDbType.NVarChar, 500, forumInfo.Seokeywords),
DbHelper.MakeInParam("@seodescription", (DbType)SqlDbType.NVarChar, 500, forumInfo.Seodescription),
DbHelper.MakeInParam("@rewritename", (DbType)SqlDbType.NVarChar, 20, forumInfo.Rewritename)
};
DbHelper.ExecuteNonQuery(trans, CommandType.StoredProcedure, string.Format("{0}updateforumsinfo", BaseConfigs.GetTablePrefix), parms);
trans.Commit();
}
catch (Exception ex)
{
trans.Rollback();
throw ex;
}
}
conn.Close();
}
开发者ID:wenysky,项目名称:dnt31-lite,代码行数:83,代码来源:ForumManage.cs
示例14: DownloadAttachment
public static bool DownloadAttachment(ForumInfo forum, int userid, UserGroupInfo usergroupinfo)
{
bool allowdownloadattach = false;
//当前用户是否有允许下载附件权限
if (Forums.AllowGetAttachByUserID(forum.Permuserlist, userid))
{
allowdownloadattach = true;
}
else
{
if (Utils.StrIsNullOrEmpty(forum.Getattachperm)) //权限设置为空时,根据用户组权限判断
{
// 验证用户是否有有允许下载附件权限
if (usergroupinfo.Allowgetattach == 1)
allowdownloadattach = true;
}
else if (Forums.AllowGetAttach(forum.Getattachperm, usergroupinfo.Groupid))
allowdownloadattach = true;
}
return allowdownloadattach;
}
开发者ID:khaliyo,项目名称:DiscuzNT,代码行数:21,代码来源:UserAuthority.cs
-
六六分期app的软件客服如何联系?不知道吗?加qq群【895510560】即可!标题:六六分期
阅读:19133|2023-10-27
-
今天小编告诉大家如何处理win10系统火狐flash插件总是崩溃的问题,可能很多用户都不知
阅读:9973|2022-11-06
-
今天小编告诉大家如何对win10系统删除桌面回收站图标进行设置,可能很多用户都不知道
阅读:8317|2022-11-06
-
今天小编告诉大家如何对win10系统电脑设置节能降温的设置方法,想必大家都遇到过需要
阅读:8686|2022-11-06
-
我们在使用xp系统的过程中,经常需要对xp系统无线网络安装向导设置进行设置,可能很多
阅读:8627|2022-11-06
-
今天小编告诉大家如何处理win7系统玩cf老是与主机连接不稳定的问题,可能很多用户都不
阅读:9643|2022-11-06
-
电脑对日常生活的重要性小编就不多说了,可是一旦碰到win7系统设置cf烟雾头的问题,很
阅读:8611|2022-11-06
-
我们在日常使用电脑的时候,有的小伙伴们可能在打开应用的时候会遇见提示应用程序无法
阅读:7991|2022-11-06
-
今天小编告诉大家如何对win7系统打开vcf文件进行设置,可能很多用户都不知道怎么对win
阅读:8642|2022-11-06
-
今天小编告诉大家如何对win10系统s4开启USB调试模式进行设置,可能很多用户都不知道怎
阅读:7527|2022-11-06
|
请发表评论