PHP Based Star-Rating and Commenting System for CommunityService.org
Introduction
The Star-Rating and Commenting System (“Rating System”) is a generic multi-user web-based rating and commenting system that will be used to provide feedback via star-ratings of an items and comments in plain-text. Among other uses, the System will be used by the CommunityService.org website (a non-profit volunteering website) to provide a service to the non-profit community to provide feedback related to non-profit organizations and volunteering opportunities.
User-permission model is based on standard role-based security. Unregistered viewers (non-members) will be able to browse the feedbacks (rating and comments submitted by authorized users) if the directories have anonymous User-Group assignment. The Rating System will also provide sorting and searching features based on the star-rating and text comments.
High-level features of this system which may be useful in estimating the effort involved in development of the system include:
• Role-based multi-user system
• Multi-level directories to organize items
• Star-Rating parameters definable at the directory level
• Star-Rating parameters inherit from parent directories
• Web-based signup with email verification
Real-Life Example: Epinions.com website provides a very relevant example which captures the functionality required by the Rating System (think of the Rating System as being diet-epinion). Please browse to the link below to see an example of rating page for a digital camera (item):
http://www.epinions.com/pr-Minolta_D...splay_~reviews
Epinion.com allows multiple ratings parameters for digital cameras as well as accompanying text. Epinions.com also averages the ratings into one top-level rating by aggregating all the ratings for an item. Additionally, please note that Epinions.com’s ratings parameters are dependent on what item you are viewing, for example, an mp3 player is rated on different parameters than a digital camera.
Mp3 players can be rated on the following parameters,
• Sound
• Ease of Use
• Durability
• Portability
• Battery Life
While the Digital cameras have following rating parameters:
• Ease of Use
• Durability
• Battery Life
• Photo Quality
• Shutter Lag
The Rating System will also use this “Context Dependent” rating parameters.
The Rating System will also allow multi-level hierarchy (also known as Directory) for items to support granularity. The hierarchy levels may be non-symmetric, for example, cameras may be 4 level deep and mp3 players only 2 levels deep.
The Rating System WILL NOT REQUIRE stores, price comparisons, related items. The Rating System only requires the requirements in this document.
Since this will be generic multi-user system, the item being rated and commented upon may any be a non-profit organization, a book, a volunteer, an event, a volunteering opportunity, or any imaginable item that the hosting website wishes to make available for rating and commenting.
Overview of the System
The diagram below provides a high-level overview of the system:
Figure 1: System Overview (See attachment)
Following bullet points highlight some of the important aspects of the system depicted in the System Overview diagram:
• The system is a directory based structure
• Directories contain sub-directories, or items
• Directories have Rating Parameters and User-Group assignments that define what ratings the users can provide for items placed in that directory, and who are the authorized users to perform functions in that directory, respectively
• Feedbacks (green boxes in the diagram) are assigned to items only
• Note that the Electronics Directory does not directly contain any items, it contains “MP3 Players” and “Camera” sub-directories
• Rating Parameters defined at a directory level are inherited by subdirectories.
• The exception to the inheritance rule is the Tripods directory that does not inherit any parameters from its parent since it was flagged as “orphan”
• Items can be placed at any level in the directory structure. Note that the “Books” top-level directory contains books in it while the “Electronics” top-level directory contains two levels of sub-directories to help organize the items into categories
• Directory level permissions control who gets to do what in which directory. This is done by assigning User-Groups to directories and users to User-Groups. Permissions are inherited in the directory structure unless a directory is marked as orphan.
Technical and Platform Requirements:
Since CommunityService.org is a non-profit website and runs on an $8/month linux based server (that’s what we can afford ), the Rating System is expected to be installable on whatever is available through the shared hosting service:
• The system shall by programmed in PHP (version 4.3.3 or earlier)
• The database for persisting information shall be mySQL (4.0.15-standard or earlier)
Functional Requirements
5.1 General Requirements:
5.1.1 System usage and configuration (admin functions) shall not require any SQL or PHP knowledge
5.1.2 The System shall have a site-wide header and footer template which can be customized (it is ok for this to require PHP knowledge, it is expected that this will be done at the time of installation and is not an ongoing admin task)
5.1.3 Documentation shall be provided listing all the installation and admin features
5.2 System Objects: The Rating System shall consist of the following classes of objects
5.2.1 Directory:
5.2.1.1 Attributes of Directory consist of Name (255 characters), a Description (html), Allowed Users Types and Rating Parameters
5.2.1.2 A Directory contain other directory(s), or item(s)
5.2.1.3 A Directory can only have single parent (no multiple inheritance to keep things simple)
5.2.1.4 Rating Parameters are defined at the directory level
5.2.1.5 Sub-directories inherit the parent directory’s Rating Parameters (by default, but this can be overridden)
5.2.1.6 The inheritance behavior may be overridden and a directory may be created without any inheritance from its parent directories (also known as “orphan” directories)
5.2.1.7 Orphan directory is specified by a simple checkbox (flag) during directory creation
5.2.1.8 The System shall allow the authorized user to remove the Orphan flag from a directory in which case it will inherit Rating Parameters and User-Group assignments from the parent directory.
5.2.1.9 Viewing of the directories is driven by the associated User-Group
5.2.1.10 Only Authorized Users shall be able to view the contents of the directory
5.2.1.11 Authorized Users shall be able to conduct all Directory Node management functions using a web-browser
5.2.1.12 The Rating Parameter and Permission inheritance shall be dynamic, e.g. when a parent directory is edited which resulted in addition of a User-Group then this User-Group should be available to all the sub-directories below it (other than those marked “orphan”)
5.2.1.13 The system shall allow authorized users to delete a directory
5.2.1.14 Deletion of a directory does not delete any items, it just moves the items into an “Invisible” directory
5.2.1.15 The system shall have an “Invisible” directory which contains all the items whose parent directories were deleted. The invisible directory does not have any Rating Parameters). It can hold any item.
5.2.1.16 When a directory is deleted, all items in that directory shall automatically be moved to the Invisible directory
5.2.1.17 Invisible directory is visible only to the Admin
5.2.1.18 The invisible directory is a catchall directory which can hold any item
5.2.1.19 When items are moved from the Invisible directory to a regular directory, the System shall make sure that the regular directory has all the Rating Parameters that the item inherited.
5.2.2 Item:
5.2.2.1 An Item can be rated by an Authorized User of a directory
5.2.2.2 An Item is viewable if the user is an is associated to a User-Group which is associated with this directory (or its parent)
5.2.2.3 Item attributes shall consist of: Name (255 characters), Picture, description (html)
5.2.2.4 Rating Parameters for an item shall be determined by where it is placed in the directory
5.2.2.5 The picture for the item shall be uploaded to the database via the upload button (which opens the standard file-system dialog box allowing the user to select a file)
5.2.2.6 The item creation shall allow the user to preview the page, go back make changes, and then submit when done
5.2.2.7 The system shall provide “Overall Ratings” rating values for an item which creates a mathematical average based aggregation of all feedback ratings for an item (for example, an “Ipod 10GB MP3 Player” item has 7 feedbacks ratings. Overall rating of Sound quality parameter will consist of sum of Sound Quality rating provided in the feedbacks divided by the number of feedbacks)
5.2.2.8 Only users which belong to a group with “Create Item” permissions are allowed to create an item (see more below for permissions)
5.2.2.9 The System shall allow the Authorized User to create items in a particular directory as part of the directory navigation (e.g. Create item in this directory)
5.2.2.10 If the directory in which an item exists is deleted than the item should be moved to the “Invisible” directory (which is only visible to the admin)
5.2.2.11 The System shall allow the items to be moved into other directories, one at a time (the GUI for the move function can be simple one, e.g. Authorized User provides target directory id and clicks submit)
5.2.2.12 The System shall ensure that the items are moved to compatible directories only. For example, you cannot move an MP3 player into the digital camera directory because the Ratings of the MP3 player, which were inherited from where it was initially created, are not compatible with those of the digital camera directory. However, an MP3 player can be moved from MP3 Players directory to “Portable MP3 Player” and “Home Theater MP3 Player” if the Rating Parameters are consistent.
5.2.2.13 The System shall allow the authorized user to edit or remove a specific feedback from an item
5.2.2.14 Optional: The System may allow the Authorized user to move multiple items from one directory to another directory (this requirement is optional)
5.2.3 Rating Parameters:
5.2.3.1 Rating Parameters shall be defined at the directory level.
5.2.3.2 All items placed in a particular directory get the Rating Parameters defined at that directory level (including any inherited from parent directory levels, if the directory is nor marked as an Orphan)
5.2.3.3 A Rating Parameters shall have five possible ratings
5.2.3.4 The text labels for Rating Parameters shall be configurable
5.2.4 Users:
5.2.4.1 The system shall have a simple signup process which allows the user to signup using following information:
• Email address as User name (system shall check for duplicates)
• Email address verification to ensure a real email address was entered
• Address
• Company
• Position (configurable dropdown)
5.2.4.2 The signup button shall be clickable only if the user checks the “Agree with terms and conditions” checkbox
5.2.4.3 After submitting signup information the new user shall be told that “a verification email has been sent to your email address to verify the validity of the email address”
5.2.4.4 Upon signup the user is still in “Tentative” status, i.e. not a verified user yet.
5.2.4.5 The user is immediately send an email with a link to verification page and a verification code
5.2.4.6 When the user checks the email, he/she will have the option to browse to the enclosed verification link, which contains all necessary information for verification (email address and a pin) or come the signup page and enter the information manually (email address and the pin sent in the email)
5.2.4.7 Once the user is verified, he/she will be marked as a “Verified User”
5.2.4.8 The signed up user shall remain in “tentative” status for 10 days and then automatically purged from the system if the user does not verify validity (this purging event may be tied to the verification page to avoid the overhead of creating a linux cron entry. Hence, every time a tentative user clicks on the verification link in his/her email, the verification page will verify that user as well as purging old unverified entries)
5.2.4.9 The System shall provide a “lost password” mechanism which emails the user his/her password
5.2.4.10 The admin shall get a notification email indicating a new user has signed up. (The admin may use this notification as an opportunity to include the Verified User to other user groups which may expand his/her access to view directories)
5.3 Creating Items
5.3.1 Only users in groups with appropriate permissions will be able to create directories and sub-directories
5.3.2 User Group with “Create Item” permission will be able to create items. If the user is not an admin than the item will require an approval
5.3.3 If the user creating an item is not an admin than the system shall send an email to the admin
5.4 Viewing Directories and Items
5.4.1 The System shall have a dynamic top-level page with top-level categories and sub-categories which the users can use to browse to the items
5.4.2 Each directory should contain summary information about the number of items contained in it, for instance, “mp3 players(7)”, where the number 7 signifies total number of items contained in the mp3 players directory tree (including all sub-directories underneath it)
5.4.3 When user is in leaf-level directory (one containing items), the System shall display all the items in that directory
5.4.4 When the user clicks on an item, the System shall display the Item Page
5.4.5 The item page shall contain item attributes (Name, description, and picture) and summary level information (Number of feedbacks, overall ratings, etc.)
5.4.6 The system shall compute and display an overall rating which is derived from the feedbacks for that item
5.5 Security and Permissions: The system shall follow the standard role-based-security method where users are assigned to User-Groups and User-Groups have certain permissions. Following permissions which can be assigned to User-Groups:
5.5.1 Item Permissions:
5.5.1.1 Create Item
5.5.1.2 Edit Item
5.5.1.3 Delete Item
5.5.1.4 Approve Item
5.5.1.5 Post Feedback (dependent on the user’s groups and the groups assigned to a directory)
5.5.1.6 Edit Feedback
5.5.1.7 Delete Feedback
5.5.1.8 Approve Feedback
5.5.2 Directory Permissions:
5.5.2.1 View Directory (dependent on the user’s groups and the groups assigned to a directory)
5.5.2.2 Create Directory
5.5.2.3 Edit Directory
5.5.2.4 Delete Directory
5.6 User-Groups - The System allow the admin to:
5.6.1 Create, view, edit and delete User-Groups
5.6.2 Assign users to one or more User-Groups
5.6.3 Assign User-Groups to directories
5.7 Activity Log:
5.7.1 The system shall have a simple activity log page which lists all the activities conducted with the system, the user, and the object modified and the activity undertaken
5.7.2 The log shall go back to 2 months
5.7.3 All entries older than 2 months shall be deleted every time the log page is loaded (to avoid the creation of a linux cron entry)
5.8 IP Blocking (optional):
5.8.1 The System shall have a mechanism to block certain IP addresses to limit System abuse
5.8.2 The IP Blocking mechanism shall be web-based allowing a simple method to add or remove IP addresses (for example, a simple text box with multiple comma separated IP addresses)
5.9 Word Filter:
5.9.1 The System shall have a mechanism to scan and filter textual feedback for profanity
5.9.2 The words list shall be configurable via web-browser by the admin only (no need for role-based permissioning this functionality)
Contractual Information:
• All rights to source-code (html, script, SQL, etc.) developed for the Rating System will be transferred to Waqar Ali (“Buyer”) upon payment
• The Buyer has the option to donate the source-code to the open-source community, further develop enhancements and user
• The Developer is at liberty to use open-source, shareware, or purchased components/scripts to develop/assemble the system provided that the Developer adheres to all copyright and license agreements of these components. The Developer, however is required to notify the Buyer which other components are being used.
Sites on which this proposal is posted:
Scriptlance.com
RentACoder.com
ProgrammingTalk.com