while ( $row = $dbw->fetchObject( $res ) ) { to foreach ( $res as $row ) in includes
Add some braces
}
$tbtext = "";
- while ( $o = $dbr->fetchObject( $tbs ) ) {
+ foreach ( $tbs as $o ) {
$rmvtxt = "";
if ( $wgUser->isAllowed( 'trackback' ) ) {
$authors = array( $row->rev_user_text );
- while ( $row = $db->fetchObject( $res ) ) {
+ foreach ( $res as $row ) {
$authors[] = $row->rev_user_text;
}
# No results, don't autoblock anything
wfDebug( "No IP found to retroactively autoblock\n" );
} else {
- while ( $row = $dbr->fetchObject( $res ) ) {
+ foreach ( $res as $row ) {
if ( $row->rc_ip ) {
$this->doAutoblock( $row->rc_ip );
}
__METHOD__
);
- while ( $row = $dbr->fetchObject( $res ) ) {
+ foreach ( $res as $row ) {
$timestamps[$row->page_namespace][$row->page_title] = $row->page_touched;
}
}
/* WHERE */ array( 'cl_from' => $this->next ),
__METHOD__ . '-1'
);
- while ( $o = $this->dbr->fetchObject( $res ) ) {
+ foreach ( $res as $o ) {
$k = $o->cl_to;
# Update parent tree
/* WHERE */ array( 'page_namespace' => NS_CATEGORY , 'page_title' => $layer ),
__METHOD__ . '-2'
);
- while ( $o = $this->dbr->fetchObject( $res ) ) {
+ foreach ( $res as $o ) {
$id = $o->page_id;
$name = $o->page_title;
$this->name2id[$name] = $id;
global $wgMemc;
$key = wfMemcKey( 'valid-tags' );
- if ( $tags = $wgMemc->get( $key ) )
+ if ( $tags = $wgMemc->get( $key ) ) {
return $tags;
+ }
$emptyTags = array();
// Some DB stuff
$dbr = wfGetDB( DB_SLAVE );
$res = $dbr->select( 'valid_tag', 'vt_tag', array(), __METHOD__ );
- while( $row = $res->fetchObject() ) {
+ foreach ( $res as $row ) {
$emptyTags[] = $row->vt_tag;
}
),
__METHOD__,
array( 'ORDER BY' => 'rev_timestamp ASC', 'LIMIT' => 50 ) );
- while( $row = $res->fetchObject() ) {
+ foreach ( $res as $row ) {
if( $row->rev_user != $id ) {
return false;
}
*/
protected function outputPageStream( $resultset ) {
$last = null;
- while( $row = $resultset->fetchObject() ) {
+ foreach ( $resultset as $row ) {
if( is_null( $last ) ||
$last->page_namespace != $row->page_namespace ||
$last->page_title != $row->page_title ) {
}
protected function outputLogStream( $resultset ) {
- while( $row = $resultset->fetchObject() ) {
+ foreach ( $resultset as $row ) {
$output = $this->writer->writeLogItem( $row );
$this->sink->writeLogItem( $row, $output );
}
$ids = array();
$remaining = $this->data;
- while ( $row = $res->fetchObject() ) {
+ foreach ( $res as $row ) {
$title = Title::makeTitle( $row->page_namespace, $row->page_title );
$cache->addGoodLinkObj( $row->page_id, $title, $row->page_len, $row->page_is_redirect, $row->page_latest );
$ids[$title->getPrefixedDBkey()] = $row->page_id;
'page_touched < ' . $this->mDb->addQuotes( $now )
), __METHOD__
);
- while ( $row = $this->mDb->fetchObject( $res ) ) {
+ foreach ( $res as $row ) {
$ids[] = $row->page_id;
}
if ( !count( $ids ) ) {
$res = $this->mDb->select( 'pagelinks', array( 'pl_namespace', 'pl_title' ),
array( 'pl_from' => $this->mId ), __METHOD__, $this->mOptions );
$arr = array();
- while ( $row = $this->mDb->fetchObject( $res ) ) {
+ foreach ( $res as $row ) {
if ( !isset( $arr[$row->pl_namespace] ) ) {
$arr[$row->pl_namespace] = array();
}
$res = $this->mDb->select( 'templatelinks', array( 'tl_namespace', 'tl_title' ),
array( 'tl_from' => $this->mId ), __METHOD__, $this->mOptions );
$arr = array();
- while ( $row = $this->mDb->fetchObject( $res ) ) {
+ foreach ( $res as $row ) {
if ( !isset( $arr[$row->tl_namespace] ) ) {
$arr[$row->tl_namespace] = array();
}
$res = $this->mDb->select( 'imagelinks', array( 'il_to' ),
array( 'il_from' => $this->mId ), __METHOD__, $this->mOptions );
$arr = array();
- while ( $row = $this->mDb->fetchObject( $res ) ) {
+ foreach ( $res as $row ) {
$arr[$row->il_to] = 1;
}
return $arr;
$res = $this->mDb->select( 'externallinks', array( 'el_to' ),
array( 'el_from' => $this->mId ), __METHOD__, $this->mOptions );
$arr = array();
- while ( $row = $this->mDb->fetchObject( $res ) ) {
+ foreach ( $res as $row ) {
$arr[$row->el_to] = 1;
}
return $arr;
$res = $this->mDb->select( 'categorylinks', array( 'cl_to', 'cl_sortkey' ),
array( 'cl_from' => $this->mId ), __METHOD__, $this->mOptions );
$arr = array();
- while ( $row = $this->mDb->fetchObject( $res ) ) {
+ foreach ( $res as $row ) {
$arr[$row->cl_to] = $row->cl_sortkey;
}
return $arr;
$res = $this->mDb->select( 'langlinks', array( 'll_lang', 'll_title' ),
array( 'll_from' => $this->mId ), __METHOD__, $this->mOptions );
$arr = array();
- while ( $row = $this->mDb->fetchObject( $res ) ) {
+ foreach ( $res as $row ) {
$arr[$row->ll_lang] = $row->ll_title;
}
return $arr;
$res = $this->mDb->select( 'iwlinks', array( 'iwl_prefix', 'iwl_title' ),
array( 'iwl_from' => $this->mId ), __METHOD__, $this->mOptions );
$arr = array();
- while ( $row = $this->mDb->fetchObject( $res ) ) {
+ foreach ( $res as $row ) {
if ( !isset( $arr[$row->iwl_prefix] ) ) {
$arr[$row->iwl_prefix] = array();
}
$res = $this->mDb->select( 'page_props', array( 'pp_propname', 'pp_value' ),
array( 'pp_page' => $this->mId ), __METHOD__, $this->mOptions );
$arr = array();
- while ( $row = $this->mDb->fetchObject( $res ) ) {
+ foreach ( $res as $row ) {
$arr[$row->pp_propname] = $row->pp_value;
}
return $arr;
# Do a link batch query
if( $this->getNumRows() > 0 ) {
$lb = new LinkBatch;
- while( $row = $this->mResult->fetchObject() ) {
+ foreach ( $this->mResult as $row ) {
$lb->add( $row->log_namespace, $row->log_title );
$lb->addObj( Title::makeTitleSafe( NS_USER, $row->user_name ) );
$lb->addObj( Title::makeTitleSafe( NS_USER_TALK, $row->user_name ) );
$sql = $this->getSQL() . $this->getOrder();
$sql = $dbr->limitResult( $sql, $limit, 0 );
$res = $dbr->query( $sql, 'QueryPage::doFeed' );
- while( $obj = $dbr->fetchObject( $res ) ) {
+ foreach ( $res as $obj ) {
$item = $this->feedResult( $obj );
- if( $item ) $feed->outItem( $item );
+ if( $item ) {
+ $feed->outItem( $item );
+ }
}
$feed->outFooter();
*/
function preprocessResults( $db, $res ) {
$batch = new LinkBatch;
- while ( $row = $db->fetchObject( $res ) )
+ foreach ( $res as $row ) {
$batch->add( $row->namespace, $row->title );
+ }
$batch->execute();
// Back to start for display
__METHOD__ );
$blurlArr = $title->getSquidURLs();
if ( $dbr->numRows( $res ) <= $wgMaxSquidPurgeTitles ) {
- while ( $BL = $dbr->fetchObject ( $res ) )
- {
+ foreach ( $res as $BL ) {
$tobj = Title::makeTitle( $BL->page_namespace, $BL->page_title ) ;
$blurlArr[] = $tobj->getInternalURL();
}
*/
private function loadRestrictionsFromResultWrapper( $res, $oldFashionedRestrictions = null ) {
$rows = array();
- $dbr = wfGetDB( DB_SLAVE );
- while ( $row = $dbr->fetchObject( $res ) ) {
+ foreach ( $res as $row ) {
$rows[] = $row;
}
array( 'ug_user' => $this->mId ),
__METHOD__ );
$this->mGroups = array();
- while( $row = $dbr->fetchObject( $res ) ) {
+ foreach ( $res as $row ) {
$this->mGroups[] = $row->ug_group;
}
}
__METHOD__
);
- while( $row = $dbr->fetchObject( $res ) ) {
+ foreach ( $res as $row ) {
$this->mOptionOverrides[$row->up_property] = $row->up_value;
$this->mOptions[$row->up_property] = $row->up_value;
}
'wl_notificationtimestamp IS NULL',
), __METHOD__
);
- while ($row = $dbw->fetchObject( $res ) ) {
+ foreach ( $res as $row ) {
$watchers[] = intval( $row->wl_user );
}
if ($watchers) {
array( 'ug_user' => $this->id ),
__METHOD__ );
$groups = array();
- while( $row = $this->db->fetchObject( $res ) ) {
+ foreach ( $res as $row ) {
$groups[] = $row->ug_group;
}
return $groups;
);
# Construct array to replace into the watchlist
$values = array();
- while ( $s = $dbw->fetchObject( $res ) ) {
+ foreach ( $res as $s ) {
$values[] = array(
'wl_user' => $s->wl_user,
'wl_namespace' => $newnamespace,
__METHOD__
);
if( $res->numRows() > 0 ) {
- while( $row = $res->fetchObject() ) {
+ foreach ( $res as $row ) {
$title = Title::makeTitleSafe( $row->wl_namespace, $row->wl_title );
if( $title instanceof Title && !$title->isTalkPage() )
$list[] = $title->getPrefixedText();
$res = $dbr->query( $sql, __METHOD__ );
if( $res && $dbr->numRows( $res ) > 0 ) {
$cache = LinkCache::singleton();
- while( $row = $dbr->fetchObject( $res ) ) {
+ foreach ( $res as $row ) {
$title = Title::makeTitleSafe( $row->wl_namespace, $row->wl_title );
if( $title instanceof Title ) {
// Update the link cache while we're at it
if( $wgRequest->getVal( 'printable' ) === 'yes' ) {
$wgOut->setPrintable();
}
- $ret = null;
+
if( $curid = $wgRequest->getInt( 'curid' ) ) {
// URLs like this are generated by RC, because rc_title isn't always accurate
$ret = Title::newFromID( $curid );
ApiBase::PARAM_DFLT => false,
ApiBase::PARAM_DEPRECATED => true,
),
- 'oldimage' => null
+ 'oldimage' => null,
);
}
$result = array();
- while ( $row = $this->fetchObject( $res ) ) {
+ foreach ( $res as $row ) {
if ( $row->Key_name == $index ) {
$result[] = $row;
}
$res = $this->query( "SHOW STATUS LIKE '{$which}'" );
$status = array();
- while ( $row = $this->fetchObject( $res ) ) {
+ foreach ( $res as $row ) {
$status[$row->Variable_name] = $row->Value;
}
}
$result = array();
- while ( $row = $res->FetchNextObj() ) {
+ foreach ( $res as $row ) {
if ( $row->index_name == $index ) {
$row->Non_unique = !stristr( $row->index_description, "unique" );
$cols = explode( ", ", $row->index_keys );
print( "Error in fieldInfo query: " . $this->getErrors() );
return false;
}
- if ( $meta = $this->fetchRow( $res ) )
+ if ( $meta = $this->fetchRow( $res ) ) {
return new MssqlField( $meta );
+ }
return false;
}
}
$rows = 1;
- while( $plan = $this->fetchObject( $res ) ) {
+ foreach ( $res as $plan ) {
$rows *= $plan->rows > 0 ? $plan->rows : 1; // avoid resetting to zero
}
return $rows;
if ( !$res ) {
return null;
}
- while ( $row = $this->fetchObject( $res ) ) {
+ foreach ( $res as $row ) {
if ( $row->indexname == $this->indexName( $index ) ) {
return $row;
}
if ( !$res ) {
return null;
}
- while ( $row = $this->fetchObject( $res ) ) {
+ foreach ( $res as $row ) {
return true;
}
return false;
continue;
$matches = $ymatches[$line];
reset($matches);
- while (list ($junk, $y) = each($matches))
- if (empty($this->in_seq[$y])) {
- $k = $this->_lcs_pos($y);
- assert($k > 0);
- $ymids[$k] = $ymids[$k-1];
- break;
+ while ( list( $junk, $y ) = each( $matches ) ) {
+ if ( empty( $this->in_seq[$y] ) ) {
+ $k = $this->_lcs_pos( $y );
+ assert( $k > 0 );
+ $ymids[$k] = $ymids[$k-1];
+ break;
+ }
}
while (list ( /* $junk */, $y) = each($matches)) {
if ($y > $this->seq[$k-1]) {
$retVal = array();
if ( $db->numRows( $res ) ) {
- while ( $row = $db->fetchObject( $res ) ) {
+ foreach ( $res as $row ) {
if ( $titleObj = Title::newFromRow( $row ) ) {
$linkCache->addGoodLinkObj( $row->page_id, $titleObj, $row->page_len, $row->page_is_redirect, $row->page_latest );
$retVal[] = $titleObj;
$res = $dbr->select( $tables, $fields, $conds, __METHOD__, $opts, $join_conds );
$r = array();
- while ( $row = $dbr->fetchObject( $res ) ) {
+ foreach ( $res as $row ) {
if ( $this->repo->oldFileFromRowFactory ) {
$r[] = call_user_func( $this->repo->oldFileFromRowFactory, $row, $this->repo );
} else {
$result = $dbw->select( 'oldimage',
array( 'oi_archive_name' ),
array( 'oi_name' => $this->getName() ) );
- while ( $row = $dbw->fetchObject( $result ) ) {
+ foreach ( $result as $row ) {
$batch->addOld( $row->oi_archive_name );
}
$status = $batch->execute();
__METHOD__
);
- while ( $row = $dbw->fetchObject( $res ) ) {
+ foreach ( $res as $row ) {
if ( rtrim( $row->oi_sha1, "\0" ) === '' ) {
// Get the hash from the file
$oldUrl = $this->file->getArchiveVirtualUrl( $row->oi_archive_name );
$dbw->bitAnd( 'oi_deleted', File::DELETED_FILE ) => File::DELETED_FILE ),
__METHOD__ );
- while ( $row = $dbw->fetchObject( $res ) ) {
+ foreach ( $res as $row ) {
$privateFiles[$row->oi_archive_name] = 1;
}
}
$first = true;
$archiveNames = array();
- while ( $row = $dbw->fetchObject( $result ) ) {
+ foreach ( $result as $row ) {
$idsPresent[] = $row->fa_id;
if ( $row->fa_name != $this->file->getName() ) {
__METHOD__
);
- while ( $row = $this->db->fetchObject( $result ) ) {
+ foreach ( $result as $row ) {
$oldName = $row->oi_archive_name;
$bits = explode( '!', $oldName, 2 );
);
$result = array();
- while ( $row = $res->fetchObject() )
+ foreach ( $res as $row ) {
$result[] = $this->newFileFromRow( $row );
- $res->free();
+ }
+
return $result;
}
}
$cols = array();
- while ( $r = $this->db->fetchRow( $res ) ) {
+ foreach ( $res as $r ) {
$cols[] = array(
"name" => $r[0],
"ord" => $r[1],
# Fetch data and form into an associative array
# non-existent = broken
- while ( $s = $dbr->fetchObject($res) ) {
+ foreach ( $res as $s ) {
$title = Title::makeTitle( $s->page_namespace, $s->page_title );
$pdbk = $title->getPrefixedDBkey();
$linkCache->addGoodLinkObj( $s->page_id, $title, $s->page_len, $s->page_is_redirect, $s->page_latest );
foreach ( $titlesAllVariants as &$titlesVariant ) {
$titlesVariant = explode( "\0", $titlesVariant );
}
-
+ $l = count( $titlesAttrs );
// Then add variants of links to link batch
- for ( $i = 0; $l = count( $titlesAttrs ), $i < $l; $i ++ ) {
+ for ( $i = 0; $i < $l; $i ++ ) {
foreach ( $allVariantsName as $variantName ) {
$textVariant = $titlesAllVariants[$variantName][$i];
extract( $titlesAttrs[$i] );
$linkcolour_ids = array();
// for each found variants, figure out link holders and replace
- while ( $s = $dbr->fetchObject($varRes) ) {
+ foreach ( $varRes as $s ) {
$variantTitle = Title::makeTitle( $s->page_namespace, $s->page_title );
$varPdbk = $variantTitle->getPrefixedDBkey();
$pageFlags = $talkFlags = array();
- while( $s = $dbr->fetchObject( $res ) ) {
+ foreach ( $res as $s ) {
if( $s->page_namespace == NS_MEDIAWIKI ) {
if( $this->foreign ) {
$title = explode( '/', $s->page_title );
$this->mResult->rewind();
- while ( $row = $this->mResult->fetchObject() ) {
+ foreach ( $this->mResult as $row ) {
$batch->addObj( Title::makeTitleSafe( NS_CATEGORY, $row->cat_title ) );
}
$batch->execute();
'page_namespace' => $disPageObj->getNamespace(), 'page_title' => $disPageObj->getDBkey()),
__METHOD__ );
- while ( $row = $dbr->fetchObject( $res ) ) {
+ foreach ( $res as $row ) {
$linkBatch->addObj( Title::makeTitle( NS_TEMPLATE, $row->pl_title ));
}
}
$pages = array();
- while ( $row = $dbr->fetchObject( $res ) ) {
+ foreach ( $res as $row ) {
$n = $row->page_title;
if ($row->page_namespace) {
$ns = $wgContLang->getNsText( $row->page_namespace );
$pages = array();
- while ( $row = $dbr->fetchObject( $res ) ) {
+ foreach ( $res as $row ) {
$n = $row->page_title;
if ( $row->page_namespace ) {
# Faster way
# Usernames and titles are in fact related by a simple substitution of space -> underscore
# The last few lines of Title::secureAndSplit() tell the story.
- while ( $row = $this->mResult->fetchObject() ) {
+ foreach ( $this->mResult as $row ) {
$name = str_replace( ' ', '_', $row->ipb_by_text );
$lb->add( NS_USER, $name );
$lb->add( NS_USER_TALK, $name );
if ( $this->mResult->numRows() ) {
$lb = new LinkBatch;
$this->mResult->seek( 0 );
- while ( $row = $this->mResult->fetchObject() ) {
+ foreach ( $this->mResult as $row ) {
if ( $row->img_user ) {
$lb->add( NS_USER, str_replace( ' ', '_', $row->img_user_text ) );
}
$batch = new LinkBatch();
# Give some pointers to make (last) links
$this->mForm->prevId = array();
- while( $row = $this->mResult->fetchObject() ) {
+ foreach ( $this->mResult as $row ) {
$batch->addObj( Title::makeTitleSafe( NS_USER, $row->rev_user_text ) );
$batch->addObj( Title::makeTitleSafe( NS_USER_TALK, $row->rev_user_text ) );
function preprocessResults( $db, $res ) {
if( $db->numRows( $res ) > 0 ) {
$linkBatch = new LinkBatch();
- while( $row = $db->fetchObject( $res ) )
+ foreach ( $res as $row ) {
$linkBatch->add( $row->namespace, $row->title );
+ }
$db->dataSeek( $res, 0 );
$linkBatch->execute();
}
*/
function preprocessResults( $db, $res ) {
$batch = new LinkBatch;
- while ( $row = $db->fetchObject( $res ) )
+ foreach ( $res as $row ) {
$batch->add( $row->namespace, $row->title );
+ }
$batch->execute();
// Back to start for display
*/
public function preprocessResults( $db, $res ) {
$batch = new LinkBatch();
- while( $row = $db->fetchObject( $res ) ) {
+ foreach ( $res as $row ) {
$batch->add( $row->namespace, $row->title );
}
$batch->execute();
* We have to flip things around to get the last N after a certain date
*/
$images = array();
- while ( $s = $dbr->fetchObject( $res ) ) {
+ foreach ( $res as $s ) {
if( $invertSort ) {
array_unshift( $images, $s );
} else {
function getStartBody() {
# Do a batch existence check on pages
$linkBatch = new LinkBatch();
- while( $row = $this->mResult->fetchObject() ) {
+ foreach ( $this->mResult as $row ) {
$linkBatch->add( NS_USER, $row->rc_user_text );
$linkBatch->add( NS_USER_TALK, $row->rc_user_text );
$linkBatch->add( $row->rc_namespace, $row->rc_title );
function getStartBody() {
# Do a link batch query
$lb = new LinkBatch;
- while( $row = $this->mResult->fetchObject() ) {
+ foreach ( $this->mResult as $row ) {
$lb->add( $row->page_namespace, $row->page_title );
}
$lb->execute();
$this->mResult->seek( 0 );
$lb = new LinkBatch;
- while ( $row = $this->mResult->fetchObject() ) {
+ foreach ( $this->mResult as $row ) {
$lb->add( $row->pt_namespace, $row->pt_title );
}
$text .= Xml::openElement( 'tr' );
$text .= Xml::tags( 'th', array( 'colspan' => '2' ), wfMsgExt( 'statistics-mostpopular', array( 'parseinline' ) ) );
$text .= Xml::closeElement( 'tr' );
- while( $row = $res->fetchObject() ) {
+ foreach ( $res as $row ) {
$title = Title::makeTitleSafe( $row->page_namespace, $row->page_title );
if( $title instanceof Title ) {
$text .= $this->formatRow( $sk->link( $title ),
$dbr = wfGetDB( DB_SLAVE );
$res = $dbr->select( 'change_tag', array( 'ct_tag', 'count(*) as hitcount' ), array(), __METHOD__, array( 'GROUP BY' => 'ct_tag', 'ORDER BY' => 'hitcount DESC' ) );
- while ( $row = $res->fetchObject() ) {
+ foreach ( $res as $row ) {
$html .= $this->doTagRow( $row->ct_tag, $row->hitcount );
}
$sk = $wgUser->getSkin();
$undelete = $this->getTitle();
$wgOut->addHTML( "<ul>\n" );
- while( $row = $result->fetchObject() ) {
+ foreach ( $result as $row ) {
$title = Title::makeTitleSafe( $row->ar_namespace, $row->ar_title );
$link = $sk->linkKnown(
$undelete,
# Batch existence check on user and talk pages
if( $haveRevisions ) {
$batch = new LinkBatch();
- while( $row = $revisions->fetchObject() ) {
+ foreach ( $revisions as $row ) {
$batch->addObj( Title::makeTitleSafe( NS_USER, $row->ar_user_text ) );
$batch->addObj( Title::makeTitleSafe( NS_USER_TALK, $row->ar_user_text ) );
}
}
if( $haveFiles ) {
$batch = new LinkBatch();
- while( $row = $files->fetchObject() ) {
+ foreach ( $files as $row ) {
$batch->addObj( Title::makeTitleSafe( NS_USER, $row->fa_user_text ) );
$batch->addObj( Title::makeTitleSafe( NS_USER_TALK, $row->fa_user_text ) );
}
$remaining = $revisions->numRows();
$earliestLiveTime = $this->mTargetObj->getEarliestRevTime();
- while( $row = $revisions->fetchObject() ) {
+ foreach ( $revisions as $row ) {
$remaining--;
$wgOut->addHTML( $this->formatRevisionRow( $row, $earliestLiveTime, $remaining, $sk ) );
}
if( $haveFiles ) {
$wgOut->addHTML( Xml::element( 'h2', null, wfMsg( 'filehist' ) ) . "\n" );
$wgOut->addHTML( "<ul>" );
- while( $row = $files->fetchObject() ) {
+ foreach ( $files as $row ) {
$wgOut->addHTML( $this->formatFileRow( $row, $sk ) );
}
$files->free();
/* Do link batch query */
$linkBatch = new LinkBatch;
- while ( $row = $dbr->fetchObject( $res ) ) {
+ foreach ( $res as $row ) {
$userNameUnderscored = str_replace( ' ', '_', $row->rc_user_text );
if ( $row->rc_user != 0 ) {
$linkBatch->add( NS_USER, $userNameUnderscored );
$s = $list->beginRecentChangesList();
$counter = 1;
- while ( $obj = $dbr->fetchObject( $res ) ) {
+ foreach ( $res as $obj ) {
# Make RC entry
$rc = RecentChange::newFromRow( $obj );
$rc->counter = $counter++;
// templatelinks comes second so that the templatelinks row overwrites the
// pagelinks row, so we get (inclusion) rather than nothing
if( $fetchlinks ) {
- while ( $row = $dbr->fetchObject( $plRes ) ) {
+ foreach ( $plRes as $row ) {
$row->is_template = 0;
$row->is_image = 0;
$rows[$row->page_id] = $row;
}
}
if( !$hidetrans ) {
- while ( $row = $dbr->fetchObject( $tlRes ) ) {
+ foreach ( $tlRes as $row ) {
$row->is_template = 1;
$row->is_image = 0;
$rows[$row->page_id] = $row;
}
}
if( !$hideimages ) {
- while ( $row = $dbr->fetchObject( $ilRes ) ) {
+ foreach ( $ilRes as $row ) {
$row->is_template = 0;
$row->is_image = 1;
$rows[$row->page_id] = $row;