Community Documentation

Facebook-style Statuses: Views

Last updated July 2, 2010. Created by IceCreamYou on April 16, 2009.
Log in to edit this page.

The Facebook-style Statuses module provides Views integration to allow you to easily build lists of status updates in whatever format you want. Views integration also means that statuses can be integrated with other modules that use Views, like User Relationships, Flag, and Flag Friend.

Default Views

Percent signs (%) are used in place of arguments in URLs given below.

  • facebook_status user/%/status - Provides a list of a user's own status updates as well as messages posted on that user's profile by other users.
  • facebook_status_cross_post statuses/conversation/%,% - Like Facebook's "wall-to-wall" feature, shows a listing of statuses between two users on each others' profiles.
  • facebook_status_mentions statuses/mentions/%,% - Shows statuses which reference a given user by @mention. Allows multiple arguments to show statuses referencing multiple users, which can be used to show an exchange of @mentions between two users. Accepts UIDs or usernames as arguments.
  • facebook_status_recent statuses/recent - Lists all recent statuses, including those posted on other users' profiles.
  • facebook_status_tags statuses/term/% - Lists statuses with the given taxonomy term (terms are assigned with #hashtags, but don't include the hash mark [#] in the URL). Only available if the Facebook-style Statuses Tags submodule is enabled.

Suggested Views

  • Statuses of followed users (with the flag module [FBSS provides a default "Follow" flag, but not the Views for it])
  • Friends' Statuses (example for User Relationships [more]; example for Flag Friend)
  • Users' Last Statuses (filter to Last Status per User)
  • Administrative Updates (use like site announcements, filter by role or a special tag like #announcement)
  • "Most liked statuses" list (ordered by the number of times the default "Like" flag has been used on each status)
  • Any other user list; see an example here

The "Like" Flag

FBSS provides a default "Like" flag that allows users to indicate that they "like" a certain status. However, if you want to use this flag then you must add it to your Views yourself. Here are instructions (these apply to any other flag you add to status updates as well):

  1. Go to admin/build/views and click the "Edit" link next to the relevant view.
  2. Add the Flags: Facebook-style Status relationship. In its settings disable Include only flagged content, choose the Like flag, and choose Any User.
  3. Under Basic Settings set Distinct to Yes. (Only necessary for views of type Facebook-style Statuses Updates. The facebook_status view is a User view, so you don't need to do this there. You do need to do it for all other default views.)
  4. Then click the + button to add a Field. A list of lots of fields will appear. Choose Flags from the Groups dropdown in order to filter the list of fields to only Flag-related fields. You will have the fields Flags: Flag link and Flags: Flagged time available.
  5. If you add the relationship Flags: Error: missing title then you will also have the field Flags: Flag counter available to you. (I don't know why the title is missing but I'm 90% sure it's a bug in Flag and not in FBSS.)

Moderating statuses

FBSS is not really designed to have moderated content on the expectation that status updates could be so prolific and from so many users that moderation would be impractical. However, if this is something you need, you should install the Flag module and add an "approved" flag to statuses, then modify the views you're using so they only show statuses flagged as "approved." This would typically involve adding a relationship to the relevant flag type with the "include only flagged content" checkbox enabled.

Note that FBSS does come with Edit and Delete links as Views fields, and that these fields are enabled by default on some default views, and that these fields will only appear if users have permission to see them. Views Bulk Operations can be combined with Rule Sets to do bulk deletion if necessary.

Page status

No known problems

Log in to edit this page

About this page

Drupal version
Drupal 6.x
Audience
Developers and coders, Site administrators

Site Building Guide

Drupal’s online documentation is © 2000-2012 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License.