function freelinking_nodeapi in Freelinking 6
Same name and namespace in other branches
- 5 freelinking.module \freelinking_nodeapi()
- 6.2 freelinking.module \freelinking_nodeapi()
File
- ./
freelinking.module, line 298
Code
function freelinking_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) {
switch ($op) {
case 'update':
_freelinking_do_filtering($node->body, TRUE);
break;
case 'insert':
_freelinking_do_filtering($node->body, TRUE);
break;
case 'update index':
$filters = filter_list_format($node->format);
if (isset($filters['freelinking/0'])) {
global $base_path;
$text = freelinking_filter('process', 0, -1, $node->body);
if (preg_match_all(',<a href="' . $base_path . 'freelinking/([^"]*)" class="freelinking">,i', $text, $matches)) {
foreach ($matches[1] as $thetitle) {
if ($nid = _freelinking_exists($thetitle)) {
$output .= '<a href="' . $base_path . 'node/' . $nid . '">' . urldecode($thetitle) . '</a>';
}
}
return $output;
}
}
break;
}
// endswitch $op
}