Skip to content

Instantly share code, notes, and snippets.

@Inquisitor-Sasha
Last active August 29, 2015 13:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Inquisitor-Sasha/9559407 to your computer and use it in GitHub Desktop.
Save Inquisitor-Sasha/9559407 to your computer and use it in GitHub Desktop.
Change the wiki logo for a wiki without server access to set the logo image file path or upload access to the current logo image.
/* **********************************************************************************
* MediaWiki logo replacer script
* Author: Inquisitor Sasha
* Contributors:
*
* Developed for the Orain MediaWiki free wiki hosting service
*
* Replace the current logo of the wiki with your own logo image from anywhere
* Additionally, your can change the page that the logo image will link to,
* such as if your wiki uses a different main page title from the standard
* MediaWiki installation.
*
* ********************************************************************************* */
// Configuration settings
// Set this variable to the URL of any image that you want to use for your wiki logo.
// This should be in a stable location where it will not be deleted, moved, or overwritten
// This is the only setting you will need to configure, if your wiki name and virtual file path are conventional
var imgURL = 'https://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Eristalinus_quinquestriatus_02840.jpg/800px-Eristalinus_quinquestriatus_02840.jpg';
// You probably do not need to change anything past this point
// Set this to the title of the main page, as a URL style
var mainPageTitle = 'Main_Page';
// Set this to the virtual file path of the wiki. Do not start with a slash.
// If you use domain.tld/Page_name configuration, just make this blank
var articlePath = 'wiki/';
// Script for inserting new logo into the wiki
// Do not change anything past this point unless you are comfortable with JavaScript and HTML!
logoID = document.getElementById('p-logo');
logoID.innerHTML = '<a href="/'+articlePath+''+mainPageTitle+'"><img src="'+imgURL+'" width="160px" style="position: relative; top: 10px"/></a>';
/* --------------------- End WikiLogo script --------------------- */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment