My first pondering: I was wondering if there was a way for me to take a random blog/image post (although the node type needn't be specified, as blogs/images are the only things users may use) that could not be from a specified user, or list of users, displayed in a block titled "Featured Post."

If above didn't really make any sense:
Random node in the form of block
Will not include certain users

And my second: Building upon the above idea, might it be also possible to create a block titled "Featured Poster/User," where a brief description of any random user as given by the admin (and as above, would NOT be of a specified list of users) could be accompanied by the user's image.

If above didn't really make any sense:
Random user in the form of block
Admin-given user description
Will not include certain users
Includes user image (preferably with a link to the user's profile)

The second is not nearly as important as the first, as I don't quite think the second is yet possible with current released modules.

Comments

roopletheme’s picture

Both are completely do-able with views. The first is quite simple... the second is only slightly more complex.

First pondering:

  • Create a new view.
  • Under the Block section, enable the Provide Block checkbox, set view type to either Full Node or Teaser List as you prefer, and set Nodes Per Block to 1.
  • Under the Filters section, add two Filters. The first filter will be on Node: Type, which you want to set to be equal to the node type(s) you want to restrict the search to. The second filter will be on Node: Author, where you can exclude one or more users by setting Author Name Is None Of, then selecting the user names you want to exclude. If you want something more elegant than this, you can define roles that include or exclude the user(s) you want to include or exclude, then filter by role instead of by username. This would make managing the list of excluded users somewhat easier.
  • Under Sort Criteria, select Random.
  • Publish the new block to a region on your site.

Second pondering:

You want a block to display a random user's picture. But Views under Drupal 5 is really a tool to query the node table, not the user table. Views-2 under Drupal 6 has significantly more capabilities to query other elements (like users), so you can create the block you describe in Views2/D6 in a straight-forward manner.

One option if you're using Views under Drupal 5 is to select a random article and filter out the user names you want to exclude as described above. Select either a List View or a Table View so that we can display individual fields. Then, under the Fields section, select User: Author Picture.

This will essentially give you the random user block you describe. However, it's not totally random... users who produce more content will be more likely to appear in the block that users who produce less content. If I needed something that was truly random, this is one I'd probably code up by hand using a query in a custom block... that's pretty easy too.

It's entirely possible that someone smarter than me knows easier or more effective ways to do this... if that's the case, I hope they post a follow-up. But that's what I'd do.