<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16525" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=Arial size=2>Your code seems to work for a menu change where the 
uid, I want to be the uid of the member who is navigating the site.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I will also have similar links on members' user 
pages, profile pages, etc....so for these, the uid wouldn't change, it would 
always be the uid of that node's author.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I made the following change and it seems to 
work:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&lt;?php<BR>global $user;<BR>$node_type = 
'story';<BR>if (db_num_rows(db_query("SELECT * FROM {node} WHERE type='%s' AND 
uid=%d", <BR>$node_type, <STRONG><FONT 
color=#ff0000>$node-&gt;uid</FONT></STRONG>))) {<BR>&nbsp; print(t("View 
Story"));<BR>}<BR>else {<BR>&nbsp; print(t("Create 
Story"));<BR>}<BR>?&gt;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>----- Original Message ----- </FONT>
<DIV><FONT face=Arial size=2>From: "Jason Flatt" &lt;</FONT><A 
href="mailto:drupal@oadaeh.net"><FONT face=Arial 
size=2>drupal@oadaeh.net</FONT></A><FONT face=Arial size=2>&gt;</FONT></DIV>
<DIV><FONT face=Arial size=2>To: &lt;</FONT><A 
href="mailto:support@drupal.org"><FONT face=Arial 
size=2>support@drupal.org</FONT></A><FONT face=Arial size=2>&gt;</FONT></DIV>
<DIV><FONT face=Arial size=2>Sent: Friday, October 05, 2007 3:34 PM</FONT></DIV>
<DIV><FONT face=Arial size=2>Subject: Re: [support] db query to find out if 
member has node of type X</FONT></DIV></DIV>
<DIV><FONT face=Arial><BR><FONT size=2></FONT></FONT></DIV><FONT face=Arial 
size=2>&gt; On Friday 05 October 2007 03:02:22 Neil: esl-lounge.com 
wrote:<BR>&gt;&gt; How would I find out if User A had authored a node of type 
X?<BR>&gt;&gt;<BR>&gt;&gt; I have a link "View Story" that I would like to be 
"Create Story" if that<BR>&gt;&gt; member hasn't yet created that node 
type.<BR>&gt;&gt;<BR>&gt;&gt; Is that a complicated db query to do?<BR>&gt; 
<BR>&gt; Probably something like this would do it:<BR>&gt; <BR>&gt; global 
$user;<BR>&gt; $node_type = 'story';<BR>&gt; if (db_num_rows(db_query("SELECT * 
FROM {node} WHERE type='%s' AND uid=%d", <BR>&gt; $node_type, $user-&gt;uid))) 
{<BR>&gt;&nbsp; print(t("View story"));<BR>&gt; }<BR>&gt; else {<BR>&gt;&nbsp; 
print(t("Create story"));<BR>&gt; }<BR>&gt; <BR>&gt; Note: that is totally 
untested code and is likely to contain one or more <BR>&gt; errors.<BR>&gt; 
<BR>&gt; -- <BR>&gt; Jason Flatt<BR>&gt; </FONT><A 
href="http://www.oadaeh.net/"><FONT face=Arial 
size=2>http://www.oadaeh.net/</FONT></A><BR><FONT face=Arial size=2>&gt; Father 
of Six:&nbsp; </FONT><A href="http://www.flattfamily.com/"><FONT face=Arial 
size=2>http://www.flattfamily.com/</FONT></A><FONT face=Arial size=2> (Joseph, 
14; Cramer, 12; Travis, <BR>&gt; 10; Angela; Harry, 7; and William, 12:04 am, 
12-29-2005)<BR>&gt; Linux User:&nbsp;&nbsp;&nbsp;&nbsp; </FONT><A 
href="http://www.xubuntu.org/"><FONT face=Arial 
size=2>http://www.xubuntu.org/</FONT></A><BR><FONT face=Arial size=2>&gt; Drupal 
Fanatic: </FONT><A href="http://drupal.org/"><FONT face=Arial 
size=2>http://drupal.org/</FONT></A><BR><FONT face=Arial size=2>&gt; -- <BR>&gt; 
[ Drupal support list | </FONT><A href="http://lists.drupal.org/"><FONT 
face=Arial size=2>http://lists.drupal.org/</FONT></A><FONT face=Arial size=2> 
]<BR>&gt;</FONT></BODY></HTML>