Thanks Earnie but I get the following error:<br><br>
The default value php code returned an incorrect value<br>Expected format : <pre>array(<br> 0 => array('uid' => value for uid),<br> // You'll usually want to stop here. Provide more values<br> // if you want your 'default value' to be multi-valued :
<br> 1 => array('uid' => value for uid),<br> 2 => ...<br>);</pre>Returned value :<br><br>So I assume it needs an array and would the $global user already exist?<br><br><div><span class="gmail_quote">On 11/1/07,
<b class="gmail_sendername">Earnie Boyd</b> <<a href="mailto:earnie@users.sourceforge.net">earnie@users.sourceforge.net</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Quoting Chris McCreery <<a href="mailto:chris.mccreery@gmail.com">chris.mccreery@gmail.com</a>>:<br><br>> I'm sure this is an easy one for you php coders but I'm a bit confused as to<br>> what is currently populating my dropdown list as it is now.
<br>><br>> I have created a CCK for user reference, but I would like the default<br>> value(or selected value) of the dropdown list to be the current user but<br>> then list out the other users available, I'm not sure of the code to use for
<br>> the PHP Code portion of the default value.<br>> global $user;<br>> return array(0 => array('value' => $user->name));<br>><br><br><?php<br>global $user<br>$result = db_query('SELECT name FROM {users} WHERE name != \'%s\'',
<br>$user->name);<br><br>$ret[] = $user->name<br><br>while ($u = db_fetch_object($result)) {<br>$ret[] = $u->name<br>}<br><br>return $ret;<br>?><br><br>You might also want to ``ORDER BY name'' when doing the select.
<br><br>Earnie -- <a href="http://for-my-kids.com/">http://for-my-kids.com/</a><br>-- <a href="http://give-me-an-offer.com/">http://give-me-an-offer.com/</a><br><br>--<br>[ Drupal support list | <a href="http://lists.drupal.org/">
http://lists.drupal.org/</a> ]<br></blockquote></div><br><br clear="all"><br>-- <br>Chris McCreery