本文整理汇总了C#中Forum.GetPostEditableAttribute方法的典型用法代码示例。如果您正苦于以下问题:C# Forum.GetPostEditableAttribute方法的具体用法?C# Forum.GetPostEditableAttribute怎么用?C# Forum.GetPostEditableAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Forum
的用法示例。
在下文中一共展示了Forum.GetPostEditableAttribute方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateRecentPostsList
//.........这里部分代码省略.........
if (IsPostingFromVisibleSite == 1)
{
// Setup the Post Tag and Attributes
XmlElement post = CreateElement("POST");
AddAttribute(post, "COUNTPOSTS", dataReader.GetInt32NullAsZero("CountPosts"));
if (showPrivate)
{
AddAttribute(post, "LASTPOSTCOUNTREAD", dataReader.GetInt32NullAsZero("LastPostCountRead"));
}
// Add User-Hidden Status.
if ( showUserHidden && dataReader.DoesFieldExist("Hidden") && dataReader.GetInt32NullAsZero("Hidden") > 0 )
{
AddAttribute(post, "HIDDEN", dataReader.GetInt32NullAsZero("HIDDEN"));
}
int yourLastPost = dataReader.GetInt32NullAsZero("YourLastPost");
//add the editable attribute
if (InputContext.ViewingUser != null)
{
int editable = 0;
if (InputContext.ViewingUser.UserID != userID)
{
editable = 0;
}
else
{
if (yourLastPost > 0 )
{
DateTime dateMostRecent = dataReader.GetDateTime("MostRecent");
editable = Forum.GetPostEditableAttribute(userID, dateMostRecent);
}
else
{
editable = 0;
}
}
AddAttribute(post, "EDITABLE", editable);
}
AddAttribute(post, "PRIVATE", dataReader.GetInt32NullAsZero("Private"));
// Add the siteid and reply details
postSiteID = dataReader.GetInt32NullAsZero("SiteID");
AddIntElement(post, "SITEID", postSiteID);
AddIntElement(post, "HAS-REPLY", dataReader.GetInt32NullAsZero("Replies"));
// Setup a Thread Tag and Attributes
XmlElement thread = CreateElement("Thread");
AddAttribute(thread, "FORUMID", dataReader.GetInt32NullAsZero("ForumID"));
threadID = dataReader.GetInt32NullAsZero("ThreadID");
AddAttribute(thread, "THREADID", threadID);
// Add the first post id if it exists in the result set
if (dataReader.DoesFieldExist("FirstPostID"))
{
AddAttribute(thread, "FIRSTPOSTID", dataReader.GetInt32NullAsZero("FirstPostID"));
}
threadPostType = dataReader.GetStringNullAsEmpty("Type");
AddAttribute(thread, "TYPE", threadPostType);