<!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.16640" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>OK, I'll put it on later this evening. It will have 
to be as a comment to an existing page.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Neil</FONT></DIV>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=shai@content2zero.com href="mailto:shai@content2zero.com">Shai 
  Gluskin</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=support@drupal.org 
  href="mailto:support@drupal.org">support@drupal.org</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, May 29, 2008 3:01 
PM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [support] Block visibility 
  quandry</DIV>
  <DIV><BR></DIV>Neil,<BR><BR>I'm glad you got a solution that meets your 
  requirements.<BR><BR>Would you mind adding a comment with this code and brief 
  explanation of it purpose to the "Overview on block visibility" -- or adding 
  it to the handbook page itself if you are on the docs team.<BR><BR><A 
  href="http://drupal.org/node/64135" 
  target=_blank>http://drupal.org/node/64135</A><BR><BR>This is an elegant 
  solution and I don't think something like it is on that page right 
  now.<BR><BR>Though this support listserve is spidered by search-engine bots, I 
  think it would still be much harder for someone to find this email exchange 
  than if it were posted to the handbook 
page.<BR><BR>Thanks,<BR><BR>Shai<BR><BR>
  <DIV class=gmail_quote>On Thu, May 29, 2008 at 7:34 AM, Neil: <A 
  href="http://esl-lounge.com">esl-lounge.com</A> &lt;<A 
  href="mailto:neil@esl-lounge.com">neil@esl-lounge.com</A>&gt; wrote:<BR>
  <BLOCKQUOTE class=gmail_quote 
  style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">great. 
    That seems to have done the trick. Thanks<BR><FONT 
    color=#888888><BR>Neil<BR></FONT>
    <DIV class=Ih2E3d><BR><BR>----- Original Message -----<BR>From: "Richard 
    Burford" &lt;<A 
    href="mailto:rich@freestylesystems.co.uk">rich@freestylesystems.co.uk</A>&gt;<BR>To: 
    &lt;<A href="mailto:support@drupal.org">support@drupal.org</A>&gt;<BR></DIV>
    <DIV>
    <DIV></DIV>
    <DIV class=Wj3C7c>Sent: Thursday, May 29, 2008 1:08 PM<BR>Subject: Re: 
    [support] Block visibility quandry<BR><BR><BR>&gt; Or maybe:<BR>&gt;<BR>&gt; 
    &lt;?php<BR>&gt; ((arg(0) == 'user') &amp;&amp; is_numeric(arg(1)) 
    &amp;&amp; (arg(2) == NULL)) ?<BR>&gt; return TRUE : return FALSE;<BR>&gt; 
    ?&gt;<BR>&gt;<BR>&gt; Which is equivalent to:<BR>&gt;<BR>&gt; 
    &lt;?php<BR>&gt; if ((arg(0) == 'user') &amp;&amp; is_numeric(arg(1)) 
    &amp;&amp; (arg(2) == NULL)) {<BR>&gt; &nbsp; return TRUE;<BR>&gt; }<BR>&gt; 
    else {<BR>&gt; &nbsp; return FALSE;<BR>&gt; }<BR>&gt; ?&gt;<BR>&gt;<BR>&gt; 
    The above condition was pilfered directly from profile.module in<BR>&gt; 
    Drupal 6.<BR>&gt;<BR>&gt; psynaptic<BR>&gt; <A 
    href="http://freestylesystems.co.uk" 
    target=_blank>http://freestylesystems.co.uk</A><BR>&gt; <A 
    href="http://api.freestylesystems.co.uk" 
    target=_blank>http://api.freestylesystems.co.uk</A><BR>&gt;<BR>&gt; On 29 
    May 2008, at 11:59, Richard Burford wrote:<BR>&gt;<BR>&gt;&gt; How 
    about:<BR>&gt;&gt;<BR>&gt;&gt; &lt;?php<BR>&gt;&gt; (arg(0) == 'user' 
    &amp;&amp; is_numeric(arg(1)) &amp;&amp; is_null(arg(2))) ? 
    return<BR>&gt;&gt; TRUE : return FALSE;<BR>&gt;&gt; 
    ?&gt;<BR>&gt;&gt;<BR>&gt;&gt; psynaptic<BR>&gt;&gt; <A 
    href="http://freestylesystems.co.uk" 
    target=_blank>http://freestylesystems.co.uk</A><BR>&gt;&gt; <A 
    href="http://api.freestylesystems.co.uk" 
    target=_blank>http://api.freestylesystems.co.uk</A><BR>&gt;&gt;<BR>&gt;&gt; 
    On 29 May 2008, at 11:46, Neil: <A href="http://esl-lounge.com" 
    target=_blank>esl-lounge.com</A> wrote:<BR>&gt;&gt;<BR>&gt;&gt;&gt; I am 
    almost there. Right now I have:<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; 
    &lt;?php<BR>&gt;&gt;&gt; if(arg(0)==user &amp;&amp; ctype_digit(arg(1)) 
    &amp;&amp; arg(2)!=edit) {<BR>&gt;&gt;&gt; return TRUE;<BR>&gt;&gt;&gt; } 
    else {<BR>&gt;&gt;&gt; return FALSE;<BR>&gt;&gt;&gt; }<BR>&gt;&gt;&gt; 
    ?&gt;<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; which prevents the block from showing 
    on user/2/edit, etc. Is there<BR>&gt;&gt;&gt; a way I can check for the 
    existence of arg(2) and not show the block<BR>&gt;&gt;&gt; if it exists? 
    That would eliminate user/2/edit, user/2/track, user/2/<BR>&gt;&gt;&gt; 
    contact and some other possibilities. I could manually alter 
    my<BR>&gt;&gt;&gt; current code to block out contact/track but I'd prefer a 
    kill-all<BR>&gt;&gt;&gt; solution.<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; 
    thanks<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; Neil<BR>&gt;&gt;&gt; ----- Original 
    Message -----<BR>&gt;&gt;&gt; From: Shai Gluskin<BR>&gt;&gt;&gt; To: <A 
    href="mailto:support@drupal.org">support@drupal.org</A><BR>&gt;&gt;&gt; 
    Sent: Wednesday, May 28, 2008 1:32 PM<BR>&gt;&gt;&gt; Subject: Re: [support] 
    Block visibility quandry<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; Hi 
    Neil,<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; I don't know if the UI for the block 
    module settings will allow<BR>&gt;&gt;&gt; regular expressions. I doubt it, 
    but give it a try and report back.<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; However, 
    what will surely work is putting in your own php. Have you<BR>&gt;&gt;&gt; 
    noticed that radio for adding PHP to return "TRUE" to make 
    block<BR>&gt;&gt;&gt; visible? That's your 
    answer.<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; Here's a code snippet that should 
    get you started:<BR>&gt;&gt;&gt; <A 
    href="http://drupal.org/node/64135#page-visibility" 
    target=_blank>http://drupal.org/node/64135#page-visibility</A><BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; 
    Here is one that is a little more sophisticated which was 
    designed<BR>&gt;&gt;&gt; for the Google Analytics module... when to include 
    the tracking code<BR>&gt;&gt;&gt; on a page -- totally analogous to block 
    visibility:<BR>&gt;&gt;&gt; <A href="http://drupal.org/node/261997" 
    target=_blank>http://drupal.org/node/261997</A><BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; 
    Good luck. And please add your snippet to the handbook 
    page.<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; 
    Shai<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; On Wed, May 28, 2008 at 
    5:57 AM, Neil: <A href="http://esl-lounge.com" 
    target=_blank>esl-lounge.com</A><BR>&gt;&gt;&gt; &lt;<A 
    href="mailto:neil@esl-lounge.com">neil@esl-lounge.com</A><BR>&gt;&gt;&gt;&gt; 
    wrote:<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; &nbsp; I have a block which I show on 
    a user's main page, user/1, user/<BR>&gt;&gt;&gt; 2, 
    etc.<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; &nbsp; I have set block visibility to 
    "only show on pages" with user/*<BR>&gt;&gt;&gt; entered 
    below.<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; &nbsp; Unfortunately, it's also 
    showing on user/register, user/password.<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; 
    &nbsp; I don't suppose I can use regular expressions to make 
    the<BR>&gt;&gt;&gt; wildcard ONLY numeric, can I? How would I get the block 
    to show on<BR>&gt;&gt;&gt; user/7 but not 
    user/register?<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; &nbsp; 
    Thanks<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; &nbsp; 
    Neil<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; &nbsp; --<BR>&gt;&gt;&gt; &nbsp; [ 
    Drupal support list | <A href="http://lists.drupal.org/" 
    target=_blank>http://lists.drupal.org/</A> 
    ]<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; 
    ------------------------------------------------------------------------------<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; 
    --<BR>&gt;&gt;&gt; [ Drupal support list | <A 
    href="http://lists.drupal.org/" target=_blank>http://lists.drupal.org/</A> 
    ]--<BR>&gt;&gt;&gt; [ Drupal support list | <A 
    href="http://lists.drupal.org/" target=_blank>http://lists.drupal.org/</A> 
    ]<BR>&gt;&gt;<BR>&gt;&gt; --<BR>&gt;&gt; [ Drupal support list | <A 
    href="http://lists.drupal.org/" target=_blank>http://lists.drupal.org/</A> 
    ]<BR>&gt;<BR>&gt; --<BR>&gt; [ Drupal support list | <A 
    href="http://lists.drupal.org/" target=_blank>http://lists.drupal.org/</A> 
    ]<BR>&gt;<BR><BR></DIV></DIV>--<BR>
    <DIV>
    <DIV></DIV>
    <DIV class=Wj3C7c>[ Drupal support list | <A href="http://lists.drupal.org/" 
    target=_blank>http://lists.drupal.org/</A> 
  ]<BR></DIV></DIV></BLOCKQUOTE></DIV><BR>
  <P>
  <HR>

  <P></P>-- <BR>[ Drupal support list | http://lists.drupal.org/ 
]</BLOCKQUOTE></BODY></HTML>