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

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.

主站蜘蛛池模板: 德兴市| 东阳市| 林芝县| 日喀则市| 万宁市| 临邑县| 苏尼特左旗| 湖北省| 台中县| 长顺县| 铁岭县| 咸丰县| 中卫市| 陈巴尔虎旗| 白玉县| 彩票| 射阳县| 射洪县| 兴安盟| 湘乡市| 布拖县| 平利县| 陵川县| 苍溪县| 沙洋县| 象州县| 东丽区| 边坝县| 濮阳市| 永胜县| 西安市| 墨脱县| 浑源县| 板桥市| 澄迈县| 沈丘县| 濮阳县| 凌海市| 来安县| 彭阳县| 浦县|