I'm having trouble using the block configure feature and getting a block to only show up when looking at a profile (be it your own or someone else's)

I'm clicking "configure" on the block administration page for the block I have in mind. then at the "Page specific visibility settings" portion I'm clicking the radio button for "Show on only the listed pages". It then type "user" in the text area.

The block definitely disapears. But when I click on "My Account" it doesn't the block doesn't reappear. How amd I doing this wrong? What do I need to do to make it work?

thanks

Comments

jeditdog’s picture

After reading http://drupal.org/node/62053 (which at the time was just below me) I decided to take the advice and use google. (Hadn't done this before because I thought the search feature at drupal.org would suffice).

Got my answer quick doing that! I just had to enter:

user/*

so, thanks everyone in the other discussion that was going on! :)

AjK’s picture

enter user/*

regards
--AjK

jeditdog’s picture

Would there be a way to do it so that it will only show if the * is a number and not a string or char value?

AjK’s picture

Use the next option "Show if the following PHP code returns TRUE (PHP-mode, experts only)."
and use this code on the textarea:-

<?php
$a = explode('/', $_REQUEST['q']);
if(is_array($a) && isset($a[0]) && isset($a[1]) && $a[0] == 'user' && ctype_digit($a[1])) return TRUE;
else return FALSE;
?>

Careful when adding this, bad php code in here can stop your site from working. I tested the above code and it does do what you want.

Regards
--AjK

jeditdog’s picture

Thanks AjK,

I always think I know a lot about php and then I find out I do not! :)

thanks, I think this solves my problem.