Esempio n. 1
0
 // dynamically create provider
 private static void CreateProvider()
 {
     objProvider = (DataProvider)(Framework.Reflection.CreateObject("data", "DotNetNuke.Modules.ActiveForums", ""));
 }
Esempio n. 2
0
 public int Reply_Save(int PortalId, ReplyInfo ri)
 {
     return(Convert.ToInt32(DataProvider.Instance().Reply_Save(PortalId, ri.TopicId, ri.ReplyId, ri.ReplyToId, ri.StatusId, ri.IsApproved, ri.IsDeleted, ri.Content.Subject.Trim(), ri.Content.Body.Trim(), ri.Content.DateCreated, ri.Content.DateUpdated, ri.Content.AuthorId, ri.Content.AuthorName, ri.Content.IPAddress)));
 }
Esempio n. 3
0
 public void Profiles_Save(UserProfileInfo ui)
 {
     DataProvider.Instance().Profiles_Save(ui.PortalId, ui.ModuleId, ui.UserID, ui.TopicCount, ui.ReplyCount, ui.ViewCount, ui.AnswerCount, ui.RewardPoints, ui.UserCaption, ui.Signature, ui.SignatureDisabled, ui.TrustLevel, ui.AdminWatch, ui.AttachDisabled, ui.Avatar, (int)ui.AvatarType, ui.AvatarDisabled, ui.PrefDefaultSort, ui.PrefDefaultShowReplies, ui.PrefJumpLastPost, ui.PrefTopicSubscribe, (int)ui.PrefSubscriptionType, ui.PrefUseAjax, ui.PrefBlockAvatars, ui.PrefBlockSignatures, ui.PrefPageSize, ui.Yahoo, ui.MSN, ui.ICQ, ui.AOL, ui.Occupation, ui.Location, ui.Interests, ui.WebSite, ui.Badges);
     // KR - clear cache when updated
     DataCache.CacheClearPrefix(string.Format("AF-prof-{0}", ui.UserID));
 }
Esempio n. 4
0
        private string BuildRSS(int PortalId, int TabId, int ModuleId, int intPosts, int ForumID, bool IngnoreSecurity, bool IncludeBody)
        {
            DotNetNuke.Entities.Portals.PortalController pc = new DotNetNuke.Entities.Portals.PortalController();
            DotNetNuke.Entities.Portals.PortalSettings   ps = DotNetNuke.Entities.Portals.PortalController.GetCurrentPortalSettings();
            DotNetNuke.Entities.Users.UserInfo           ou = DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo();
            UserController uc = new UserController();
            User           u  = uc.GetUser(PortalId, ModuleId);

            DataSet ds = DataProvider.Instance().UI_TopicsView(PortalId, ModuleId, ForumID, ou.UserID, 0, 20, ou.IsSuperUser, SortColumns.ReplyCreated);

            if (ds.Tables.Count > 0)
            {
                offSet = ps.TimeZoneOffset;
                if (ds.Tables[0].Rows.Count == 0)
                {
                    return(string.Empty);
                }
                drForum = ds.Tables[0].Rows[0];

                drSecurity = ds.Tables[1].Rows[0];
                dtTopics   = ds.Tables[3];
                if (dtTopics.Rows.Count == 0)
                {
                    return(string.Empty);
                }
                bView = Permissions.HasPerm(drSecurity["CanView"].ToString(), u.UserRoles);
                bRead = Permissions.HasPerm(drSecurity["CanRead"].ToString(), u.UserRoles);
                StringBuilder sb = new StringBuilder(1024);
                if (bRead)
                {
                    ForumName        = drForum["ForumName"].ToString();
                    GroupName        = drForum["GroupName"].ToString();
                    ForumDescription = drForum["ForumDesc"].ToString();
                    //TopicsTemplateId = CInt(drForum("TopicsTemplateId"))
                    bAllowRSS = Convert.ToBoolean(drForum["AllowRSS"]);
                    if (bAllowRSS)
                    {
                        sb.Append("<?xml version=\"1.0\" ?>" + System.Environment.NewLine);
                        sb.Append("<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\" xmlns:cf=\"http://www.microsoft.com/schemas/rss/core/2005\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:slash=\"http://purl.org/rss/1.0/modules/slash/\">" + System.Environment.NewLine);
                        string[] Params = { ParamKeys.ForumId + "=" + ForumID, ParamKeys.ViewType + "=" + Views.Topics };
                        string   URL    = string.Empty;
                        if (Request.QueryString["asg"] == null)
                        {
                            URL = DotNetNuke.Common.Globals.NavigateURL(TabId, "", Params);
                        }
                        else if (SimulateIsNumeric.IsNumeric(Request.QueryString["asg"]))
                        {
                            Params = new string[] { "asg=" + Request.QueryString["asg"], ParamKeys.ForumId + "=" + ForumID, ParamKeys.ViewType + "=" + Views.Topics };
                            URL    = DotNetNuke.Common.Globals.NavigateURL(TabId, "", Params);
                        }

                        if (URL.IndexOf(Request.Url.Host) == -1)
                        {
                            URL = DotNetNuke.Common.Globals.AddHTTP(Request.Url.Host) + URL;
                        }
                        // build channel
                        sb.Append(WriteElement("channel", 1));
                        sb.Append(WriteElement("title", HttpUtility.HtmlEncode(ps.PortalName) + " " + ForumName, 2));
                        sb.Append(WriteElement("link", URL, 2));
                        sb.Append(WriteElement("description", ForumDescription, 2));
                        sb.Append(WriteElement("language", PortalSettings.DefaultLanguage, 2));
                        sb.Append(WriteElement("generator", "ActiveForums  5.0", 2));
                        sb.Append(WriteElement("copyright", PortalSettings.FooterText, 2));
                        sb.Append(WriteElement("lastBuildDate", "[LASTBUILDDATE]", 2));
                        if (!(ps.LogoFile == string.Empty))
                        {
                            string sLogo = "<image><url>http://" + Request.Url.Host + ps.HomeDirectory + ps.LogoFile + "</url>";
                            sLogo += "<title>" + ps.PortalName + " " + ForumName + "</title>";
                            sLogo += "<link>" + URL + "</link></image>";
                            sb.Append(sLogo);
                        }
                        foreach (DataRow dr in dtTopics.Rows)
                        {
                            if (DotNetNuke.Security.PortalSecurity.IsInRoles(PortalSettings.ActiveTab.AuthorizedRoles))
                            {
                                //objModule = objModules.GetModule(ModuleId, TabId)
                                //If DotNetNuke.Security.PortalSecurity.IsInRoles(objModule.AuthorizedViewRoles) = True Then
                                //    sb.Append(BuildItem(dr, TabId, 2, IncludeBody, PortalId))
                                //End If
                                sb.Append(BuildItem(dr, TabId, 2, IncludeBody, PortalId));
                            }
                        }
                        sb.Append("<atom:link href=\"http://" + Request.Url.Host + HttpUtility.HtmlEncode(Request.RawUrl) + "\" rel=\"self\" type=\"application/rss+xml\" />");
                        sb.Append(WriteElement("/channel", 1));
                        sb.Replace("[LASTBUILDDATE]", LastBuildDate.ToString("r"));
                        sb.Append("</rss>");
                        //Cache.Insert("RSS" & ModuleId & ForumID, sb.ToString, Nothing, DateTime.Now.AddMinutes(dblCacheTimeOut), TimeSpan.Zero)
                        return(sb.ToString());
                    }
                }
            }


            return(string.Empty);
        }