By bobderiemacker on
excuse my ignorance, but I am trying find where a "user list" might be found for my forum users (besides under the admin interface, ofcourse)
I would like the forum/site users to be able to access a list of all forum/site users for easy private messaging...
seems that it should be really simple, but I can't find it .. doh!
thanks
Comments
Views
The forum module itself does not make a listing of users (as with most Drupal modules, it does its "core" job of managing the forum, but does not try to create specialized functionality which Drupal overall or other modules should handle). The way to do this with Views 2: make a View of "users" (not nodes which is the default setting). If you just want a listing of users which people can click to get to their profile page and proceed to contact them if they want, then that's all you have to do.
If you want a Private Message or Contact form link next to each user in the listing, I don't believe there's a built-in field to show a link to send a PM, however if you want you could do a little trick:
1) Include a "User: Uid" field in the View which outputs just the UID. By default this will output a field with nothing but a # in it (the user's ID). Uncheck the "Link this field to its user" option.
2) Add a Views template file for just that field (find the correct file name by clicking "Theme: Information" in the View)... for instance in my case the file name is "views-view-field--myviewname--uid.tpl.php".
In the template file put some code like this, instead of the default content of the file that Views suggests. Where it prints $output, it will place each user's unique UID:
I also added a check_plain() function around $output which ensures there's no HTML or potentially dangerous code in it, since I'm not certain of the implications of putting its content into a link (better safe than sorry).
The above (which you should use) is is the same as writing the below code, but using a proper Drupal link function (use the above example, not this which I'm showing just for comparison):
Hope this helps :)
thx
thanks for the quick reply, greatly appreciated! I am still a little confused though. The first option is all I want to do, but I am having troubles figuring out views... any further instructions out there?
Views will require a bit of
Views will require a bit of learning to grasp, but it is very much worth the effort. Here's my guide-in-progress on both CCK and Views. http://www.davidnewkerk.com/book/18
Try going through it all the way, as many people have mentioned to me that this was key to them understanding these tools. The guide's not done yet, but it will give you a very big boost. Making a list of users will be very similar to what the guide shows (making a list of Articles)... however the key will be choosing the "User" option rather than "Node" as the first step when you create the View (right after you click "Add"). Different data/options are possible in a View completely depending on this first option. You can then add the "User: Name" field, adjust any other settings you want, create a Page display (and give it a URL path)... anyhow try the guide and this will all come into focus :)
I will check it out and let
I will check it out and let you know how it goes, thanks again!
thanks
nice job on the tutorial, it walked me through the issues I was stuck with, and in the end things started make sense :) thanks!