Allow greater customisation of wiki links (#461)

This commit is contained in:
Eearslya Sleiarion
2016-08-13 23:28:31 -07:00
committed by Spades
parent a8e133759f
commit ee797132db
3 changed files with 25 additions and 13 deletions

View File

@@ -99,6 +99,7 @@ var/list/gamemode_cache = list()
var/server
var/banappeals
var/wikiurl
var/wikisearchurl
var/forumurl
var/githuburl
var/rulesurl
@@ -425,6 +426,9 @@ var/list/gamemode_cache = list()
if ("wikiurl")
config.wikiurl = value
if ("wikisearchurl")
config.wikisearchurl = value
if ("forumurl")
config.forumurl = value

View File

@@ -206,6 +206,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.

View File

@@ -5,8 +5,11 @@
set category = "OOC"
if(config.wikiurl)
if(query)
var/output = config.wikiurl + "/doku.php?do=search&id=" + query
if(config.wikisearchurl)
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
src << link(config.wikiurl)
else