Hello,
I've just installed a forum onto my drigg site and i see that url's for the topics are "node/$nid".
I tried editing the custom_url_rewrite_function.php file by adding the following:
if (preg_match('|^node/(.*)|', $path, $matches)) {
$nid = $matches[1];
$res=drigg_settings_lookup_node_type_by_nid($nid);
if($res=="forum"){
$res=urlencode($res);
return("/forum/".$nid);
}
}
function drigg_settings_lookup_node_type_by_nid($nid){
static $cache;
if(!$cache[$nid]){
$res=db_result(db_query("SELECT type FROM {node} WHERE nid =%d",$nid));
$cache[$nid]=$res;
#drupal_set_message("HERE: SELECT type FROM {node} WHERE nid =$nid: $res");
}
return $cache[$nid];
}
But it doesn't seem to do anything. Any suggestions?
Comments
Comment #1
mercmobily commentedHi,
Please note that I am sick and I am in a bad mood.
Please re-read the documentation carefully. I don't see any trace of the definition of a custom_url_rewrite() function in what you added.
The rewrite function works.
Merc.