function fisheye_expunge_user($pObject) { global $gBitDb; if (!empty($pObject->mUserId)) { $query = "SELECT fg.`content_id` FROM `" . BIT_DB_PREFIX . "fisheye_gallery` fg INNER JOIN `" . BIT_DB_PREFIX . "liberty_content` lc ON(fg.`content_id`=lc.`content_id`) WHERE lc.`user_id`=?"; if ($galleries = $gBitDb->getCol($query, array($pObject->mUserId))) { foreach ($galleries as $contentId) { $delGallery = new FisheyeGallery(NULL, $contentId); if ($delGallery->load()) { $delGallery->expunge(TRUE); } } } } }