title: Drupal & View Custom Field & PHP
body: <p>Wondered if someone could assist me, I have no PHP knowledge so im struggling a bit.
  I have installed the following modules<br>
  To Do List Module - <a href="http://drupal.org/project/to_do" rel="nofollow">http://drupal.org/project/to_do</a><br>
  View Custom Field - <a href="http://drupal.org/project/views_customfield" rel="nofollow">http://drupal.org/project/views_customfield</a> - Field that allows usage of custom PHP code (with access to view's database result)  </p>
  
  <p><b>I created a view with the following fields:</b>  </p>
  
  <pre><code>User: Uid (excluded from display)
  Node: Title  
  To do list: Deadline  
  To do list: Priority  
  To do list: Start date  
  To do list: Status  
  To do assigned users: Assigned user ID (excluded from display)  
  To do list: Buttons (excluded from display)  
  Customfield: PHP code
  </code></pre>
  
  <p><b>The following Tokens/Replacement Patterns are available based on the above fields</b>  </p>
  
  <pre><code>* [uid] == User: Uid
  * [title] == Node: Title
  * [deadline] == To do list: Deadline
  * [priority] == To do list: Priority
  * [start_date] == To do list: Start date
  * [item_status] == To do list: Status
  * [uid_field] == To do assigned users: Assigned user ID
  * [buttons] == To do list: Buttons
  * [phpcode] == Customfield: PHP code
  * [markup] == Customfield: Markup  
  </code></pre>
  
  <p><b>What I would like to accomplish is:</b>  </p>
  
  <p>As, the button field has been excluded, I am trying to use the Customfield, to display   that button. But only display that button if the current user is the author of the To Do node.</p>
  
  <p><b>What ive aded to Customfield PHP code</b>  </p>
  
  <pre><code>&lt;?php  
  global $user;  
  $data-&gt;to_do_assigned_users;  
  if ($user-&gt;uid == $data-&gt;uid_field)  
  {  
  print '[buttons]';  
  }  
  ?&gt; 
  </code></pre>
  
  <p><b>What's happening</b><br>
  Nothing displays using the above code.   </p>
  
  <p>I know the [buttons] token works because when I use the following code, it displays the button.  </p>
  
  <pre><code>&lt;?php  
  print '[buttons]';  
  ?&gt;
  </code></pre>
  
  <p>So I assume something needs to be added so that the system can decide whether the current logged in user is the author of the node. Both the [UID] &amp; [UID_FIELD] always display the same value if I ouput it, so I thuogh that would work but it doesn't.  </p>
  
  <p>Any help would be very much appreciated.</p>
  
  <p>Charles </p>
  
  <p>Any help would be very much appreciated.</p>
  
  <p>Charles</p>