I find this inside Subs.php and I think this could be a useful hook for my subforum case. Can I have some samples on how to use this effectively?
From what I can tell, all you have to do is to add your string that you want to search for in the $find array. Then add your corresponding string that you want to replace it with in the $replace array.
Something basic like this. Been a long time since I wrote PHP so I'm not sure if the array merge will work exactly as I'm thinking. But this is the basic idea. array_push() might be better than array_merge. I'll leave that up to the professionals here to correct me. lol
[php]
function addCustomReplaceUrl(&$find, &$replace) {
array_merge(array('{custom_name}), $find);
array_merge(array($scripturl . '?action=customurl'), $replace);
}[/php]
Assuming you have the hook set to call your method, this should add your custom find/replace to the integration hook.
Thank you
@IchBin. I will play with this integration more. Basically, I wish to change $boardurl from what is defined in Settings.php to this $boardurl = $parts['scheme'] .'://'. $_SERVER['SERVER_NAME'] .(!empty($parts['port']) ? ':'. $parts['port'] : '') . (!empty($parts['path']) ? $parts['path'] : ''); if subforums mod is set.
This function is intended to replace strings with urls in text. I don't think it's of any help in what you are doing. ;)
I will have to find some other way to work the mod out. Thanks
@emanuele.
I should really have a look at the code... but as usual I'd need days with 48 hours. LOL