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
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

dhroople - September 29, 2009 - 11:11

add this to your block visibility. with php enabled

<?php
global $user;
if (
arg(0) == 'user' && $user->uid == arg(1)){
  return
TRUE;
}
else {
  return
FALSE;
}
?>

#2

MichaelBrown - November 4, 2009 - 05:10

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.

 
 

Drupal is a registered trademark of Dries Buytaert.