Jump to content

Manual: Parametros pro index.php

From mediawiki.org
This page is a translated version of the page Manual:Parameters to index.php and the translation is 31% complete.

Iste pagina es un lista partial del parametros passabile a index.php , le script principal del software MediaWiki que es fornite per MediaWiki mesme. Le majoritate de iste argumentos es usualmente date como parametros GET in le URL, ma pote etiam esser passate como datos POST. POST es effectivemente obligatori in alcun casos, como le action de purgar. Certe extensiones forni parametros additional.

Le information sur iste pagina non es complete.[1]

Version de pagina

Le parametros a index.php es generalmente applicabile e ha un significato associate al pagina al qual illos se applica. Le pagina (o un version de illo) pote esser specificate per scriber un o plus del sequente parametros: https://en.wikipedia.org/w/index.php?title=Ferengi&curid=177126&diff=304901009&oldid=304764764

Nomine Description
title Le titulo del pagina. Isto pote esser un pagina wiki o un pagina special, dependente del altere parametros. Pro disactivar un pagina special in le configuration de tu wiki, tu pote usar le puncto de ancorage SpecialPage_initList .
curid Le ID del pagina wiki; reimplacia le valor de title (titulo).

Certe actiones (como view e edit) functiona etiam con un version particular de un pagina. Un tal version se identifica per le sequente duo parametros, permittente le omission del titulo e del ID del pagina.

Nomine Description
oldid Le ID de un version
direction In loco del version indicate per oldid, usa:
  • direction=prev: le version que lo precede
  • direction=next: le version que lo seque

Actiones

Lo sequente es un lista de valores pro le parametro action.

Alcunes de iste actiones pote esser activate/disactivate con un parametro de configuration dedicate in LocalSettings.php . Ubi disponibile, iste parametros local es listate.[2]

Nomine Function Exemplo
view view es le action predefinite; view es le sol action usate quando necun action es date explicitemente. www.mediawiki.org/w/index.php?title=Project:Sandbox&action=view
watch Adde le pagina al observatorio del usator www.mediawiki.org/w/index.php?title=Project:Sandbox&action=watch
unwatch Remove le pagina del observatorio del usator www.mediawiki.org/w/index.php?title=Project:Sandbox&action=unwatch
delete Dele un pagina

Per predefinition, delete retorna un formulario que permitte al usator confirmar le deletion e specificar un motivo.[3]

www.mediawiki.org/w/index.php?title=Project:Sandbox&action=delete
revert Reverte a un version anterior de un imagine (image). Le duo altere parametros sequente es requirite:
  • oldimage, le ID del version al qual reverter;
  • wpEditToken, un token valide de modification
rollback Revoca le ultime modificationes facite per le ultime editor del pagina; in altere parolas, restaura le ultime version del articulo cuje redactor non es le ultime. Le modification es marcate como minor e un summario de modification predefinite es usate.[4]

Le sequente duo altere parametros es requirite:

  • from es le nomine de usator del persona cuje modificationes debe esser revertite
  • token es un token de revocation; usate pro impedir que usatores es decipite a facer un revocation non desirate per sequer un ligamine o cliccar sur un button in un sito web externe.
www.mediawiki.org/w/index.php?title=Project:Sandbox&action=rollback&from=John&token=d7aaa6c\
protect Monstra o cambia le nivellos de protection de un pagina:
  • Per predefinition, iste script retorna un formulario que monstra le nivellos de protection actual del pagina, permittente al usator de cambiar le nivellos de protection del pagina.[5]
www.mediawiki.org/w/index.php?title=Project:Sandbox&action=protect
unprotect Mesme action que protect (unprotect e protect es equivalente e face le mesme cosa). www.mediawiki.org/w/index.php?title=Project:Sandbox&action=unprotect
markpatrolled Marca un modification como patruliate; vide Help:Patrolled edit .

rcid es le ID de un modification in le tabella recentchanges

