- Patch #394616 by csevb10: converted to new database abstraction layer.

merge-requests/26/head
Dries Buytaert 2009-03-14 16:27:58 +00:00
parent 1811d659f2
commit 78027e1a1a
1 changed files with 9 additions and 4 deletions

View File

@ -2529,12 +2529,17 @@ function form_clean_id($id = NULL, $flush = FALSE) {
* if (empty($context['sandbox'])) {
* $context['sandbox']['progress'] = 0;
* $context['sandbox']['current_node'] = 0;
* $context['sandbox']['max'] = db_result(db_query('SELECT COUNT(DISTINCT nid) FROM {node}'));
* $context['sandbox']['max'] = db_query('SELECT COUNT(DISTINCT nid) FROM {node}')->fetchField();
* }
* $limit = 5;
* $result = db_query_range("SELECT nid FROM {node} WHERE nid > %d ORDER BY nid ASC", $context['sandbox']['current_node'], 0, $limit);
* while ($row = db_fetch_array($result)) {
* $node = node_load($row['nid'], NULL, TRUE);
* $result = db_select('node')
* ->fields('node', array('nid'))
* ->condition('nid', $context['sandbox']['current_node'], '>')
* ->orderBy('nid')
* ->range(0, $limit)
* ->execute();
* foreach ($result as $row) {
* $node = node_load($row->nid, NULL, TRUE);
* $context['results'][] = $node->nid . ' : ' . $node->title;
* $context['sandbox']['progress']++;
* $context['sandbox']['current_node'] = $node->nid;