The task is to create a dynamic page for displaying the daily programme information of this three-day event.

<?php // detect whether there is any session held at the same time $result = db_query("SELECT nid FROM {content_type_session} WHERE field_session_start_time_value = '%s' AND nid!=%d", $node->field_session_start_time[0]['value'], $node->nid); $num = db_num_rows($result); // detect which session gets loaded first $result_first = db_query("SELECT nid FROM {content_type_session} WHERE field_session_start_time_value = '%s' AND nid!=%d", $node->field_session_start_time[0]['value'], $node->nid); $first = db_num_rows($result_first); $raw_width = 440/($num+1); if ($num && $first==1) { $class = "multiple-parent"; $width = $raw_width + 60; } else if ($num && $first!=1) { $class = "multiple-child"; $width = $raw_width; } else { $class = "single"; $width = 540; } $starttime= $node->field_session_start_time[0]['value']; $endtime= $node->field_session_start_time[0]['value2']; $span = ($endtime - $starttime)/60; //the hieght if ($span>=0 && $span<=30) { $height = "session-height-1"; } else if ($span >=31 && $span<=60) { $height = "session-height-2"; } else if ($span >=61 && $span <=90) { $height = "session-height-3"; } else { $height = "session-height-4"; } ?> <div class="node-session <?php print $class.' '.$height;?>" style="width:<?php print $width;?>px;"> <div class="session-time"> <?php print date('H:i', $node->field_session_start_time[0]['value']) ; ?> </div> <div class="session-detail"> <?php if ($node->field_session_location[0]['view']) { ?> <span class="session-location"> <?php print $node->field_session_location[0]['view']; ?> </span> <?php } ?> <h3 class="session-title"> <?php print l($node->title, 'node/'.$node->nid); ?> </h3> <?php $result = array(); // load details of speakers from another content type "bio" foreach($node->field_session_speakers as $speaker) { print $speaker['view']; $bio = db_result(db_query("SELECT bio.field_biocompany_value FROM {node} nd LEFT JOIN {content_type_bio} bio ON nd.nid=bio.nid WHERE nd.nid=%d AND nd.type='%s'", $speaker['nid'], 'bio'), 0); if ($bio) { print ' ('.$bio.')'; } print "<br />"; } ?> </div>