MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

Problem understanding blogs and events .  (Mono Support )

Viewed 12011 time(s), 8 post(s) 2/29/2012 5:58:52 PMby shawndg
shawndg

shawndg

2/29/2012 5:58:52 PM
I thought I seen someone on here who may have did this already but I cant find it.

T rying to see how complicated it would be to add blogs to my user profiles..

I want the logged in user to be able to have their own blogs on their profile page and then allow them to edit them

I would also like to do the same for events if possible.
This content has not been rated yet. 
1871 Reputation 252 Total posts
khorvat

khorvat

2/29/2012 11:40:23 PM
Hi, 

I'll try to find the source sample that we have for the blog, and can you please open a new topic for the calendar events so we can track these separately. 

Regards
This content has not been rated yet. 
15993 Reputation 2214 Total posts
shawndg

shawndg

3/3/2012 8:21:51 AM
Ok..

I got blogs creating upon registration by adding the following code I found on the forums
Slightly edited..

//create usr blog
BlogEntity blog = new BlogEntity(GuidExtension.NewSequentialGuid());
blog.Name = membershipUser.UserName;
blog.Slug = UrlSeoOptimizer.GetOptimizedString(blog.Name);
blog.DateCreated = DateTime.Now;
blog.UserId = userId;
blog.ApplicationId = MembershipRepository.GetInstance().GetApplicationId();
blog.LanguageId = LocalizationUtility.GetCurrentLanguageId();
 
MonoXCacheManager cacheManager = MonoXCacheManager.GetInstance();
cacheManager.RemoveAll(CacheKeys.Blog.Root);
cacheManager.RemoveAll(CacheKeys.Blog.Editors);
 
using (BlogRepository rep = BlogRepository.GetInstance())
    rep.SaveBlog(blog);

I added the code to my
public override void CreateAccount(MembershipUser membershipUser)

function.. at the end after i know the account was created..

Ok now I seem to be able to navigate to
http://localhost/blog/posts/username/
and load the blog up.

Ok, now I think I need to build a customer part that I can place on all my members profiles to list just their blogs..

I am thinking I can prob inherit
<%@ Register TagPrefix="MonoX" TagName="BlogList" Src="/MonoX/ModuleGallery/Blog/BlogList.ascx" %>
and sets its property somehow to the current profiles name ?


This content has not been rated yet. 
1871 Reputation 252 Total posts
khorvat

khorvat

3/3/2012 3:17:22 PM
Hi, if you are not in the hurry, I have sent an e-mail to guys that developed similar web part so we can give you bare-bone code for that by Monday I think.

Regards
This content has not been rated yet. 
15993 Reputation 2214 Total posts
shawndg

shawndg

3/3/2012 4:20:56 PM
That would be great...

I found a property in the API on bloglist for userid=guid..

I then tried just hard coding it in but when i try bloglist.userid the field is not known..
Not sure if this is a mistake or if it was removed or if its not exposed.

This content has not been rated yet. 
1871 Reputation 252 Total posts
imarusic

imarusic

3/6/2012 8:59:31 AM
Hi Shawn,

if I undestood correctly, you would like to put a blog post list on user profile page?
This content has not been rated yet. 
3016 Reputation 428 Total posts
shawndg

shawndg

3/6/2012 4:36:03 PM
you got it..

According to the API documentation there is already a userid field that can be set..
But I cant seem to see this property inside .net only inside the API documentation can I find this.

Maybe its not exposed ?

Or maybe I need to create my own web part for this beyond that of a simple property I can set upon page load.

This content has not been rated yet. 
1871 Reputation 252 Total posts
imarusic

imarusic

3/6/2012 7:37:42 PM

Hi,

which MonoX version do you have? I've checked it on our side and UserID property is exposed and it works fine when I set the UserId, it fitlers only blog posts for that user.

Do you have source code edition?
This content has not been rated yet. 
3016 Reputation 428 Total posts