Created
February 6, 2016 08:20
-
-
Save gh640/30039b4e121bbb7cbac6 to your computer and use it in GitHub Desktop.
Drupal 7 で特定のブロックをユーザの表示ページのみに表示するための PHP フィルタコード
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // ユーザの表示ページ、かつ、そのユーザが admin 以外なら表示する | |
| $matches = array(); | |
| $result = preg_match('/^user(\/(\d+))?$/', request_path(), $matches); | |
| if ($result && (count($matches) == 1 || $matches[2] != 1)) { | |
| return TRUE; | |
| } | |
| else { | |
| return FALSE; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment