[ Index ] |
PHP Cross Reference of MediaWiki-1.24.0 |
[Source view] [Print] [Project Stats]
Implements Special:RandomInCategory This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Author: | Brian Wolff |
File Size: | 300 lines (8 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
SpecialRandomInCategory:: (13 methods):
__construct()
setCategory()
getFormFields()
requiresWrite()
requiresUnblock()
setParameter()
onSubmit()
getRandomTitle()
getQueryInfo()
getTimestampOffset()
getMinAndMaxForCat()
selectRandomPageFromDB()
getGroupName()
Class: SpecialRandomInCategory - X-Ref
Special page to direct the user to a random page__construct( $name = 'RandomInCategory' ) X-Ref |
No description |
setCategory( Title $cat ) X-Ref |
Set which category to use. param: Title $cat |
getFormFields() X-Ref |
No description |
requiresWrite() X-Ref |
No description |
requiresUnblock() X-Ref |
No description |
setParameter( $par ) X-Ref |
No description |
onSubmit( array $data ) X-Ref |
No description |
getRandomTitle() X-Ref |
Choose a random title. return: Title|null Title object (or null if nothing to choose from) |
getQueryInfo( $rand, $offset, $up ) X-Ref |
param: float $rand Random number between 0 and 1 param: int $offset Extra offset to fudge randomness param: bool $up True to get the result above the random number, false for below return: array Query information. |
getTimestampOffset( $rand ) X-Ref |
param: float $rand Random number between 0 and 1 return: int|bool A random (unix) timestamp from the range of the category or false on failure |
getMinAndMaxForCat( Title $category ) X-Ref |
Get the lowest and highest timestamp for a category. param: Title $category return: array The lowest and highest timestamp |
selectRandomPageFromDB( $rand, $offset, $up, $fname = __METHOD__ ) X-Ref |
param: float $rand A random number that is converted to a random timestamp param: int $offset A small offset to make the result seem more "random" param: bool $up Get the result above the random value param: string $fname The name of the calling method return: array Info for the title selected. |
getGroupName() X-Ref |
No description |
Generated: Fri Nov 28 14:03:12 2014 | Cross-referenced by PHPXref 0.7.1 |