mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Ported VOREStation/VOREStation#461 - Allow greater customisation of wiki links
This commit is contained in:
@@ -102,6 +102,7 @@ var/list/gamemode_cache = list()
|
|||||||
var/server
|
var/server
|
||||||
var/banappeals
|
var/banappeals
|
||||||
var/wikiurl
|
var/wikiurl
|
||||||
|
var/wikisearchurl
|
||||||
var/forumurl
|
var/forumurl
|
||||||
var/githuburl
|
var/githuburl
|
||||||
var/rulesurl
|
var/rulesurl
|
||||||
@@ -428,6 +429,9 @@ var/list/gamemode_cache = list()
|
|||||||
if ("wikiurl")
|
if ("wikiurl")
|
||||||
config.wikiurl = value
|
config.wikiurl = value
|
||||||
|
|
||||||
|
if ("wikisearchurl")
|
||||||
|
config.wikisearchurl = value
|
||||||
|
|
||||||
if ("forumurl")
|
if ("forumurl")
|
||||||
config.forumurl = value
|
config.forumurl = value
|
||||||
|
|
||||||
|
|||||||
@@ -217,6 +217,11 @@ GUEST_BAN
|
|||||||
## Wiki address
|
## Wiki address
|
||||||
# WIKIURL http://example.com
|
# 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
|
## GitHub address
|
||||||
# GITHUBURL https://github.com/example-user/example-repository
|
# GITHUBURL https://github.com/example-user/example-repository
|
||||||
## Ban appeals URL - usually for a forum or wherever people should go to contact your admins.
|
## Ban appeals URL - usually for a forum or wherever people should go to contact your admins.
|
||||||
|
|||||||
4
html/changelogs/Leshana-wikisearch.yml
Normal file
4
html/changelogs/Leshana-wikisearch.yml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
author: Leshana
|
||||||
|
delete-after: True
|
||||||
|
changes:
|
||||||
|
- rscadd: "Wiki search URL is now configurable in config.txt"
|
||||||
@@ -5,8 +5,11 @@
|
|||||||
set category = "OOC"
|
set category = "OOC"
|
||||||
if(config.wikiurl)
|
if(config.wikiurl)
|
||||||
if(query)
|
if(query)
|
||||||
var/output = config.wikiurl + "/index.php?title=Special%3ASearch&profile=default&search=" + query
|
if(config.wikisearchurl)
|
||||||
src << link(output)
|
var/output = replacetext(config.wikisearchurl, "%s", url_encode(query))
|
||||||
|
src << link(output)
|
||||||
|
else
|
||||||
|
src << "<span class='warning'> The wiki search URL is not set in the server configuration.</span>"
|
||||||
else
|
else
|
||||||
src << link(config.wikiurl)
|
src << link(config.wikiurl)
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user