Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I want to create a blog site in SP 2007 that allows the users to vote on existing blog posts but not to their own. Provide users instant voting talleys next to each post. How do I go about in accomplishing this is SharePoint 2007.

share|improve this question
add comment

2 Answers

One of the possible solutions is :

1) Create a list 'Votes' to hold votes with a look-up column 'Post Id'. This column will fetch the look up values from 'Id' column in Posts list. Also, create 'Vote'(Yes/No) and 'Voted by'(Person) columns.

2) Create a custom control which will have just a button to vote. You can hide the button from current user if he is the author of current post. For e.g if(SPContext.Current.Web.CurrentUser.Name==SPContext.Current.File.Item["Author"].toString()) //don't render the button.

3) On 'Vote' button click, you can check(by using CAML query) in the 'Votes' list if the current user has already voted against the current post(Post Id). If not, you can add his vote as new list item along with 'Post Id'.

share|improve this answer
add comment

Along the same lines as Amit's post above but without custom controls, Alexander Bautz has a very elegant Javascript solution available that I use all the time. It uses a custom list to hold the ratings and the rest is handled entirely by scripts so it makes a great no-code solution.

This doesn't address the "but not their own" component of your question but I've found that when content authors know that votes aren't anonymous the practice of "voting up" their own posts becomes self-regulating.

http://sharepointjavascript.wordpress.com/2011/05/28/hit-counter-and-star-rating-for-sharepoint/

UPDATED- Forgot to mention that the solution above does have a configuration switch to prevent multiple ratings, so even if your content authors try to upvote their own posts they can only do it once.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.