Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $node = menu_get_object();
- if ( !empty($node) && $node->type == 'class' ) {
- if ( !empty($node->field_class_date) && !empty($node->field_class_date['und']) && !empty($node->field_class_date['und'][0]) ) {
- $parts = explode('T', $node->field_class_date['und'][0]['value']);
- $date_parts = explode('-', $parts[0]);
- $class_date = $date_parts[1] . '/' . $date_parts[2] . '/' . $date_parts[0] . ' ' . $parts[1];
- $on = strtotime($class_date);
- $now = time();
- if ( $on >= $now ) {
- return TRUE;
- }
- }
- }
- return FALSE;
- ?>
- <?php
- $match = FALSE;
- $types = array('date' => 1);
- if (arg(0) == 'node' && is_numeric(arg(1) )) {
- $nid = arg(1);
- $node = node_load(array('nid' => $nid));
- $type = $node->type;
- if (isset($types[$type])) {
- $match = TRUE;
- }
- }
- return $match;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement