We have talked about using Views Custom Field which really makes Views more versatile. In the custom PHP field, you can get the data of other fields from $data. But the field names under the $data may changed later as you modify the view.
During the Drupal development, sometimes you may find the white screen of death(WSOD) and you have no idea what’s happening. To tackle the WSOD, add the following lines in the index.php located in the Drupal webroot. Continue reading Drupal – Tackle the White Screen of Death WSOD→
In debugging PHP program, i always use print() and print_r() to output the variable content to the browser. But this does not work when we are not using browser. A simple way to get the content is to write it to a file.
We could get the flagged items by making the flag_get_user_flags() call. Assume we have setup a user flag called connect, the following example will return a list of a “connected” users which are flagged by a specific user (uid = 29). Continue reading Drupal – Get flagged items of a specific user by PHP→