integrate_basic_url_replacement
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?
Re: integrate_basic_url_replacement
Reply #1 –
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.
Re: integrate_basic_url_replacement
Reply #5 –
I should really have a look at the code... but as usual I'd need days with 48 hours. LOL