Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > Popular Posts View modes: 
User avatar
Member
Member
amanda.ransburgh-ohioattorneygeneral - 4/30/2009 10:59:34 AM
   
Popular Posts
Is there a way to display popular posts, popular pages, or popular news in a module?

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 5/6/2009 7:18:56 AM
   
RE:Popular Posts
Hello,

There is a special web part for displaying most popular posts on forums (e.g. Forum - Most active threads). For other documents you can use a repeater and supply a custom orderby query (DocumentRatings or DocumentRatingValue).

Best regards,
Boris Pocatko

User avatar
Member
Member
amanda.r - 5/8/2009 8:56:16 AM
   
RE:Popular Posts
Support responded with the following:

In this case You will need to use repeater with custom query. At first you will need to select appropriate documents you want to display and then order them by the page views. In web analytics module there is already report for the page views. The SQL query used to get the number of page views and the document path is like this:

SELECT TOP 100 DocumentNamePath, SUM(HitsCount) FROM
Analytics_Statistics, Analytics_DayHits, View_CMS_Tree_Joined WHERE (StatisticsSiteID = 2) AND (StatisticsCode='pageviews') AND (StatisticsID = HitsStatisticsID) AND(StatisticsObjectID = NodeID) AND (StatisticsObjectCulture = DocumentCulture) AND (HitsStartTime >= '1.1.2009 0:00:00') AND (HitsEndTime <= '6.5.2009 0:00:00') GROUP BY DocumentNamePath ORDER BY SUM(HitsCount) DESC

StatisticsSiteID, HitsStartTime, HitsEndTime may all need changed.

I'm still having trouble making this work. But at least I have the logic to work with.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 5/11/2009 3:47:17 PM
   
RE:Popular Posts
Hi,

just for further reference. In the SELECT statement you need to select the columns with the data you want to display, in this case there is only DocumentNamePath, but you may need e.g. NodeName or DocumentName, etc.

Best Regards,
Juraj Ondrus