All pastes #386007 Raw Edit

Squidster

public text v1 · immutable
·published 2007-03-08 08:02 UTC
rendered paste body
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 = '<div class="asterisk"><img src="/images/has_lesson.jpg"></div>';}
	 while ($result = db_fetch_object($sql)) { 
	 	if ($result->field_skypecast_url_value != '') { $has_screenie = ' <div class="has_screencast"><img src="/images/has_screenie.jpg" /></div>';}
	 }
    $output = $is_lesson . $has_screenie;
	return $output;
	}