[support] Blocks on user pages

Joel Willers joel.willers at sigler.com
Mon Aug 15 22:35:43 UTC 2011


For those wondering, if you _GET 'q', it, in fact, is users/LoggedInUserName, and NOT /user.  My solution was to use PHP validation for pages.  _GET 'q', throw it into $path, compare to global $user. 

Here is the validation code, if anyone needs it:
<?php 
global $user;
$path = drupal_get_path_alias($_GET['q']);
$path = explode('/', $path);

if ($path[0] == 'users' && $path[1] == $user->name) 
  return (true);
else return(false);

?>

If you need it to only show on /user the above code will work in the Visibility settings area.

Joel 

Subject: [support] Blocks on user pages

Does /user really go to /users/LoggedInUserName?  I have a block that I put on /users/* and it shows mysteriously on /user and the block I put on /user doesn’t show at all.  Is there a workaround for that?

Joel Willers
-- 
[ Drupal support list | http://lists.drupal.org/ ]


More information about the support mailing list