<div dir="ltr">May&nbsp; this is clue,<br><br>If you know&nbsp; member id,&nbsp; ,<br><br>Go to block&nbsp; configure<br><br>select&nbsp; &quot; Show if the following PHP code returns <code>TRUE</code> (PHP-mode, experts only). &quot;<br><br>and write the code<br>
<br>global $user<br><br>$userid=$user-&gt;uid;<br>if($userid ==10 || $userid ==10&nbsp; ){<br>&nbsp;&nbsp;&nbsp;&nbsp; <br>return TRUE;<br><br>}<br>else{<br><br>return FALSE;<br>}<br><br><br><div class="gmail_quote">On Mon, Oct 6, 2008 at 6:19 PM, Nick Young <span dir="ltr">&lt;<a href="mailto:nick_young@ncsu.edu">nick_young@ncsu.edu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">(Issue in Drupal 6)<br>
I need a php snippet that allows me to display (or hide) a block based<br>
on whether the user logged in is a member of a certain role, and that<br>
they are browsing the site at a certain path. I am able to display a<br>
block based on one of these things, but not both.<br>
<br>
IE:<br>
I can display a block if the user is a member of a role.<br>
I can display a block at a certain path (&lt;site&gt;/node/path/x)<br>
<br>
However, if i combine the two pieces of php code, then if one of them<br>
returns true, the block shows. What i need is for it to check if the<br>
path is TRUE, and then also check for the role membership. I have tested<br>
the code externally to Drupal, to make sure the nested IF statements are<br>
working properly, and they are. It&#39;s almost as if Drupal sees the first<br>
TRUE, and then stops looking to see if there are multiple conditions to<br>
check for as well.<br>
<br>
Any ideas? Thanks in advance.<br>
<br>
........................................................................<br>
Nick Young<br>
Outreach, Communications &amp; Consulting<br>
Office of Information Technology<br>
North Carolina State University<br>
Box 7109, Raleigh 27695<br>
Ph. 919.513.2716 | E-Mail: <a href="mailto:nick_young@ncsu.edu">nick_young@ncsu.edu</a> &lt;mailto:<a href="mailto:nick_young@ncsu.edu">nick_young@ncsu.edu</a>&gt;<br>
........................................................................<br>
<font color="#888888"><br>
<br>
<br>
--<br>
[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br>
</font></blockquote></div><br></div>