| 1 |
<?php |
<?php |
| 2 |
/* $Id: aggregator2.module,v 1.39 2006/07/19 17:44:37 ahwayakchih Exp $ */ |
/* $Id: aggregator2.module,v 1.40 2006/07/19 17:49:03 ahwayakchih Exp $ */ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 1873 |
// TODO: maybe select just those which will not be deleted? so update at the end of this funtion would have less nodes to update :) |
// TODO: maybe select just those which will not be deleted? so update at the end of this funtion would have less nodes to update :) |
| 1874 |
$promote_items = $feed->promoted_items; |
$promote_items = $feed->promoted_items; |
| 1875 |
$promoted = array(); |
$promoted = array(); |
| 1876 |
if ($promote_items != 1000000000) { |
if ($promote_items != 1000000000 && $promote_items != 0) { |
| 1877 |
$result = db_query('SELECT ai.nid AS nid FROM {node} n, {aggregator2_item} ai WHERE ai.fid = %d AND ai.nid = n.nid AND n.status = 1 ORDER BY n.created ASC', $feed->nid); |
$result = db_query('SELECT ai.nid AS nid FROM {node} n, {aggregator2_item} ai WHERE ai.fid = %d AND ai.nid = n.nid AND n.status = 1 ORDER BY n.created ASC', $feed->nid); |
| 1878 |
while ($temp = db_fetch_array($result)) { |
while ($temp = db_fetch_array($result)) { |
| 1879 |
$promoted[] = $temp['nid']; |
$promoted[] = $temp['nid']; |
| 2189 |
} |
} |
| 2190 |
|
|
| 2191 |
// Now un-promote older items |
// Now un-promote older items |
| 2192 |
if ($promote_items != 1000000000) { |
if ($promote_items != 1000000000 && $promote_items != 0) { |
| 2193 |
$temp = array(); |
$temp = array(); |
| 2194 |
while (count($promoted) > $promote_items) { |
while (count($promoted) > $promote_items) { |
| 2195 |
$temp[] = array_shift($promoted); |
$temp[] = array_shift($promoted); |