I have created block and i want to give the only listed paths
i.e user/user_id ex: user/123
i have given user/* but it displays all pages where users pages are there.
and enabled PHPFILTER and tried this
Try "extended_block_visibility" module, install it and then on block setting page select last option "pages on which this php code will return true" and then you can write php code inside php tag like :
<?php
if(arg(0) == 'user' && is_numeric(arg(1))){
return TRUE;
}
return FALSE;
?>
But remember this code will save inside the DB and will break site if write wrong code. Alternatively you can define theme specific visibility using this module.
As an option you can use path alias, for example If my user's page alias is /users/myusername
then you can set users/*
in Visibility settings. So it will be available on user/*
page, but not on user/*/*
pages.