Hi All,
I'm developing a site for a theater company that I'm involved in and one of the features is to display a list of actors, staff, crew, ect on a page for each show (custom node type). I've created a small system where an admin on the site can associate a member (drupal user) to a specific show (drupal node). I'm running into an error displaying only one of the involvement groups. Each database entry contains the category of involvement (cast, crew ect), a description of the position, the show id (node id), and the uid of the user. In the hook I run a db_select and in the foreach I run through each of the positions. If anyone can point out the error that is causing the Cast table to not display I would be indebted. Drupal is an awesome platform and I plan on build many sites on it in the future.
Here is the code of the hook
<?php
function shows_node_view($node, $view_mode) {
if ($view_mode == 'full' && $node->type == 'show') {
$nid = is_object($node) ? $node->nid : $node;
$query = db_select('production_involve', 'p');
$query
->join('users', 'u', 'p.uid = u.uid');
$query
->fields('p', array('uid', 'sid', 'involve_cat', 'involve_desc'))
->fields('u', array('uid', 'name'))
->condition('sid', $nid);
$results = $query->execute();
foreach ($results as $r) {