Block visibility on user pages user/1, user/2 but not user/rsvp/1 or user/rsvp/2, etc
SocialNicheGuru - May 24, 2008 - 00:10
| Project: | Block Page Visibility |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
I want to show a block on each users' page but not the subpages
so for example for user 1, user 2, and user 3 I want to show a block but I don't want to show it on user/1/rsvp, etc
I thought I could just do
user
user/*/
but neither of these work

#1
add this to your block visibility. with php enabled
<?phpglobal $user;
if (arg(0) == 'user' && $user->uid == arg(1)){
return TRUE;
}
else {
return FALSE;
}
?>
#2
I may be way off topic here, but I hope you can help.
Can I use something similar to control comments visibility?
I have a book page which contains a story (actually a writing assignment), visible to all users.
Comments are enabled.
Each registered user can post his assignment into a comment.
But I don't want other users to be able to see all comments. Each user should only be able to see his own comments.
It is a way of submitting schoolwork, without other students seeing each other's work.
Your php suggestion looks similar to what I want to do.
Any ideas?
Thanks so much, and apologies for butting in to this topic.