} else { require_once INC_DIR . 'functions_atom.php'; if (update_forum_feed($id, $forum_data)) { redirect($bb_cfg['atom']['url'] . '/f/' . $id . '.atom'); } else { bb_simple_die($lang['ATOM_NO_FORUM']); } } } if ($type == 'u') { // Check if the user has actually sent a user ID if ($id < 1) { bb_simple_die($lang['ATOM_ERROR'] . ' #2'); } if (!($username = get_username($id))) { bb_simple_die($lang['ATOM_ERROR'] . ' #3'); } if (file_exists($bb_cfg['atom']['path'] . '/u/' . floor($id / 5000) . '/' . $id % 100 . '/' . $id . '.atom') && filemtime($bb_cfg['atom']['path'] . '/u/' . floor($id / 5000) . '/' . $id % 100 . '/' . $id . '.atom') > $timecheck) { redirect($bb_cfg['atom']['url'] . '/u/' . floor($id / 5000) . '/' . $id % 100 . '/' . $id . '.atom'); } else { require_once INC_DIR . 'functions_atom.php'; if (update_user_feed($id, $username)) { redirect($bb_cfg['atom']['url'] . '/u/' . floor($id / 5000) . '/' . $id % 100 . '/' . $id . '.atom'); } else { bb_simple_die($lang['ATOM_NO_USER']); } } } } else { bb_simple_die($lang['ATOM_ERROR'] . ' #4'); }
function update_atom($type, $id) { require_once INC_DIR . 'functions_atom.php'; switch ($type) { case 'user': update_user_feed($id, get_username($id)); break; case 'topic': $topic_poster = (int) DB()->fetch_row("SELECT topic_poster FROM " . BB_TOPICS . " WHERE topic_id = {$id} LIMIT 1", 'topic_poster'); update_user_feed($topic_poster, get_username($topic_poster)); break; } }