I used this custom code back with vB4 and after transitioning to Xenforo I think (not 100% certain) that is was working for XF too.
Basically, it should allow a poster to put
For example,
The problem is since I first started using this custom bbcode (years ago, probably around 2005), it seems that Wikipedia has changed its link structure and now requires an underscore rather than a space between words in the bbcode.
So now the simple replacement code,
Question:
How do I change this so that spaces between individual words are replaced with underscores? I suspect this will require a PHP callback which I've never used.
Basically, it should allow a poster to put
[wiki] ... [/wiki] tags around someone's name or a title or a topic and it will create a link to the appropriate Wikipedia page.For example,
[wiki]Ernest J. Gaines[/wiki] used to insert a link to https://en.wikipedia.org/wiki/https://en.wikipedia.org/wiki/Ernest J. Gaines.The problem is since I first started using this custom bbcode (years ago, probably around 2005), it seems that Wikipedia has changed its link structure and now requires an underscore rather than a space between words in the bbcode.
So now the simple replacement code,
https://en.wikipedia.org/wiki/{text} no longer works. It tries to load https://en.wikipedia.org/wiki/Ernest J. Gaines which goes to a 404 error page, instead of https://en.wikipedia.org/wiki/Ernest_J._ GainesQuestion:
How do I change this so that spaces between individual words are replaced with underscores? I suspect this will require a PHP callback which I've never used.
Last edited:

