Mono Support Personal user blog 

Viewed 19809 time(s), 11 post(s), 12/30/2012 10:58:27 AM - by alexsk
12/30/2012 10:58:27 AM
61 Reputation 8 Total posts

Hi,
Now there is just a general blog for all users.
Could you please tell me is it possible to create a personal user blog? With the possibility of publishing articles in the general blog.

1
12/30/2012 6:31:53 PM
15993 Reputation 2214 Total posts

Hi, There is a possibility to create a personal blog we can provide you with a sample code, but if you want it to propagate to general blog you will have to copy it to that blog. But I think that you are thinking about showing blog articles.without the filter when you say general blog, this is possible and it will work without any additional effort. Regards

2
12/30/2012 6:55:27 PM
61 Reputation 8 Total posts

Thank you for answer. Could you give me sources sample to review?

3
1/3/2013 7:54:52 PM
15993 Reputation 2214 Total posts

Sorry for a delay we will provide you with small sample code soon.

Regards

4
1/3/2013 8:13:18 PM
61 Reputation 8 Total posts

Thank you

5
1/4/2013 8:47:27 AM
3016 Reputation 428 Total posts

Hi,

here is a sample code for creating a user blog:

It's a good place to call this method in membership editor after user registration. You can use Membership editor AccountCreated event. I believe that you already have some existing users who do not have blog created so you will also need to create a blog for those users.

public void CreateBlogForUser(MembershipUser user)
        {
            BlogEntity blog = new BlogEntity(GuidExtension.NewSequentialGuid());
            blog.Name = user.UserName;
            blog.Slug = UrlSeoOptimizer.GetOptimizedString(blog.Name);
            blog.DateCreated = DateTime.Now;
            blog.UserId = new Guid(user.ProviderUserKey.ToString());
            blog.ApplicationId = MembershipRepository.GetInstance().GetApplicationId();
            blog.LanguageId = LocalizationUtility.GetCurrentLanguageId();
 
            MonoXCacheManager cacheManager = MonoXCacheManager.GetInstance();
            cacheManager.RemoveAll(MonoSoftware.MonoX.Caching.CacheKeys.Blog.Root);
            cacheManager.RemoveAll(MonoSoftware.MonoX.Caching.CacheKeys.Blog.Editors);
 
            using (BlogRepository rep = BlogRepository.GetInstance())
                rep.SaveBlog(blog);
        }
Regards.

6
1/4/2013 1:46:30 PM
61 Reputation 8 Total posts

Hi,
Thank you for answer. I have another question.
I can do reflection articles posted users on common blogs to user's wall such as it make messages from discussion board?

Best wishes

7
1/4/2013 3:13:47 PM
3016 Reputation 428 Total posts

Sorry, I got confused, can you please provide me with more details regarding your last issue?

I can do reflection articles posted users on common blogs to user's wall such as it make messages from discussion board?
Regards

8
1/4/2013 3:43:56 PM
61 Reputation 8 Total posts

I mean functionality of LATEST DISCUSSION block, on MY PROFILE page, only for user's articles on blogs

9
1/7/2013 12:06:12 PM
3016 Reputation 428 Total posts

Hi,

You can use BlogPostList.ascx module and set the UserId property. In order to change styling you need to change the template which can be found here(~\Portal\App_Templates\Default\BlogTemplates\BlogList and BlogListShort)

Regards.

10
1 2
This is a demo site for MonoX. Please visit Mono Software for more info.