Release status: stable | |
|---|---|
| Implementation | Special page,API |
| Description | Allows to view the global usage of images in a wiki farm with shared image repository |
| Author(s) | Bryan Tong Minh (Bryantalk) |
| Latest version | 2.2.0 |
| Compatibility policy | Snapshots releases along with MediaWiki. Master is not backward compatible. |
| MediaWiki | 1.28+ |
| Database changes | Yes |
| Tables | globalimagelinks |
| License | MIT License |
| Download | README |
| |
| Translate the GlobalUsage extension if it is available at translatewiki.net | |
| Issues | Open tasks ·Report a bug |
TheGlobalUsageextension allows viewing the global usage of images in a wiki farm that uses a shared image repository.It addsSpecial:GlobalUsage as well as a list of pages that include the image on image description pages.
GlobalUsage folder to yourextensions/ directory.cdextensions/gitclonehttps://gerrit.wikimedia.org/r/mediawiki/extensions/GlobalUsagewfLoadExtension('GlobalUsage');
$wgGlobalUsageDatabase to the identifier of the wiki where the GlobalUsage data is located (usually the database name). It should be the wiki's id as used by the load balancer. (i.e. It should be the database name. If using a table prefix, it should bedbname-prefix). Example:$wgGlobalUsageDatabase='commonswiki';php extensions/GlobalUsage/maintenance/refreshGlobalimagelinks.php --pages=existing,nonexistingExtension:GlobalUsage includes an API extension that allows bots and other programs to query the global usage of a file.For example, this query on Wikimedia Commons returns global uses ofFile:Example.jpg:
| Result |
|---|
<?xml version="1.0"?><api><query><pages><pagepageid="6428847"ns="6"title="File:Example.jpg"><globalusage><gutitle="Ашаблон:Ацқьа"wiki="ab.wikipedia.org"url="http://ab.wikipedia.org/wiki/%D0%90%D1%88%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD:%D0%90%D1%86%D2%9B%D1%8C%D0%B0"/><gutitle="Wikipedia_ውይይት:Can't_see_the_font?"wiki="am.wikipedia.org"url="http://am.wikipedia.org/wiki/Wikipedia_%E1%8B%8D%E1%8B%AD%E1%8B%AD%E1%89%B5:Can%27t_see_the_font%3F"/><gutitle="አባል:Blockinblox"wiki="am.wikipedia.org"url="http://am.wikipedia.org/wiki/%E1%8A%A0%E1%89%A3%E1%88%8D:Blockinblox"/><gutitle="አባል_ውይይት:Hana.oww"wiki="am.wikipedia.org"url="http://am.wikipedia.org/wiki/%E1%8A%A0%E1%89%A3%E1%88%8D_%E1%8B%8D%E1%8B%AD%E1%8B%AD%E1%89%B5:Hana.oww"/><gutitle="አባል:Beza"wiki="am.wikipedia.org"url="http://am.wikipedia.org/wiki/%E1%8A%A0%E1%89%A3%E1%88%8D:Beza"/><gutitle="መደብ:ኪነት"wiki="am.wikipedia.org"url="http://am.wikipedia.org/wiki/%E1%88%98%E1%8B%B0%E1%89%A5:%E1%8A%AA%E1%8A%90%E1%89%B5"/><gutitle="መደብ_ውይይት:ተረትና_ምሳሌ"wiki="am.wikipedia.org"url="http://am.wikipedia.org/wiki/%E1%88%98%E1%8B%B0%E1%89%A5_%E1%8B%8D%E1%8B%AD%E1%8B%AD%E1%89%B5:%E1%89%B0%E1%88%A8%E1%89%B5%E1%8A%93_%E1%88%9D%E1%88%B3%E1%88%8C"/><gutitle="ስዕል:መርጡለ_ማርያም_ገዳም_.jpg"wiki="am.wikipedia.org"url="http://am.wikipedia.org/wiki/%E1%88%B5%E1%8B%95%E1%88%8D:%E1%88%98%E1%88%AD%E1%8C%A1%E1%88%88_%E1%88%9B%E1%88%AD%E1%8B%AB%E1%88%9D_%E1%8C%88%E1%8B%B3%E1%88%9D_.jpg"/><gutitle="User_talk:Rasheduzzaman_Raj"wiki="ang.wikipedia.org"url="http://ang.wikipedia.org/wiki/User_talk:Rasheduzzaman_Raj"/><gutitle="User:Danceteamcherleaders"wiki="ang.wikipedia.org"url="http://ang.wikipedia.org/wiki/User:Danceteamcherleaders"/></globalusage></page></pages></query><query-continue><globalusagegucontinue="Example.jpg|arwiki|77967"/></query-continue></api> |
By default, this returns only 10 results.The next 10 results can be retrieved using the gucontinue= parameter included in the result above:
The number of results returned is set with thegulimit parameter.Theguprop parameter sets which properties to retrieve.Thegufilterlocal parameter, when set to 1, will exclude uses on the same wiki as the file (e.g., on Commons).The following query retrieves all properties and up to 100 results, excluding local uses:
| This extension is being used on one or moreWikimedia projects. This probably means that the extension is stable and works well enough to be used by such high-traffic websites. Look for this extension's name in Wikimedia'sCommonSettings.php andInitialiseSettings.php configuration files to see where it's installed. A full list of the extensions installed on a particular wiki can be seen on the wiki'sSpecial:Version page. |
| This extension is included in the following wiki farms/hosts and/or packages:This is not an authoritative list. Some wiki farms/hosts and/or packages may contain this extension even if they are not listed here. Always check with your wiki farms/hosts or bundle to confirm. |