0

I need to add one line of custom js to my wiki that will apply to everyone. What line do i need to append to LocalSettings.php to enable modification of Mediawiki:Common.js (and Mediawiki:Common.css)? None of the following work:

$wgUseSiteJs = true;
$wgUserSiteJs = true;
$wgAllowUserJs = true;
$wgGroupPermissions['*']['edituserjs'] = true;
$wgGroupPermissions['*']['editusercssjs'] = true;

I also scoured every file in my installation of mediawiki for the string "Any JavaScript here will be loaded for all users on every page load", but nothing showed up so i dont know how to directly edit Common.js either.

I could create an extension, but that seems like total overkill for one line of code..

2
  • Possible duplicate of Adding CSS or JS file to MediaWiki? Commented Nov 14, 2015 at 18:53
  • I already know how to get to the pages. I just cant edit them. Commented Nov 18, 2015 at 16:06

1 Answer 1

1

I solved the problem by running the following query in phpmyadmin:

SELECT user_id INTO @uid FROM user 
WHERE user_name = '<USER YOURE LOGGED IN AS>' LIMIT 1;

INSERT INTO `user_groups`(`ug_user`, `ug_group`)
VALUES (@uid,'bureaucrat'),(@uid,'sysop');
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.