Last modified: 2008-07-19 06:40:28 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T16851, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 14851 - Add #sizeof: function to ParserFunctions extension
Add #sizeof: function to ParserFunctions extension
Status: RESOLVED WORKSFORME
Product: MediaWiki extensions
Classification: Unclassified
ParserFunctions (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-07-18 22:46 UTC by Hersfold
Modified: 2008-07-19 06:40 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Hersfold 2008-07-18 22:46:41 UTC
Someone recently came to me to ask if there was any way to see if a requests page could be transcluded only if there were new requests on it. After working with #ifeq:, we couldn't get it to work, however a #sizeof: function that returns the size of the page in bytes should work well for this application, and could likely be used for other uses as well. This value is already reported in the page history, and I'd think would be easy enough to access with such a function.

What I'm envisioning here (however it works, it works, of course) is something like this:

{{#sizeof:Example}}

where the size of [[Example]] would be returned in the number of bytes (404, in this case, according to the English Wikipedia's page history). Other functions such as #ifeq: could then use this value to make different things happen.

Would something like this be possible, and could it be implemented if so?
Comment 1 Jesse (Pathoschild) 2008-07-19 06:40:28 UTC
The {{PAGESIZE:xyz}} magic word is what you're looking for; see <http://www.mediawiki.org/wiki/Help:Magic_words#Statistics>. For example, it's used for the percentages on [[m:Board_elections/2008/Translation#List]].

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links