render Produce le rendition HTML del contento complete del pagina; similar al action view, ma solmente le texto del articulo sin stilos es producite, sin alcun parte del interfacie de usator (instrumentarios additional, quadro de recerca, folios de stilo, etc.).
Pro un accesso programmatic plus stabile o pro obtener le HTML solmente de un parte del contento del pagina, tu debe usar le API parse con parametros page o pageid.
www.mediawiki.org/w/index.php?title=Project:Sandbox&action=render
purge Vacua le cache del pagina, fortiante que le pagina se visualisa de novo ab su fonte.
  • Iste action se executa solmente si illo es demandate con un requesta POST; alteremente, un formulario pro confirmar le purga se monstra (premer le button OK face un POST del requesta de purga, que alora es executate).

www.mediawiki.org/w/index.php?title=Project:Sandbox&action=purge

edit Monstra le editor pro le pagina.

Le editor monstrate depende del preferentias del usator. Vide Editor .

www.mediawiki.org/w/index.php?title=Project:Sandbox&action=edit
submit Quando es visualisate directemente (HTTP GET), monstra le editor, como "edit".
  • Si le editor predefinite es mittite a VisualEditor , action=submit fortiara le apparentia del editor de codice fonte. VisualEditor pote esser seligite con le parametro veaction=edit del URL. Le 2017 wikitext editor pote esser seligite con veaction=editsource.
  • Le superposition #/editor/… de Extension:MobileFrontend sur Skin:Minerva non appare con action=submit. In su loco, le formulario de submission usual es monstrate, que permitte marcar modificationes como "minor".
  • Le parametro additional hidewelcomedialog pote esser usate pro supprimer le apparentia del fenestra emergente de benvenita del selector de editor.

