官术网_书友最值得收藏!

Managing comments

In Chapter 2, Preparing Drupal for a Social Networking Site, we briefly looked at all aspects of Drupal's administration area, including comments and their moderation. Now, let us look at how we can enable comments, and how they are created.

When creating content for our site (currently, either through the Add content shortcut in the administration bar, or via Content | Add content) there is a section entitled Comment settings. Clicking this brings the comment settings for the content into focus:

From here we can enable comments by selecting Open, or leave them disabled by selecting Closed. If comments are enabled, users still require the appropriate permission (Post comments) to post comments. The default option for Comment settings for creating new content is defined by the settings for the content type.

Because social networking sites rely on user contributions, collaboration, and communication, for most user created content we would want to enable comments for that content. Once comments have been enabled for a particular content element, the Add new comment form is displayed.

As we are logged in, the comment form picks up our username, and has options for providing a subject for the comment and the comment itself. Because of our permissions, we can also select the format of the text we are posting; this allows us to change the format if we want to include additional HTML tags which are not allowed by default:

Comments are threaded within Drupal, which allows our users to comment on other comments, hopefully leading to a more interesting discussion among our users. Comments can be marked as a reply to another comment by clicking the reply link within the comment in question. Replies are clearly indented to make it obvious that they are in reply to a specific comment. This is illustrated in the following screenshot:

Comments within DinoSpace!

Comments are clearly a fundamental communication feature for any site which facilitates user interaction; however, these features can easily be abused by spammers. To help protect us against spam, we should only allow logged in users to post comments.

Note

While this will help to reduce spam, there are some more effective methods which we will cover in Chapter 10, Deploying and Maintaining Our Social Network.

By requiring users to sign up and log in before allowing them to comment, we can hopefully also encourage them to visit the site again, as they can receive e-mail notifications to further comments and also receive e-mails from us as site administrators, welcoming them to the site, or updating them about goings on within our site.

主站蜘蛛池模板: 开封县| 五指山市| 祁阳县| 丁青县| 宝鸡市| 理塘县| 阆中市| 电白县| 缙云县| 临汾市| 古浪县| 邓州市| 扎兰屯市| 扶风县| 静安区| 汉源县| 通榆县| 呈贡县| 仁化县| 台安县| 双柏县| 灌南县| 雅安市| 连南| 江陵县| 三原县| 民勤县| 孟连| 怀柔区| 泗洪县| 来安县| 海安县| 沈阳市| 远安县| 宜昌市| 永川市| 伊通| 永寿县| 宝兴县| 福清市| 威宁|