I have tried to configure a view for a user listing. In this view only few fields from the user entity will be shown. In the user entity I have a boolean variable. If the boolean variable is TRUE ("1") the real profile image should be shown, otherwise the default image for all users should be shown.
In order to implement it I have added a views field of type Global: PHP
. In the field's code I wrote:
$file = file_load($row->picture);
if(isset($row->field_primum) ) {
if($row->field_primum == "1") {
print theme('image', array('path' => $file->uri));
else ($row->field_primum == "2") {
print(<a src="/sites/all/themes/test_them/images/anonymous.jpg" height="42" width="42"></a>);
}
}
}
However it runs only on the first user and not for all users in the display. Do you have any idea why?
Thanks zanet