Content Rating

1. Introduction

This guide will quickly walk you through installing and configuring a custom asp comment system on your site. It assumes that you have a recent version of PHP or the .NET framework(2.0 or later) and ASP.NET installed on your web server and that you are comfortable with Cascade. Knowledge of ASP is also useful, but not necessary to use this guide.

2. Components

There are several components to the comment system including the display comment blocks, the comment script itself, and the configuration page. The script will read its configuration from a configuration file that you will publish (with the use of a data definition), search and modify the XML data file, and display the results to user.

3. The Configuration Page

To edit the configuration of the comment script, go to /intranet/cast/asp-content-rating/content-rating-config.xml.  The output file for comments is where all comment data will be stored.  This should be a file that was previously used for this comment system, or a file that does not currently exist.  The time before redirect is how long, in seconds, to display the thank you page before redirecting.  Now for the more complicated sections:

    a. Page layout:
        This is a wysiwyg editor that lets you determine how each comment will appear on the page.  The only
        modification that is made to this during run-time is the #comments field will be replaced by the
        user comments on this page, the #add field will be replaced by the add button, the #displayRating
        field will be replaced by the page's current rating, and the #voteRating field will be replaced
        with the form used to vote
    b. Comment layout:
        This is a wysiwyg editor that lets you determine how each comment will appear on the page.  The only
        modification that is made to this during run-time is the #comment field will be replaced by the
        current comment, the #comments field will be replaced by the user's comments on this comment,
        the #add field will be replaced by the add button, and the #delete field will be replaced
        by the delete button for this comment.
    c. Add button:
        This is a wysiwyg field that lets you determine how your add button will look.  Do not modify the
        <form></form> tags, and do not remove the submit button completely.  Any other change will be fine
    d. Delete button:
        This is a wysiwyg field that lets you determine how your delete button will look.  Do not modify the
        <form></form> tags, and do not remove the submit button completely.  Any other change will be fine
    e. Vote Layout:
        This is a wysiwyg field that lets you determine how your vote form will look.  Do not change the
        type or value of the input buttons for voting, and do not change the type of the submit button.
        It is suggested to only rearrange these buttons and modify the style of them, as well as the
        value of the submit button
    f. Nightly update information
        All of these fields should be filled in with valid login information for CMS, and the backup location should
        reside in a folder that already exists.  If the file itself already exists, it will be overwritten

4. The Data Synchronizer:

To Synchronize all comments on your publish server with your CMS, run content-rating-synchronizer.exe.  Note: For this to work, your configuration page must have valid login information as well as a valid server location

5. Setup

Create the data definition in CMS with the provided content-rating-data-definition.xml.  Navigate to Intranet/cast/content-rating/.  Create a page that uses this data definition, and set it to publish with the General/Simple XML configuration set.  Fill in all fields, and ensure that the CMS information is correct.  Next, create a stylesheet for each provided .xsl file.  Then upload all php files.

6. Using

To use the script, publish the page and file assets.  Then put the asp-content-rating-global block into the page that you want to be able to use an PHP feature in.  To display a vote form, apply a current page block and the content-rating-display-form.xsl stylesheet where you want the vote form to appear.  To enable commenting on the current page, apply a current page block and the content-rating-display-comments.xsl stylesheet where you want the comments to appear.  To display the current rating of a site, apply a current page block and the content-rating-display-score.xsl stylesheet where you want the rating to appear.

Content Rating Files

  1. content-rating-PHP.zip
    This zip file contains all the necessary scripts and XML files for PHP.
  2. content-rating-NET.zip
    This zip file contains all the necessary scripts and XML files for .NET.
  3. Default-aspx.cs
    This is the main .NET script.
  4. content-rating-config-data-definition.xml
    This XML is used as the data definition for the configuration page.
  5. content-rating-config-xml-php.txt
    This is an example comment configuration file.
  6. content-rating-data-synchronizer-php.txt
    This is the script that uploads all of the comments to the CMS.
  7. content-rating-data-xml-php.txt
    This is an example comment data storage XML file.
  8. content-rating-delete-comment-php.txt
    This is the file used to handle delete requests.
  9. content-rating-display-comments-php.txt
    This is the file used to display the comments of any given page.
  10. content-rating-display-comments.xsl
    This is a XSL file used to display the comments of the current page.
  11. content-rating-display-form-php.txt
    This is the file used to display the vote form for any given page.
  12. content-rating-display-form.xsl
    This is the XSL file used to display the vote form for the current page.
  13. content-rating-display-score.xsl
    This is a XSL file used to display the rating of the current page.
  14. content-rating-post-comment-php.txt
    This is the file used to handle post requests.
  15. variables-php.txt
    This is a file used to parse the XML configuration.