Page Menu
Home
Miraheze
Search
Configure Global Search
Log In
Paste
P313
(An Untitled Masterwork)
Active
Public
Actions
Authored by
Paladox
on May 24 2020, 20:50.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Flag For Later
Award Token
Tags
None
Referenced Files
F1186718: raw-paste-data.txt
May 24 2020, 20:50
2020-05-24 20:50:54 (UTC+0)
Subscribers
None
protected function pickFromDatabase() {
global $wgRandomImageStrict;
$dbr = wfGetDB( DB_REPLICA );
$tables = [ 'page' ];
$conds = [
'page_namespace' => NS_FILE,
'page.page_is_redirect' => 0,
'page.page_random > ' . $dbr->addQuotes( wfRandom() ),
];
if ( $wgRandomImageStrict ) {
$tables[] = 'image';
$conds[] = 'img_name = page.page_title';
$conds['img_major_mime'] = 'image';
}
$row = $dbr->selectRow(
$tables,
[ 'page_namespace', 'page_title' ],
$conds,
__METHOD__,
[
'USE INDEX' => 'page.page_random',
'ORDER BY' => 'page.page_random'
]
);
return $row ? Title::newFromRow( $row ) : null;
}
Event Timeline
Paladox
created this paste.
May 24 2020, 20:50
2020-05-24 20:50:54 (UTC+0)
Log In to Comment