17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1385 Views |
-
Blog and Forum module integration

2 September 2008 at 7:41pm Last edited: 2 September 2008 7:42pm
This is my first post in this Forum.
I have been playing around with Silver Stripe and I really like this CMS but I have some questions.
1. I want to be able to have the members who sign up in the forum module to be able to comment in the Blog module as members.
2. I want to integrate Avatars in the comments and that the Avantar links back to their profile in the forum.
3. I want to be able to list Comments as well as Forum posts in the forum profile and be able to link back to the relevant post.
I been spending quite some time searching the forum for answers for question number 1 above. Maybe this is already implemented in Silverstripe but I can't figure out how to activate it?
Anyway I looking forward to a reply. It should be great if I could use SilverStripe for my project and I'm prepared to spend some time hacking it, and contribute with code.
-
Re: Blog and Forum module integration

2 September 2008 at 10:26pm
Hi Jorne and welcome to the forum!
Everything you list there is very much doable in SilverStripe with a bit of tweaking!.
1) For example we did forum member / commenting syncing for a recent site - http://www.californiawomen.org/ - Only members of the forum could use comments so you can add this to your _config.php file - PageComment::set_comments_require_login(true); which will show a login button before they could post or there name prefilled if logged in.
2) Avatars in the comment I havent done before. But the 2 key files while editing comments are PageComment.php and PageCommentInterface.php in cms/code/sitefeatures/ and the templates (.ss files with the same names in cms/templates/) for the Avatar you could copy cms/templates/PageComment_singlecomment.ss to your themes templates directory (so your changes dont get lost when you upgrade and you can add this to it
I think that should get the authors avatar.<% if Author %>
$Avatar
<% end_if %>3) Again, I dont know your programming esp but its just 1 SQL query to get the latest comments. Eg define this method on forum/code/ForumMemberProfile.php in the ForumMemberProfile_Controller
function LatestComments() {
$member = Member::currentUser();
if(!$member) return false;
$comments = DataObject::get("PageComment", "AuthorID = '$member->ID'","Created DESC","",10);
return $comments;Then in the template (ForumMemberProfile_show.ss) you can do
<% control LatestComments %>
$Comment
<% end_control %>Which will output all the posts from our LatestComments method we defined in the step before
-
Re: Blog and Forum module integration

2 September 2008 at 11:11pm
Thank you so much for this information!!
| 1385 Views | ||
|
Page:
1
|
Go to Top |


