fix subscriptions

recipient_uid); $isMember = false; while ($row2 = db_fetch_object($userresult)) { if ($row2->rid > 2) $isMember = true; } if (!$isMember) { echo "delete for member ".$row->recipient_uid."
"; db_query("delete from subscriptions where recipient_uid=%d",$row->recipient_uid); db_query("delete from subscriptions_queue where uid=%d",$row->recipient_uid); } else { switch($row->field) { case 'nid': $nid = $row->value; $node = node_load($nid); if (!$node || !$node->nid) {//bad sub echo 'Delete bad sub for nid '.$nid.'
'; db_query("delete from subscriptions where sid=%d",$row->sid); db_query("delete from subscriptions_queue where uid=%d and value=%d",$row->recipient_uid,$row->value); } else { //fix queue $queueresult = db_query("select * from subscriptions_queue where uid=%d AND field=%d AND value = %d ORDER BY last_sent desc",$row->recipient_uid,$row->field,$row->value); $count = 0; while ($row3=db_fetch_object($queueresult)) { if ($count > 0) {db_query("delete from subscriptions_queue where sqid=%d",$row3->sqid);echo "delete duplicate on ".$count." for ".$row3->sqid."
";} $count=$count+1; } } break; case 'tid': $type = $row->value; break; case 'type': break; }//switch }//else } ?>