Last active
December 19, 2015 21:49
-
-
Save karlazz/6023009 to your computer and use it in GitHub Desktop.
Drupal 7: Views PHP filter to select items allocated into two groups, randomly designate group to select
This file contains 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
// FILTER: GLOBAL PHP | |
// SETUP CODE | |
global $randvalforslides; | |
$randvalforslides=rand(1,2); | |
// FILTER CODE --------------------------------------------- | |
$node = node_load($row->nid); | |
$fhg = $node->field_homepage_group; | |
$fhg1=$fhg['und'][0]['value']; | |
global $randvalforslides; | |
if ( $fhg1 != $randvalforslides ) return TRUE; else return FALSE; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment