Displaying block only when user visits his own profile page I want to display the block only when the current user visits own page.
So in block visibility I use the following PHP:

global $user;
if ($user-&gt;uid == arg(1)) {;
return TRUE;
} else {;
return FALSE;
};
endif;


But that block returns on every page.What am I doing wrong?
If you are using the php code in the block visibility option than I guess the following should work:

&lt;?php
global $user;
$user_id = $user-&gt;uid;
if (('user' === arg(0)) &amp;&amp; ($user_id === arg(1))) {
  return TRUE;
} else {
  return FALSE;
}
?&gt;


If your site is multi-lingual than may be you have to change the if condition as: if (('user' === arg(1)) &amp;&amp; ($user_id === arg(2)))