<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<p>I've created an agenda.module which associates agenda nodes with
event nodes. I wish to list all agenda nodes associated with a
particular event when I view the event. I've come up with code in
hook_nodeapi that I *thought* would do this, but it isn't. Can anyone
help? Thanks.<br>
</p>
<div class="codeblock"><code><span style="color: rgb(0, 0, 0);"><span
 style="color: rgb(0, 0, 187);">&lt;?php<br>
</span><span style="color: rgb(0, 119, 0);">function </span><span
 style="color: rgb(0, 0, 187);">agenda_nodeapi</span><span
 style="color: rgb(0, 119, 0);">(</span><span
 style="color: rgb(0, 0, 187);">$node</span><span
 style="color: rgb(0, 119, 0);">, </span><span
 style="color: rgb(0, 0, 187);">$op</span><span
 style="color: rgb(0, 119, 0);">, </span><span
 style="color: rgb(0, 0, 187);">$arg </span><span
 style="color: rgb(0, 119, 0);">= </span><span
 style="color: rgb(0, 0, 187);">0</span><span
 style="color: rgb(0, 119, 0);">) {<br>
&nbsp; global </span><span style="color: rgb(0, 0, 187);">$form_values</span><span
 style="color: rgb(0, 119, 0);">;<br>
&nbsp; switch (</span><span style="color: rgb(0, 0, 187);">$op</span><span
 style="color: rgb(0, 119, 0);">) {<br>
&nbsp;&nbsp;&nbsp; case </span><span style="color: rgb(221, 0, 0);">'view'</span><span
 style="color: rgb(0, 119, 0);">:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: rgb(255, 128, 0);">// If the user
has the view agenda perm and this node is agenda enabled<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // display the agenda list.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: rgb(0, 119, 0);">if (</span><span
 style="color: rgb(0, 0, 187);">user_access</span><span
 style="color: rgb(0, 119, 0);">(</span><span
 style="color: rgb(221, 0, 0);">'view agenda'</span><span
 style="color: rgb(0, 119, 0);">) &amp;&amp; </span><span
 style="color: rgb(0, 0, 187);">agenda_type_is_enabled</span><span
 style="color: rgb(0, 119, 0);">(</span><span
 style="color: rgb(0, 0, 187);">$node</span><span
 style="color: rgb(0, 119, 0);">-&gt;</span><span
 style="color: rgb(0, 0, 187);">type</span><span
 style="color: rgb(0, 119, 0);">)) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: rgb(0, 0, 187);">$output </span><span
 style="color: rgb(0, 119, 0);">= </span><span
 style="color: rgb(0, 0, 187);">agenda_list</span><span
 style="color: rgb(0, 119, 0);">(</span><span
 style="color: rgb(0, 0, 187);">$node</span><span
 style="color: rgb(0, 119, 0);">-&gt;</span><span
 style="color: rgb(0, 0, 187);">nid</span><span
 style="color: rgb(0, 119, 0);">); </span><span
 style="color: rgb(255, 128, 0);">// This gets a themed table.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Save output into a node property for retrieval from the
theme layer.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: rgb(0, 0, 187);">$node</span><span
 style="color: rgb(0, 119, 0);">-&gt;</span><span
 style="color: rgb(0, 0, 187);">agenda_view </span><span
 style="color: rgb(0, 119, 0);">= </span><span
 style="color: rgb(0, 0, 187);">$output</span><span
 style="color: rgb(0, 119, 0);">;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: rgb(255, 128, 0);">// Store the
data directly into the content array, for default display.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: rgb(0, 0, 187);">$node</span><span
 style="color: rgb(0, 119, 0);">-&gt;</span><span
 style="color: rgb(0, 0, 187);">content</span><span
 style="color: rgb(0, 119, 0);">[</span><span
 style="color: rgb(221, 0, 0);">'agenda'</span><span
 style="color: rgb(0, 119, 0);">] = array(<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: rgb(221, 0, 0);">'#value' </span><span
 style="color: rgb(0, 119, 0);">=&gt; </span><span
 style="color: rgb(0, 0, 187);">$output</span><span
 style="color: rgb(0, 119, 0);">,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: rgb(221, 0, 0);">'#weight' </span><span
 style="color: rgb(0, 119, 0);">=&gt; </span><span
 style="color: rgb(0, 0, 187);">15</span><span
 style="color: rgb(0, 119, 0);">,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; );<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>
</span><span style="color: rgb(0, 0, 187);">?&gt;</span></span></code></div>
<br>
I'm not sure about my use of $node-&gt;agenda_view and
$node-&gt;content['agenda'] as I basically copied that code from
another module (signup) which lists items in the event node view in the
format I wish.<br>
<br>
Thanks!<br>
<br>
-ron<br>
<pre class="moz-signature" cols="72">-- 
Ron Parker
Software Creations               <a class="moz-txt-link-freetext" href="http://www.scbbs.com">http://www.scbbs.com</a>
Self-Administration Web Site     <a class="moz-txt-link-freetext" href="http://saw.scbbs.com">http://saw.scbbs.com</a>
SDSS Subscription Mgmt Service   <a class="moz-txt-link-freetext" href="http://sdss.scbbs.com">http://sdss.scbbs.com</a>
Central Ave Dance Ensemble       <a class="moz-txt-link-freetext" href="http://www.centralavedance.com">http://www.centralavedance.com</a>
R &amp; B Salsa                      <a class="moz-txt-link-freetext" href="http://www.randbsalsa.com">http://www.randbsalsa.com</a>
</pre>
</body>
</html>