diff options
Diffstat (limited to 'list-unvisitied-nodes.php')
-rw-r--r-- | list-unvisitied-nodes.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/list-unvisitied-nodes.php b/list-unvisitied-nodes.php new file mode 100644 index 0000000..41294d7 --- /dev/null +++ b/list-unvisitied-nodes.php @@ -0,0 +1,18 @@ +<?php + +define('DRUPAL_ROOT', getcwd()); + +include_once DRUPAL_ROOT . '/includes/bootstrap.inc'; +drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE); + +$query = db_select('og_membership', 'og') + ->fields('og', array('etid')) + ->where("og.entity_type = 'node' AND `field_name` = 'blog_ref' AND og.etid NOT IN (SELECT `entity_id` FROM {flagging} WHERE `fid` = :fid AND `uid` = :uid) AND og.etid IN (SELECT `etid` FROM {og_membership} WHERE `gid` = :gid AND `entity_type` = 'node')", array(':fid' => 3, ':uid' => 1, ':gid' => 192)); +$result = $query->execute(); + +$i = 0; +foreach ($result as $record) { + print $record->etid . PHP_EOL; + $i++; +} +print $i; |