$counter = 0;
global $user;
while(!$response) {
$query = db_query("SELECT node.nid AS nid,
users.name AS users_name,
users.uid AS users_uid,
node.title AS node_title,
node_revisions.body AS node_revisions_body,
node_revisions.format AS node_revisions_format,
node.created AS node_created
FROM node node
LEFT JOIN history history_user ON node.nid = history_user.nid AND history_user.uid = %d
LEFT JOIN node_comment_statistics node_comment_statistics ON node.nid = node_comment_statistics.nid
LEFT JOIN og_ancestry og_ancestry ON node.nid = og_ancestry.nid
INNER JOIN users users ON node.uid = users.uid
LEFT JOIN node_revisions node_revisions ON node.vid = node_revisions.vid
WHERE (node.type in ('chat'))
AND ((history_user.timestamp IS NULL
AND (node.changed > (%d - 2592001)
OR node_comment_statistics.last_comment_timestamp > (%d - 2592001)))
OR history_user.timestamp < node.changed
OR history_user.timestamp < node_comment_statistics.last_comment_timestamp)
AND (og_ancestry.group_nid = %d) ORDER BY node_created DESC", $user->uid, time(), time(), $args[0]);
$resultcounter = 0;
while ($result = db_fetch_object($query)) {
$response->chat[] = $result;
node_tag_new($result->nid);
$resultcounter++;
}
$query = db_query("SELECT node.nid AS nid,
users.name AS users_name,
node.title AS node_title,
node_revisions.body AS node_revisions_body,
node_revisions.format AS node_revisions_format,
node.created AS node_created
FROM node node
LEFT JOIN history history_user ON node.nid = history_user.nid AND history_user.uid = %d
LEFT JOIN node_comment_statistics node_comment_statistics ON node.nid = node_comment_statistics.nid
LEFT JOIN og_ancestry og_ancestry ON node.nid = og_ancestry.nid
INNER JOIN users users ON node.uid = users.uid
LEFT JOIN node_revisions node_revisions ON node.vid = node_revisions.vid
WHERE (node.type in ('command'))
AND ((history_user.timestamp IS NULL
AND (node.changed > (%d - 2592001)
OR node_comment_statistics.last_comment_timestamp > (%d - 2592001)))
OR history_user.timestamp < node.changed
OR history_user.timestamp < node_comment_statistics.last_comment_timestamp)
AND (og_ancestry.group_nid = %d) ORDER BY node_created DESC", $user->uid, time(), time(), $args[0]);
$resultcounter = 0;
while ($result = db_fetch_object($query)) {
$response->command[] = $result;
node_tag_new($result->nid);
$resultcounter++;
}
$query = db_query("SELECT node.nid AS nid,
users.name AS users_name,
node.title AS node_title,
node_revisions.body AS node_revisions_body,
node_revisions.format AS node_revisions_format,
node_data_field_author.field_author_value AS node_data_field_author_field_author_value,
node_data_field_author.nid AS node_data_field_author_nid,
node.type AS node_type,
node_data_field_author.field_dots_value AS node_data_field_author_field_dots_value,
node_data_field_author.field_type_value AS node_data_field_author_field_type_value,
node_data_field_author.field_xpos_value AS node_data_field_author_field_xpos_value,
node_data_field_author.field_ypos_value AS node_data_field_author_field_ypos_value,
node_data_field_author.field_deleted_value AS node_data_field_author_field_deleted_value,
node_data_field_author.field_cluster_value AS node_data_field_author_field_cluster_value,
node.created AS node_created
FROM node node
LEFT JOIN history history_user ON node.nid = history_user.nid AND history_user.uid = %d
LEFT JOIN node_comment_statistics node_comment_statistics ON node.nid = node_comment_statistics.nid
LEFT JOIN og_ancestry og_ancestry ON node.nid = og_ancestry.nid
INNER JOIN users users ON node.uid = users.uid
LEFT JOIN node_revisions node_revisions ON node.vid = node_revisions.vid
LEFT JOIN content_type_memo node_data_field_author ON node.vid = node_data_field_author.vid
WHERE (node.type in ('memo'))
AND ((history_user.timestamp IS NULL
AND (node.changed > (%d - 2592001)
OR node_comment_statistics.last_comment_timestamp > (%d - 2592001)))
OR history_user.timestamp < node.changed
OR history_user.timestamp < node_comment_statistics.last_comment_timestamp)
AND (og_ancestry.group_nid = %d) ORDER BY node_created DESC", $user->uid, time(), time(), $args[0]);
$resultcounter = 0;
while ($result = db_fetch_object($query)) {
$response->memo[] = $result;
node_tag_new($result->nid);
$resultcounter++;
}
$counter++;
if ($counter > 20) {
return array();
}
sleep(1);
}
if ($response) {
return $response;
}