-function wfSpecialNewimages( $par, $specialPage ) {
- global $wgUser, $wgOut, $wgLang, $wgRequest, $wgMiserMode;
-
- $wpIlMatch = $wgRequest->getText( 'wpIlMatch' );
- $dbr = wfGetDB( DB_SLAVE );
- $sk = $wgUser->getSkin();
- $shownav = !$specialPage->including();
- $hidebots = $wgRequest->getBool( 'hidebots' , 1 );
-
- $hidebotsql = '';
- if ( $hidebots ) {
- # Make a list of group names which have the 'bot' flag set.
- $botconds = array();
- foreach ( User::getGroupsWithPermission('bot') as $groupname ) {
- $botconds[] = 'ug_group = ' . $dbr->addQuotes( $groupname );
- }
-
- # If not bot groups, do not set $hidebotsql
- if ( $botconds ) {
- $isbotmember = $dbr->makeList( $botconds, LIST_OR );
-
- # This join, in conjunction with WHERE ug_group IS NULL, returns
- # only those rows from IMAGE where the uploading user is not a mem-
- # ber of a group which has the 'bot' permission set.
- $ug = $dbr->tableName( 'user_groups' );
- $hidebotsql = " LEFT JOIN $ug ON img_user=ug_user AND ($isbotmember)";
- }
- }
-
- $image = $dbr->tableName( 'image' );
-
- $sql = "SELECT img_timestamp from $image";
- if ($hidebotsql) {
- $sql .= "$hidebotsql WHERE ug_group IS NULL";
- }
- $sql .= ' ORDER BY img_timestamp DESC';
- $sql = $dbr->limitResult($sql, 1, false);
- $res = $dbr->query( $sql, __FUNCTION__ );
- $row = $dbr->fetchRow( $res );
- if( $row !== false ) {
- $ts = $row[0];
- } else {
- $ts = false;