diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 061e125cef..d4fada9088 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -102,6 +102,7 @@ var/list/gamemode_cache = list() var/server var/banappeals var/wikiurl + var/wikisearchurl var/forumurl var/githuburl var/rulesurl @@ -428,6 +429,9 @@ var/list/gamemode_cache = list() if ("wikiurl") config.wikiurl = value + if ("wikisearchurl") + config.wikisearchurl = value + if ("forumurl") config.forumurl = value diff --git a/config/example/config.txt b/config/example/config.txt index 340d0e50b9..23c5818162 100644 --- a/config/example/config.txt +++ b/config/example/config.txt @@ -217,6 +217,11 @@ GUEST_BAN ## Wiki address # WIKIURL http://example.com +## Wiki search path +## Set this to whatever path your wiki uses to search for articles +## Use %s to mark where the search query should be inserted +# WIKISEARCHURL http://example.com/index.php?title=Special%3ASearch&search=%s + ## GitHub address # GITHUBURL https://github.com/example-user/example-repository ## Ban appeals URL - usually for a forum or wherever people should go to contact your admins. diff --git a/html/changelogs/Leshana-wikisearch.yml b/html/changelogs/Leshana-wikisearch.yml new file mode 100644 index 0000000000..aaa6947da5 --- /dev/null +++ b/html/changelogs/Leshana-wikisearch.yml @@ -0,0 +1,4 @@ +author: Leshana +delete-after: True +changes: + - rscadd: "Wiki search URL is now configurable in config.txt" diff --git a/interface/interface.dm b/interface/interface.dm index fa96837227..0a4852b3b1 100644 --- a/interface/interface.dm +++ b/interface/interface.dm @@ -5,8 +5,11 @@ set category = "OOC" if(config.wikiurl) if(query) - var/output = config.wikiurl + "/index.php?title=Special%3ASearch&profile=default&search=" + query - src << link(output) + if(config.wikisearchurl) + var/output = replacetext(config.wikisearchurl, "%s", url_encode(query)) + src << link(output) + else + src << " The wiki search URL is not set in the server configuration." else src << link(config.wikiurl) else