Adding a Content Chart
Date: 07-05-2007 13:11 Views: 7206
Requirements
The chart processing is server intensive and therefore MonkeyCMS does not allow real-time processing in any instance. Adding a content chart is reasonable straight forward but does require server access allowing you the ability to schedule tasks (either through Windows 'Scheduled Tasks' feature or Linux 'CRON' feature).
What is a Content Chart?
A content chart displays the x most popular pieces of a specified type of content on your site. This is useful for displaying things such as the most popular reviews or similar.
Processing the chart
Set up a CRON task to fire off at any interval you are comfortable with. On all but the busiest sites, every 10 minutes is fine. You need to schedule the processchart.php file in your admincp folder.
An example line from the CRON table is:
0-50/2 * * * * /path/to/yoursite/admincp/processchart.php
If you have a particularly busy site you can also specify a limit on the number of records to process. This is done with the limit parameter as in the following example:
0-50/2 * * * * /path/to/yoursite/admincp/processchart.php limit=5000
The charttemplate function
The documentation describes this function in detail - this is all you need to use to access the chart data and display it through the templates you specify.
Example templates
Using the following templates you can create a panel to add to your site. The best place would be into the MenuBar template using the following function:
(template|Chart:Panel)
The Chart:Panel Template
The Chart:Entry Template
The Chart:First Template
You can an example chart in action in the right-hand column on this page.
The chart processing is server intensive and therefore MonkeyCMS does not allow real-time processing in any instance. Adding a content chart is reasonable straight forward but does require server access allowing you the ability to schedule tasks (either through Windows 'Scheduled Tasks' feature or Linux 'CRON' feature).
What is a Content Chart?
A content chart displays the x most popular pieces of a specified type of content on your site. This is useful for displaying things such as the most popular reviews or similar.
Processing the chart
Set up a CRON task to fire off at any interval you are comfortable with. On all but the busiest sites, every 10 minutes is fine. You need to schedule the processchart.php file in your admincp folder.
An example line from the CRON table is:
0-50/2 * * * * /path/to/yoursite/admincp/processchart.php
If you have a particularly busy site you can also specify a limit on the number of records to process. This is done with the limit parameter as in the following example:
0-50/2 * * * * /path/to/yoursite/admincp/processchart.php limit=5000
The charttemplate function
The documentation describes this function in detail - this is all you need to use to access the chart data and display it through the templates you specify.
Example templates
Using the following templates you can create a panel to add to your site. The best place would be into the MenuBar template using the following function:
(template|Chart:Panel)
The Chart:Panel Template
HTML Code:
"panel">
Content Chart
"int">
(charttemplate|1|10|Chart:Entry|Chart:First)
HTML Code:
HTML Code:
You can an example chart in action in the right-hand column on this page.

