Drupal is up and running but how do I ...?

what do I need to add to this code to alphabetize

I found this awesome little snippet of code here on the forums which works wonderfully to list users by their role. What would I need to add to this to list it alphabetically as well?

$rid = 6;
$result = db_query("SELECT u.uid, u.name, u.status FROM {users} u INNER JOIN {users_roles} ur ON u.uid=ur.uid WHERE ur.rid = %d AND u.status = 1", $rid);
while ($u = db_fetch_object($result)) {
  $items[] = l($u->name, "user/" . $u->uid);
}
return theme('item_list', $items);

Amy

site/node/fubar does not give 404

I just tried out going to http://somedrupalsite.com/node/xxxxfubar and they do not give the 404 page as they should. Only drupal.org does that. What is the reason for this please? I noticed this when I saw some very badly behaving bots on my site indexing "node/this" and "/node/that" and "/node/everythinginbetween" but it's all the same front page.

Thumbnail Image in table view on Views module

I have created a table view with the views module listing several fields from nodes I created using CCK and contemplate. One extra field I would like to display would be a thumbnail size image for the node. I created such a "teaser image" field in CCK with image field but when I try to include it as one of the fields in the table view nothing appears. Is there a better way of doing this?

Anonymous user cannot view one of the fields in Views module

I have set up a table list view for nodes I created with CCK and contemplate. All of the fields on the table show up fine for anonymous users except for one of the fields titled "address". For an authenticated user the field shows the address but the for an anonymous user all that shows up is "n/a". Is there any way to fix this problem? Here is the url of the problem
http://chibabeat.com/test_site/?q=/restaurants

Profile & Views modules

I'd like to get a tabular representation of my users.

I've tried the /profile view - I know I can edit the PHPTemplate theme to override and modify what is displayed for each user - but - I can't see how to wrap it all - so - each user becomes a <tr> row - but - how to add the top/bottom <table> parts?

Or - is there any way to get this using the views module? Can the user's profile fields be exposed to views easily?

What is the uid field in the node table supposed to contain?

Hello,

I've always lived a happy life thinking that the uid field in the node table contained the user ID of the user who created the node.

But in a custom node module I'm developing, the following happens:
- user with id 8 creates a node
- uid = 8 for this node (in the node table), everything is perfect
- then, user 1 (admin) does his webmaster's job by cleaning up and editing this node
- now, uid = 1 for this node (in the node table)

Does it mean node.uid stores the user ID of the user who last modified the node, or did I do something wrong?

Any help on that will be greatly appreciated.
Thanks,
Vincent

PS. By looking around line 445 in node.module ($Id: node.module,v 1.641.2.12 2006/07/26 12:12:27 killes Exp $), it does seem uid is initialised with $node->uid (the previous user ID), and not $user->uid (the current user ID). Therefore, the node should retain its initial uid (8 in my example). I'm puzzled...

<?php
$node_table_values = array('nid' => $node->nid, 'vid' => $node->vid,
'title' => $node->title, 'type' => $node->type, 'uid' => $node->uid,
'status' => $node->status, 'created' => $node->created,
'changed' => $node->changed, 'comment' => $node->comment,
'promote' => $node->promote, 'moderate' => $node->moderate,

Pages

Subscribe with RSS Subscribe to RSS - Post installation