prefix.'data d, ' . $CFG->prefix.'data_fields df, ' . $CFG->prefix.'data_records dr, ' . $CFG->prefix.'data_content dc ' . "WHERE (d.course = '$courseid' or d.course = '".SITEID."')" . 'AND d.id = df.dataid ' . 'AND df.id = dc.fieldid ' . 'AND d.id = dr.dataid ' . 'AND dr.id = dc.recordid ' . "AND df.type = 'text' " . "AND " . sql_compare_text('df.param1', 1) . " = '1'"; if (!$datacontents = get_records_sql($sql)) { return $text; } $contentlist = array(); foreach ($datacontents as $datacontent) { $currentcontent = trim($datacontent->content); $strippedcontent = strip_tags($currentcontent); if (!empty($strippedcontent)) { $contentlist[] = new filterobject( $currentcontent, 'frametarget.'>', '', false, true); } } // End foreach } return filter_phrases($text, $contentlist); // Look for all these links in the text } ?>