简体   繁体   English

使用php参数查看用户内容值

[英]Views user content value using php argument

Just trying to use php argument in drupal views. 只是试图在drupal视图中使用php参数。

I need PHP that will check on a users cck content profile field value. 我需要将检查用户cck内容配置文件字段值的PHP。

True if it is 'on' false if it not 'on' 如果“打开”,则为true;如果未打开,则为false

Sorry designer not coder. 对不起,设计师不是编码员。

In the end I did swap the content from a filed value of cck content profile type to a value within the main part of the users profile. 最后,我确实将内容从cck内容配置文件类型的归档值交换为用户配置文件主要部分中的值。 Now I can use this php argument to validate whether a user can see a note or not using a view. 现在,我可以使用此php参数来验证用户是否可以使用视图查看注释。

global $user;

profile_load_profile($user);

if ($user->profile_does_cashregister == 1)
return TRUE;
else 
return FALSE;

I would still like to know how to use a simular validator to filter content based on a value from a cck content profile field. 我仍然想知道如何使用模拟验证器基于cck内容配置文件字段中的值来过滤内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM