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#page-visibility" 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="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">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>