[pmwiki-users] foxfilter: define ptvfmt
noskule
noskule at gmx.net
Wed Aug 6 15:17:06 CDT 2008
hi hans
Is is some how possible to define the ptvfmt for a given field/ptv
inside a foxfilter function?
In this function I get the ptv "Category" with category names, "Cat1
Cat2", add linkbrackets and want to save it as ptvfmt=text
thanks
nos
$FoxFilterFunctions['FoxCategories'] = 'FoxCategoriesFilter';
function FoxCategoriesFilter($pagename, $fields) {
global $CategoryGroup;
$categories_string = trim( $fields['ptv_Categories'] );
if ( $categories_string != "" ) {
$categories_arr = explode(" ",$categories_string);
for($i=0;$i<count($categories_arr);$i++) {
$out = $out."[[$CategoryGroup/".$categories_arr[$i]."]] ";
}
}
$fields['ptv_categories_links'] = $out;
return $fields;
}
More information about the pmwiki-users
mailing list