Quando on visita un pagina per submission de un formulario (HTTP POST), illo face varie actiones relative al modification del pagina (vide #Que facer infra pro plus detalios):

  • Change a page,
  • Preview a new version of the page, or
  • Show the difference with a new version.
www.mediawiki.org/w/index.php?title=Project:Sandbox&action=submit
editredlink Same as edit.[6] www.mediawiki.org/w/index.php?title=Project:Sandbox&action=editredlink
history Shows the history of the page. (See history, below) www.mediawiki.org/w/index.php?title=Project:Sandbox&action=history
historysubmit When viewing the difference between revisions, after clicking "compare selected revisions" on the history page. This requires a "diff" and/or "oldid" parameter, otherwise it just shows the page itself. www.mediawiki.org/w/index.php?title=Project:Sandbox&action=historysubmit&diff=456290&oldid=456270
raw Shows the raw content of the page. (See Raw, below) A pop up window will open up, asking whether you would like to save the page in index.php.[7] www.mediawiki.org/w/index.php?title=Project:Sandbox&action=raw
credits Shows a list of people who contributed to the page in question using the real name specified in the user's preferences. Currently disabled on Wikimedia wikis, but is enabled by default on vanilla MediaWiki. translatewiki.net/w/i.php?title=Translating:MediaWiki&action=credits
info Shows information about the page, such as the number of users having it in their watchlist, the number of edits, the number of authors. See the Reimplement info action RfC for context. www.mediawiki.org/w/index.php?title=Project:Sandbox&action=info
revisiondelete Set visibility restrictions on revision text, edit summary, and editor's username/IP address (requires deleterevision user right)

User preference overriding

The following parameters override some of the user's preferences. Other parameters explained in other sections are "diffonly", "internaledit", and "externaledit". The below parameters affect all actions but "render" and "raw".

Name Function Example
useskin Specify a skin www.mediawiki.org/w/index.php?useskin=modern
uselang Specify a language for the UI elements (such as the "my talk" link, etc.), i.e. the user interface language; this is especially useful for creating an account, because at that stage no preference settings apply.

The special language code "qqx " can be used to display the IDs of all system messages used on a page.

www.mediawiki.org/w/index.php?title=Special:Userlogin&type=signup&uselang=de
variant Specify a language variant for the UI elements (this is used for example in the Chinese Wikipedia, as the Chinese language has variants);
printable (deprecated in 1.35) When set to yes, the page is shown in a form that is suitable for printing.
debug When set to true (e.g. 1 or true), the ResourceLoader serves non-minified JavaScript and CSS. See ResourceLoader/Features#Debug mode. www.mediawiki.org/w/index.php?title=Project:Sandbox&debug=true
safemode When enabled (e.g. set to 1 or true), user-provided CSS and JS will not be loaded. This disables personal scripts and styles (e.g. "User:" common.js and css), and site-wide scripts and styles (e.g. "MediaWiki:Common.js" and "MediaWiki:Common.css"), and all gadgets.[8]

It is possible to mark site-wide styles ("MediaWiki:Common.css") as safe via $wgAllowSiteCSSOnRestrictedPages , which permits them in safemode.

www.mediawiki.org/w/index.php?title=MediaWiki&safemode=1
useskinversion Specify a skin version[9] www.mediawiki.org/w/index.php?title=MediaWiki&useskinversion=2
vectornightmode When set to 1, the page is shown in dark mode on skins like Vector 2022 that support dark mode. www.mediawiki.org/w/index.php?title=MediaWiki&useskin=vector-2022&vectornightmode=1

View and render

View is the default action. If no other action is added to the URL, action=view is used. This action shows a page, a revision, or the difference between two revisions of the same or two different pages. Below is a (partial) list.

diff
the value of this parameter identifies a revision; the difference between another revision and this one is returned:
  • if oldid is not passed, the difference between this revision and the previous one on the same article is shown;
  • otherwise, the difference between the revision given by oldid/direction and this one is shown; the value of this parameter can be a revision ID, the values prev or next to identify a revision relative to the one given by oldid/direction, and the value cur to identify the latest revision of the page;
Note that oldid and diff need not be two revisions of the same article, allowing two revisions of two different pages to be compared
diffmode (provided by the VisualEditor extension)
Can be set to visual or source to override the user's preference on whether to display a visual or wikitext diff.
redirect
if the value of this parameter is 'no' and the page is a redirect, the page itself is shown and not the target of the redirect; this parameter has effect only on action=view and action=render and only if neither oldid nor diff is given, as this is the only case where the target article is shown instead of the redirect;
rdfrom
when the page is the result of following a redirect from an external wiki, this parameter tells which wiki that was, so that the "Redirected from ..." line can be shown
diffonly
override the user's preference on whether to render the page when a diff is requested, eg. diffonly=yes
search
if non-blank (and if searches are enabled), override all other parameters and perform a search

The following parameters apply only to categories.

from
if the page is a category, only list entries whose sortkey are equal or follows the value of this parameter;
Example: https://en.wikipedia.org/w/index.php?title=Special:Log&type=upload&from=20070814233520&until=20070814233625
Links to a log of all the images uploaded on August 14, 2007 from 23:35:20 until 23:36:25
until
if the page is a category, only list entries whose sortkey precedes the value of this parameter; only used if from is not passed;

The following parameter apply only to images.

page
a page number in a multi-page media; it currently only applies to DjVu and PDF files; first page is numbered 1;

History

limit
The number of page edits to list, the maximum is 5000 edits.
Example: https://en.wikipedia.org/w/index.php?title=Special:Contributions&limit=13&contribs=user&target=Atlgirl052005 - lists 13 edits per page.
dir
the relative order of edit history pages.
page edits are sorted in decreasing timestamp.
offset
uses a timestamp to specify which part of the history is displayed;
Returns the edits which occurred before the timestamp;
Example: https://en.wikipedia.org/w/index.php?title=Special:Contributions&offset=20090815195334&contribs=user&target=Atlgirl052005
Shows the edits which occurred immediately before the timestamp 20090815195334 (20090815195334 is not shown).
Parameter format is yyyymmddhhmmss. So 20090815195334 was created on August 15, 2009 [20090815] at 19:53 (UTC) and 34 seconds [195334].
See Wikipedia:Complete diff and link guide.
if dir=prev is added, it works the other way around, listing all edits after the timestamp[10]
Example: https://en.wikipedia.org/w/index.php?title=Special:Contributions&offset=20090815195334&dir=prev&contribs=user&target=Atlgirl052005
Shows the edits which occurred immediately after the timestamp 20090815195334 (20090815195334 is not shown).
Example to show only the very first edit on a page: https://en.wikipedia.org/w/index.php?title=Wikipedia:Village_pump_(technical)&action=history&dir=prev&limit=1
feed
a feed for the changes in the history is returned; allowed values are atom and rss. Can be disabled with $wgFeed .
go
(deprecated - should be avoided, because it has been superseded) go=first the first (earliest) page of history is shown

Raw

Passing action=raw returns the source code of a page or revision. For caching and security reasons, this should generally only be used via the script path, that is, index.php?title=.... While "short urls" like /wiki/ are only meant for action=view, they unofficially tend to work for other actions as well. This is expressly discouraged for action=raw as it leads to less effective caching and bypasses automatic purging after edits.

templates
if passed with value expand, templates within the page are expanded;
ctype
the content-type value to be used in the HTTP header when returning the raw content, instead of the default text/x-wiki; this can only be one of the allowed types, which currently are text/x-wiki, text/javascript, text/css, and application/x-zope-edit
oldid
the ID of a specific revision to return
direction
either next, prev, or cur; instead of the revision specified by oldid, returns the one following it, the one preceding it, or the current (last) one;
section
Limits output to a particular section or subsections of the document. Sections are specified with non-negative integers : section 0 being the section before any named sections, section one being the first named section or subsection and so on. The numbering scheme treats sections and subsections as identical. A list of the sections and subsections can be obtained via API with api.php?action=parse&text={{:My_page}}__TOC__&prop=sections.
example

Edit and submit

The edit and submit actions perform almost the same action. By default, they return an "edit page" form for the page. Different results can be obtained by passing other arguments; some results (such as saving the new version of a page) can only be obtained using POST. This action takes the standard arguments for specifying a page or a page revision.

Options affecting the edit form

The following options produce an effect on the edit form. (Note: 'section' also affects how the page is saved. Additionally, 'preload' and 'preloadparams' only work on wikitext contentmodel)

section
specifies the index of a section within a document to preload and edit; sections are numbered sequentially from 0 on; section 0 is the part of the article before the first section header; value new is used to append a new section to the document;
preload
specifies a page, of which the wikitext is used as the initial value of the textarea in the edit form if the page or section to be edited does not exist; if it exists the preload command is ignored; also see Manual: Creation de paginas con texto pre-completate ;
Example: https://en.wikipedia.org/wiki/Talk:Main_Page?action=edit&section=new&preload=Project:Sandbox
preloadparams[] (or preloadparams%5B%5D):
Replace $1 style parameters in preload text.
For example https://mediawiki.org/wiki/Project:Sandbox?action=edit&section=new&preload=Manual:Creating_pages_with_preloaded_text/param_demo&preloadparams%5b%5d=first%20value&preloadparams%5b%5d=second%20value would cause Manual:Creating pages with_preloaded text/param demo to be preloaded into the edit form, but with $1 replaced by first value and $2 replaced by second value. (introduced in 1.23)
The only way to set a default value for $1 style parameters is with <includeonly>{{SUBST:#ifeq:$1|&#36;1|default value|$1}}</includeonly>
editintro
title of an existing article or template to be rendered above the edit form;
preloadtitle
in the case of section=new, provides initial content of the "Subject/headline" box; it can be edited before saving;
Example: https://en.wikipedia.org/w/index.php?title=User_talk:5dsddddd&action=edit&section=new&preloadtitle=The+%5B%5BWP%3AARS%7CArticle+Rescue+Squadron%5D%5D
Example with both preloadtitle and preload: https://en.wikipedia.org/wiki/User_Talk:Ikip?action=edit&section=new&preload=Template:Article_Rescue_Squadron_ invite&preloadtitle=Invitation
nosummary
Do not show the "headline" box when doing section=new.
summary
its value is used as the edit summary in place of the default one.
preview
if set to yes or no, overrides user preference "Monstrar previsualisation quando se comencia a modificar (T11936);
internaledit/externaledit (removed in 1.22)
overrides user preference on external editors;
mode (removed in 1.22)
this parameter affects the result page if passed with value file and using an external editor;
undo, undoafter
attempts to undo a sequence of edits, from the undoafter revision up to the undo revision; technically, this is done by trying to merge the inverse of these edits with the sequence of all subsequent edits; the values of these parameters are IDs of old revisions of a page; if merge is not possible, a regular edit form for that revision is returned

What to do

The following options tell the software what to do when submitting: saving, showing a preview, or showing the difference with the current version.

wpSave
this argument is generated when saving the content of an edit form returned by the server, but is not actually used nor required when submitting (see below for required arguments to save);
wpPreview
set in a POST request to request a preview of the page or section as if the value of wpTextbox1 were saved;
  • by default, returns an edit form with a preview of the value of wpTextbox1;
  • if the additional live argument is passed, only the rendering of the value of wpTextbox1 is shown, not the form and the other GUI element; this is similar to the result of saving and then viewing with action=render; see Manual:Live preview for more info;
  • the argument wpLivePreview is identical to wpPreview; therefore, a regular preview is returned if live is not passed;
wpDiff
set in a POST request to request a table showing the changes between the current version of the page or section and the version as if value of wpTextbox1 were saved;

Parameters that are needed to save

The following parameters are required when a user saves a page. The edit summary field may also be required if so configured (see below).

wpTextbox1
the new page/section content;
wpStarttime
the timestamp of when the user started editing the page; used to check whether the page has been deleted between this moment and the submission time (in this case, the user is asked to confirm saving);
wpRecreate
in case the page was deleted after wpStarttime, this field confirms that the page is to be saved;
wpEdittime
for new pages, it is equal to wpStarttime; otherwise, it is the timestamp of the last revision of the page; used to check edit conflicts;
wpEditToken
an edit token; this is used to avoid users from being tricked into saving a page by following a link or pressing a button in an external site. For non-logged-in users, wpEditToken is required since phab:rSVN18112; it currently contains only the characters +\ rather than a random string (see edit token suffix).

For the page to be saved, wpStarttime, wpEdittime, wpTextbox1 and wpEditToken are required in a POST request, and neither wpPreview nor wpDiff are passed. If the page was deleted after wpStarttime, the boolean option wpRecreate is also required.

Optional additional data

The edit summary or the "ignore blank" parameter may be mandatory if "warn on blank summaries" is configured.

wpSummary
the edit summary.
wpMinoredit
if set in a save request, the edit is marked as minor. for preview and diff, it is the initial value of "this is a minor edit" checkbox in the edit form.
wpWatchthis
if passed on a save request, the page is added to the user's watchlist. if it is not passed in a save request, the page is removed from the user's watchlist. for preview or diff, this is the initial value of the "watch this page" checkbox of the edit form.
wpWatchlistExpiry
page is added to watchlist with the given expiry time.
wpSection
specify the index of a section within a document to submit to. sections are numbered sequentially from 0 on. section 0 is the part of the article before the first section header. value new is used to append a new section to the document.
wpChangeTags
an optional comma-separated list of tags to be added to the edit. If any of the provided tags are not activated for manual use, the edit will be rejected.
wpAutoSummary
contains the MD5-hashing of the edit summary field as initially presented to the user in the edit form. this field is used to check if the user has modified that field before submitting: if the MD5 hashing of the value of wpEditSummary is the same as this field, the edit summary has not been modified.
wpIgnoreBlankSummary
save page even if user has not modified the edit summary, while they were supposed to.
wpTextbox2
in case of an edit conflict, it contains the value of wpTextbox1 of the save request that generated the conflict.
wpScrolltop
used to preserve the scrollbar position in the edit textbox when loading a preview.
redlink
if the user does not have permission to edit the page, redirect to the empty article page (e.g., "Wikipedia does not have an article with this exact name") instead of showing the permission error notice. If the target page exists, ignore the edit parameter and display the (now-)existing page instead. This parameter is used on red links.
wpExtraQueryRedirect
hidden input to modify after save URL and is not used by actual edit form. Intended to be used by gadgets and such.

Special pages

Most special pages have additional parameters, specific to the function they perform. As an example, the parameters for Special:Export are outlined in Manual:Parameters to Special:Export

The following URL parameters provide initial values for some input fields; they can be edited before submitting the form.

wpNewTitle
text field with new title.
wpReasonList
reason to pre-select in the dropdown.
wpReason
text field with reason.
wpLeaveRedirect
whether to select the "Leave a redirect behind" checkbox.
wpDisableEmail
whether to select the Inviar e-mail checkbox.
wpDisableUTEdit
whether to select the Modificar le proprie pagina de discussion checkbox.
wpReason
initially selected item in the drop-down box, value should match a row in the MediaWiki:Ipbreason-dropdown.
wpReason-other
text field with custom reason; require wpReason=other
wpAutoBlock
whether to select the Blocar le adresse IP usate le plus recentemente per iste conto, e omne adresses IPs successive desde le quales le conto tenta facer modificationes, pro $1 checkbox.
wpWatch
whether to select the Observar le paginas de usator e de discussion del destinatario del blocada checkbox.
user-reason
text field with reason.

Maxlag parameter

MediaWiki versions:
1.10 – 1.27

The maxlag parameter is used only if the software is running on a replicated database cluster.

The maxlag parameter makes it so a request is not served if there is high server traffic. maxlag parameter applies to all actions. maxlag parameter value is a number; the lower this value, the lower the traffic that causes the request not to be served. Zero is not allowed.

Notes

  1. Le clientes que submitte formularios debe submitter tote le parametros de formulario presente in le codice HTML; depender de un lista static pote causar problemas in le futuro. Pro crear nove actiones in un installation de MediaWiki, vide $wgActions .
  2. Qualcunque action, excepte view, pote esser disactivate usante le variabile $wgActions , que es ora disponibile pro tote le actiones. Si le recercas es activate e le parametro search es fornite (e non vacue), alora tote le actiones es ignorate e le recerca es executate.
  3. Le deletion se face per un requesta POST, si un token de modification valide es passate como le valor de wpEditToken; isto es lo que eveni quando le usator confirma le deletion. Le ration pro le deletion es passate como le valor del argumento wpReason; iste texto es registrate in le registro de deletiones (le campo log_comment_id del tabella logging ). Le deletion es etiam exequite quando se dele un version specific de un imagine; isto require que le ID del version sia passate in le parametro oldimage e un token de modification valide in wpEditToken; in iste caso, le requesta pote etiam esser passate via GET.
    • si le argumento optional summary es passate, su valor es usate como le summario de modification in loco del predefinite
    • si le argumento optional bot es passate, le modification essera marcate como de robot (le modification habera le marca rc_bot=1 in le tabella recentchanges )
    • le argumento bot pote etiam esser usate sur omne pagina ubi un ligamine [rollback] apparera, pro adjunger &bot=1 in cascada a tote le ligamines de revocation generate
    • si le argumento optional hidediff es passate, le message de successo es monstrate in loco del visualisation de differentias del modification (isto pote esser fortiate in le preferentias del usator)
  4. Iste nivellos es cambiate al valores de mwProtect-level-edit e mwProtect-level-move si le requesta es un POST e un token de modification valide es passate como wpEditToken; le parametro mwProtect-reason da le ration pro le protection o disprotection que essera registrate in le registro del pagina; si mwProtect-cascade es etiam passate, le protection in cascada se applica (tote le paginas transcludite es fixate al mesme nivellos de protection).
    • plus generalmente, le actiones que pote esser limitate es illos listate in le matrice $wgRestrictionTypes ; iste matrice es initialisate a array('edit','move') e pote esser cambiate in LocalSettings.php ; le action de protection alora accepta un parametro mwProtect-level-$action pro cata action in iste matrice
  5. For security reasons, in some versions of MediaWiki Raw is only allowed when using the "primary script access point", that is, when using the "ugly" URL form with index.php?title=...
  6. Project:Tech News/2017#Tech News: 2017-16
  7. Reading/Web/Desktop Improvements#May 2020: First deployment - officewiki and testwiki
  8. For performance reasons, the value of this field is not actually an offset (the index of the first entry to show)

See also