function is_lesson($tid) { $sql = db_rewrite_sql(db_query("SELECT n.type, ctl.field_skypecast_url_value FROM node n INNER JOIN term_node tn ON tn.nid = n.nid INNER JOIN content_type_lesson ctl ON ctl.nid = n.nid WHERE tn.tid = '$tid' AND n.type = 'lesson'")); if (mysql_num_rows($sql) != 0) { $is_lesson = '
';} while ($result = db_fetch_object($sql)) { if ($result->field_skypecast_url_value != '') { $has_screenie = '
';} } $output = $is_lesson . $has_screenie; return $output; }