Hi,
I've recently set up a small site on our intranet for twenty people to work collaboratively. It's been working great, but I'm now stumped when it comes to how we set up the privatemsg.module to fit the rest of the site.
On all of our other systems we use payroll numbers to log in, so that is what we've done with drupal. I've activated the profile.module and we have two fields, profile_firstname (fid=1) and profile_lastname (fid =2). This has worked fine using the profile_load_profile function to display actual names on posts and comments.
But I'm stumped as to how to do the same with privatemsg.module!
This is the code in question:
$result = db_query("SELECT DISTINCT(name) AS name FROM {privatemsg} p, {users} u WHERE p.author = u.uid AND recipient = '%d' AND p.timestamp > (UNIX_TIMESTAMP(NOW()) - (3600 * 24 * 30)) ORDER BY name", $user->uid);
while ($name = db_fetch_object($result)) {
$name = check_plain($name->name);
$form .= "<option value='$name'>$name</option>";
I have made a minor change already, which is instead of the 'contacts' dropdown displaying only those users who you have received messages from recently, it displays all users (this is fine with twenty people). The amended code looks like this:
<?php
$result = db_query("SELECT DISTINCT(name) AS name FROM {users} u ORDER BY name", $user->uid);
while ($name = db_fetch_object($result)) {