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 )

12895 put(a) pogledan, 8 odgovor(a) 29.2.2012. 17:58:52Kreirao(la) shawndg
shawndg

shawndg

29.2.2012. 17:58:52
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.
Ovaj sadržaj još nije ocijenjen. 
1871 Reputacija 252 Ukupno objava
khorvat

khorvat

29.2.2012. 23:40:23
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
Ovaj sadržaj još nije ocijenjen. 
15993 Reputacija 2214 Ukupno objava
shawndg

shawndg

3.3.2012. 8:21:51
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 ?


Ovaj sadržaj još nije ocijenjen. 
1871 Reputacija 252 Ukupno objava
khorvat

khorvat

3.3.2012. 15:17:22
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
Ovaj sadržaj još nije ocijenjen. 
15993 Reputacija 2214 Ukupno objava
shawndg

shawndg

3.3.2012. 16:20:56
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.

Ovaj sadržaj još nije ocijenjen. 
1871 Reputacija 252 Ukupno objava
imarusic

imarusic

6.3.2012. 8:59:31
Hi Shawn,

if I undestood correctly, you would like to put a blog post list on user profile page?
Ovaj sadržaj još nije ocijenjen. 
3016 Reputacija 428 Ukupno objava
shawndg

shawndg

6.3.2012. 16:36:03
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.

Ovaj sadržaj još nije ocijenjen. 
1871 Reputacija 252 Ukupno objava
imarusic

imarusic

6.3.2012. 19:37:42

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?
Ovaj sadržaj još nije ocijenjen. 
3016 Reputacija 428 Ukupno objava