<!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, just posted comment on the link you sent
me.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </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> <<A
href="mailto:neil@esl-lounge.com">neil@esl-lounge.com</A>> 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" <<A
href="mailto:rich@freestylesystems.co.uk">rich@freestylesystems.co.uk</A>><BR>To:
<<A href="mailto:support@drupal.org">support@drupal.org</A>><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>> Or maybe:<BR>><BR>>
<?php<BR>> ((arg(0) == 'user') && is_numeric(arg(1))
&& (arg(2) == NULL)) ?<BR>> return TRUE : return FALSE;<BR>>
?><BR>><BR>> Which is equivalent to:<BR>><BR>>
<?php<BR>> if ((arg(0) == 'user') && is_numeric(arg(1))
&& (arg(2) == NULL)) {<BR>> return TRUE;<BR>> }<BR>>
else {<BR>> return FALSE;<BR>> }<BR>> ?><BR>><BR>>
The above condition was pilfered directly from profile.module in<BR>>
Drupal 6.<BR>><BR>> psynaptic<BR>> <A
href="http://freestylesystems.co.uk"
target=_blank>http://freestylesystems.co.uk</A><BR>> <A
href="http://api.freestylesystems.co.uk"
target=_blank>http://api.freestylesystems.co.uk</A><BR>><BR>> On 29
May 2008, at 11:59, Richard Burford wrote:<BR>><BR>>> How
about:<BR>>><BR>>> <?php<BR>>> (arg(0) == 'user'
&& is_numeric(arg(1)) && is_null(arg(2))) ?
return<BR>>> TRUE : return FALSE;<BR>>>
?><BR>>><BR>>> psynaptic<BR>>> <A
href="http://freestylesystems.co.uk"
target=_blank>http://freestylesystems.co.uk</A><BR>>> <A
href="http://api.freestylesystems.co.uk"
target=_blank>http://api.freestylesystems.co.uk</A><BR>>><BR>>>
On 29 May 2008, at 11:46, Neil: <A href="http://esl-lounge.com"
target=_blank>esl-lounge.com</A> wrote:<BR>>><BR>>>> I am
almost there. Right now I have:<BR>>>><BR>>>>
<?php<BR>>>> if(arg(0)==user && ctype_digit(arg(1))
&& arg(2)!=edit) {<BR>>>> return TRUE;<BR>>>> }
else {<BR>>>> return FALSE;<BR>>>> }<BR>>>>
?><BR>>>><BR>>>> which prevents the block from showing
on user/2/edit, etc. Is there<BR>>>> a way I can check for the
existence of arg(2) and not show the block<BR>>>> if it exists?
That would eliminate user/2/edit, user/2/track, user/2/<BR>>>>
contact and some other possibilities. I could manually alter
my<BR>>>> current code to block out contact/track but I'd prefer a
kill-all<BR>>>> solution.<BR>>>><BR>>>>
thanks<BR>>>><BR>>>> Neil<BR>>>> ----- Original
Message -----<BR>>>> From: Shai Gluskin<BR>>>> To: <A
href="mailto:support@drupal.org">support@drupal.org</A><BR>>>>
Sent: Wednesday, May 28, 2008 1:32 PM<BR>>>> Subject: Re: [support]
Block visibility quandry<BR>>>><BR>>>><BR>>>> Hi
Neil,<BR>>>><BR>>>> I don't know if the UI for the block
module settings will allow<BR>>>> regular expressions. I doubt it,
but give it a try and report back.<BR>>>><BR>>>> However,
what will surely work is putting in your own php. Have you<BR>>>>
noticed that radio for adding PHP to return "TRUE" to make
block<BR>>>> visible? That's your
answer.<BR>>>><BR>>>> Here's a code snippet that should
get you started:<BR>>>> <A
href="http://drupal.org/node/64135#page-visibility"
target=_blank>http://drupal.org/node/64135#page-visibility</A><BR>>>><BR>>>>
Here is one that is a little more sophisticated which was
designed<BR>>>> for the Google Analytics module... when to include
the tracking code<BR>>>> on a page -- totally analogous to block
visibility:<BR>>>> <A href="http://drupal.org/node/261997"
target=_blank>http://drupal.org/node/261997</A><BR>>>><BR>>>>
Good luck. And please add your snippet to the handbook
page.<BR>>>><BR>>>>
Shai<BR>>>><BR>>>><BR>>>> On Wed, May 28, 2008 at
5:57 AM, Neil: <A href="http://esl-lounge.com"
target=_blank>esl-lounge.com</A><BR>>>> <<A
href="mailto:neil@esl-lounge.com">neil@esl-lounge.com</A><BR>>>>>
wrote:<BR>>>><BR>>>> I have a block which I show on
a user's main page, user/1, user/<BR>>>> 2,
etc.<BR>>>><BR>>>> I have set block visibility to
"only show on pages" with user/*<BR>>>> entered
below.<BR>>>><BR>>>> Unfortunately, it's also
showing on user/register, user/password.<BR>>>><BR>>>>
I don't suppose I can use regular expressions to make
the<BR>>>> wildcard ONLY numeric, can I? How would I get the block
to show on<BR>>>> user/7 but not
user/register?<BR>>>><BR>>>>
Thanks<BR>>>><BR>>>>
Neil<BR>>>><BR>>>> --<BR>>>> [
Drupal support list | <A href="http://lists.drupal.org/"
target=_blank>http://lists.drupal.org/</A>
]<BR>>>><BR>>>><BR>>>><BR>>>><BR>>>><BR>>>>
------------------------------------------------------------------------------<BR>>>><BR>>>><BR>>>>
--<BR>>>> [ Drupal support list | <A
href="http://lists.drupal.org/" target=_blank>http://lists.drupal.org/</A>
]--<BR>>>> [ Drupal support list | <A
href="http://lists.drupal.org/" target=_blank>http://lists.drupal.org/</A>
]<BR>>><BR>>> --<BR>>> [ Drupal support list | <A
href="http://lists.drupal.org/" target=_blank>http://lists.drupal.org/</A>
]<BR>><BR>> --<BR>> [ Drupal support list | <A
href="http://lists.drupal.org/" target=_blank>http://lists.drupal.org/</A>
]<BR>><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>