Ok so I thought it was this but I really have no idea what's going on. I assumed that setting uid to $user=>uid would make that my default value for the cck field but I still the the aforementioned error.<br><br>global $user
<br>return array(<br> 0 => array('uid' => $user=>uid),<br>);<br><br><br>Thanks<br>Chris<br><br><br><div><span class="gmail_quote">On 11/1/07, <b class="gmail_sendername">Chris McCreery</b> <<a href="mailto:chris.mccreery@gmail.com">
chris.mccreery@gmail.com</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;">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><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?<div><span class="e" id="q_115fc56246611941_1">
<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" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">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" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">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/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://for-my-kids.com/</a><br>-- <a href="http://give-me-an-offer.com/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://give-me-an-offer.com/</a><br><br>--<br>[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://lists.drupal.org/</a> ]<br></blockquote></div><br><br clear="all"><br></span></div>-- <br><span class="sg">Chris McCreery
</span></blockquote></div><br><br clear="all"><br>-- <br>Chris McCreery