Posted by Rick Wagner on April 20, 2011 at 5:21pm
I've found a handy code snippet to show a block on the logged in Users My Account page (/user) but also need to show certain blocks on other User's account pages (users/sampleuser)
Using the wildcard "users/*" in the block config also adds the block to "/user", which I don't want.
Is there a code snippet that will do what I want? Show blocks on other Users pages only?

Comments
Try this - use PHP mode for
Try this - use PHP mode for block visibility and
<?phpreturn eregi('/user/.*', $_SERVER['REQUEST_URI']);
?>
Rich Yumul
Sage Tree Solutions
www.sagetree.net
re: Show blocks on other Users account pages only?
Not seeing the block on any page with this. Doesn't the PHP code need to return a TRUE or FALSE?
Unless we're taliking about something other than: Block configure / Page Specific Visiblity Settings
X Show if the following PHP code returns TRUE (PHP-mode, experts only).
Guess I'm dating my self.
I checked the php docs & eregi was deprecated. Maybe try this:
<?phpreturn preg_match('/\/user\/.*/', $_SERVER['REQUEST_URI']);
?>
Rich Yumul
Sage Tree Solutions
www.sagetree.net
are you sure?
users/* should never match the url http://example.com/user!
In fact, I've always had to enter 2 paths when I want my blocks to show up on both, I'll typically use
useruser/*
Whats the handy code snippet you're using? Rich's example should work, I hate putting php in block assignments if its avoidable though.
Check out the Me Aliases and Context modules
In addition to Karl's suggestions, you should look at the Me Aliases and Context modules which will probably get you 100% of what you need and be standards-compliant too.
Joel Farris | my 'certified to rock' score
Transparatech
http://transparatech.com
619.717.2805
Working now with Joel's suggestion
Was still getting blocks set to "users/*" only on the logged in Users "My Account" page even on a brand new Drupal 6 install.
At any rate, the 'me aliases' Module was just what I needed to wrangle all the block visibility required for this site, and I owe Senpai a drink for the suggestion.
How to show blocks on user profile page
How can i show a block only on the user profile page.