fields('ua', array('alias')); $query->condition('source', $source); $result = $query->execute(); $data = $result->fetchAssoc(); return '/' . (isset($data['alias']) && ! empty($data['alias'])) ? $data['alias'] : 'node/' . $nid; } // Find the category ID. function get_category_id($category) { if (empty($category)) { return false; } $query = db_select('taxonomy_term_data', 'c'); $query->fields('c', array('tid')); $query->condition('name', $category); $result = $query->execute(); $data = $result->fetchAssoc(); return (isset($data['tid']) && ! empty($data['tid'])) ? $data['tid'] : false; } // See: http://api.drupal.org/api/drupal/includes!database!database.inc/function/db_select/7 // Find the Node. $query = db_select('node', 'n'); $query->join('field_data_body', 'b', 'n.nid = b.entity_id'); $query->join('taxonomy_index', 'c', 'n.nid = c.nid'); $query->fields('n', array('nid', 'title', 'created')); $query->fields('b', array('body_summary', 'body_value')); $query->fields('c', array('tid')); $query->condition('type', $type); $query->condition('status', 1); $query->condition('tid', get_category_id($category)); $query->orderBy('created', 'DESC'); $query->range(0, $limit); $query->addTag('node_access'); $results = $query->execute(); // Display the Node. foreach ($results as $result) { $title = $result->title; $url = get_node_url($result->nid); $created = date('F d, Y', $result->created); $summary = (! empty($result->body_summary) ? $result->body_summary : $result->body_value); echo <<< HTML

{$title}

{$category}
{$created}

{$summary}

Read More …
HTML; } ?>

SELECT Temps

Welcome! Thank you for becoming a part of the SELECT family. We are committed to making your experience with us both fulfilling and rewarding. As a valuable member of our team, we strive to put the tools, tips and information you need to be successful at your fingertips.