MAS:Members Comments

From Mansion Productions WIKI
Jump to: navigation, search

Contents

Auxiliary site file

You have to upload another aux file for the sites which will be using the Comments feature. The code for this file is found at the SITES > Sites List > Auxiliary Files menu (comments.php), and is common for all sites powered by this copy of MAS.


Gallery template tag

Insert the tag [comments:XX] in your gallery template at the place where you want the comments to be displayed. XX in the tag must be a number, indicating the number of latest comments you want to display. (For example: [comments:10]) The tag will display the last XX approved comments, ordered by date/time, newest first, and a form for adding a new comment.

After hitting the Submit button in the form, the comment is stored in the database as "unapproved", and you have the options to edit, approve, or delete this comment from the admin interface. There is also a global configuration setting for auto-approval of comments.

CSS styles

You can modify the appearance of the comments, by inserting these styles in your CSS and defining proper formats for the various elements:

#comments_posts td {
 font-family: Verdana;
 font-size: 12px;
 color: 999999;
 margin-bottom: 16px;
}
 
#comments_posts .username {
 color: #666666;
 font-weight: bold;
}
 
#comments_posts .date {
 font-style: italic;
}
 
#comments_posts hr {
 height: 1px;
 color: #B057FF;
}
 
#comments_form textarea {
 color: #D82616;
 width: 400px;
 height:70px;
}

The first definition - #comments_posts td - is for all text of the comments.

Separate styles are used for the username and date.

#comments_posts hr is for the separator between comments; you may put height: 0px to disable the line;

#comments_form textarea is for the new comments area

#comments_form input can be used optionally to change the appearance of the Submit button.

#usercomments can be used to style the whole block of comments (posts + form)

And if in addition you define these, then you will get the textarea on the right side, instead of beneath the comments. You just have to fill in the right dimensions in this definition:

#comments_posts { width: 50%; float: left; padding: 5px; } #comments_form { padding: 5px; }


To replace the "Submit" text and default style of the button, you can use the following CSS code:

#comments_form input {
  width: 65px;
  height: 21px;
  padding: 21px 0 0 0;
  margin: 0;
  border: 0;
  background: transparent url(images/submit.jpg) no-repeat center top;
  overflow: hidden;
  cursor: pointer; /* hand-shaped cursor */
  cursor: hand; /* for IE 5.x */
  display: block;
}

and use the attached button, uploaded to the members area images folder. If you upload it elsewhere, make sure to modify the path in the CSS. If you use a button with another size, make sure to update the width/height/padding values accordingly.


Administration

There is a menu item NEWS / EVENTS > Members Comments. There you can see all of the comments, broken down by content set. You may filter by site, or by category, or display only the new, unapproved comments. You have the option to edit each comment if you want to moderate the text, approve or delete. There are also options for mass-aproval or deletion of comments.

When you edit, approve or delete a comment, the affected content set is being automatically rebuilt !

For easier access to the comments belonging to particular content sets, a new batch action is added to the Content List - View/Edit Members comments. When you have checked one or more content sets in the Content List, and choose this action, you will be taken to the Members Comments administration, showing the entries for the selected sets only.


Advanced features

Template for View All Comments

When you have more approved comments, than what is displayed on one page (based on the number at the [comments:XX] tag), MAS is automatically displaying a link "View all comments". When clicked, this link will pop up a new window, listing all of the approved comments for that set.

This window will also look up for a template, in a fashion similar to the _Events popup, used with the MAS:Events_Calendar feature. It will look for a members area section named exactly _Comments_List, within the current site, and use its template (if found) for the popup window.

This template is fairly simple and supports only one tag - [comments] - which will be replaced with the list of comments. This page supports the same CSS classes, as the ones used at the gallery template. If such section holding a template is not found, MAS will display them using a simple default template.

Comments on tours

When a gallery page (content set or group) with comments is displayed inside a members area, i.e. in a directory protected with Basic HTTP Authentication, and the members is logged in, the "Add new comment" textarea is displayed. If a member is not logged in (i.e. this is a tour visitor), this textarea is hidden.

Comments Autoapprove

Automatic approval of all newly added comments can be enabled through a global configuration switch.

Modifying the Comments Form HTML

Demanding customers who want to change the text or layout of posted comments or the new comments form, can do so by editing the file <masdir>/interface/common/comments_form.php

Be careful, since a php syntax error in that file may break the content rebuilding function or the gallery page display! Always back up that file before making any changes!

Ban members from posting comments

By editing <masdir>/interface/common/comments_ban.php you can ban users with given IP addresses or usernames from posting new comments. There are comments in that file showing how exactly to do it.

Personal tools
Namespaces

Variants
Actions
Products
Navigation
Toolbox