Keyvan Nayyeri

God breathing through me

Community Server 2007 Service Pack 2 and Views Count

After upgrading my site to Community Server 2007 Service Pack 2, I noticed a problem in my views counter in blog Control Panel: all my views counters stopped and Community Server didn't increment statistics after upgrade.

The first step was to check everything and make sure I haven't missed any upgrade step, jobs are running, my site has a correct structure and there is no exception logged in database about this issue.  And nope, they were not the reason.  After asking on private alias and Community Server forums, I got no response and finally decided to stick with it to solve the problem myself.

As I didn't see any similar issue on Community Server forums, I thought this may be a result of my custom blog theme so tried to see what's new in blog themes which can cause my problem.  After comparing Chameleon controls, I belief that there is a new addition to WeblogPostData control: IncrementViewCount property.

This property is set to false by default and this will stop the views counter from incrementing values so it's necessary to set this property to true in order to have a correct views counter value.

So here is the element that should be placed inside the page where you want to display the post body:

<CSBlog:WeblogPostData ID="WeblogPostData3" runat="server" Property="FormattedBody" IncrementViewCount="true">

This was listed as a feature enhancement in announcement post for Service Pack 2.  Using this new property, views counter won't be updated for truncated posts (for example, what you see in my blog homepage for post bodies) and helps to have real statistics for each post.

11 Comments

Dave Burke
Jun 14, 2007 9:42 PM
#
blog bits The current build of Community Server is now 3.0.20611.960. Congratulations to the Core Development
Don't let those Community Server SP2 View Counts die on the digital vine. Keyvan with a speedy fix

Community Blogs
Jun 14, 2007 10:19 PM
#
blog bits The current build of Community Server is now 3.0.20611.960. Congratulations to the Core Development

Yoda's Blog
Jun 17, 2007 5:03 PM
#
But I'm still fighting with the blogs... Either I'm getting new hardware, splitting out the IIS

Susan
Jun 19, 2007 12:55 PM
#
Where exactly should that be added? I have a shared blog set and wasn't sure where that value needed to go?

Keyvan Nayyeri
Jun 20, 2007 7:21 AM
#

Susan,

You have to search for all <CSBlog:WeblogPostData /> elements and add that new IncrementViewCount attribute to all elements that should be considered in statistics.


skylin.xin
Jun 28, 2007 8:22 PM
#
thanks; may be this issue is a careless omission of CS2007 SP2, that all CS2007 SP2 themes both havn't this property;

Rich Wallace
Jul 12, 2007 1:48 PM
#
Did some digging around last night to see if there were any other CS'ers who ran into an issue where

le_sloth
Sep 01, 2007 4:34 PM
#
excellent!! this has been bugging me for several weeks now and couldn't figure out what had gone wrong?! seems odd that this new element was left out of the default theme - it's there for all of the others! thanks :)

Ron Crumbaker
Oct 17, 2007 8:36 AM
#
WOW! Thank you for this fix. I've been trying to find the solution! Plus, this is my favorite theme so far for CS 2007.1 that I have found!

Chris Millensifer
Nov 29, 2007 7:38 AM
#
Double and triple checked this setting in our custom theme. It's there alrighty and the value for IncrementViewCount is indeed true yet the view counts never change and remain at ZERO. I have double and triple checked the jobs, they run just fine - no exceptions and the SQL completes just fine as well. I'm stumped

Leave a Comment





Ads Powered by Lake Quincy Media Network