function fof_db_delete_user($username) { global $FOF_USER_TABLE, $FOF_ITEM_TAG_TABLE, $FOF_SUBSCRIPTION_TABLE; $user_id = fof_db_get_user_id($username); fof_safe_query("delete from {$FOF_SUBSCRIPTION_TABLE} where user_id = %d", $user_id); fof_safe_query("delete from {$FOF_ITEM_TAG_TABLE} where user_id = %d", $user_id); fof_safe_query("delete from {$FOF_USER_TABLE} where user_id = %d", $user_id); }
<?php $fof_no_login = 1; require "fof-main.php"; if (defined('FOF_AUTH_EXTERNAL') && !empty($_SERVER['REMOTE_USER'])) { $unread = fof_db_tag_count(fof_db_get_user_id($_SERVER['REMOTE_USER']), 'unread'); } else { if (isset($_COOKIE['user_name']) && isset($_COOKIE['user_password_hash'])) { if (fof_authenticate($_COOKIE['user_name'], $_COOKIE['user_password_hash'])) { $unread = fof_db_tag_count(fof_current_user(), 'unread'); } } } echo 'Feed on Feeds' . ($unread ? " ({$unread})" : ''); ?>
function fof_db_delete_user($username) { global $FOF_USER_TABLE, $FOF_ITEM_TAG_TABLE, $FOF_SUBSCRIPTION_TABLE; global $fof_connection; fof_trace(); $user_id = fof_db_get_user_id($username); $tables = array($FOF_SUBSCRIPTION_TABLE, $FOF_ITEM_TAG_TABLE, $FOF_USER_TABLE); foreach ($tables as $table) { $query = "DELETE FROM {$table} WHERE user_id = :user_id"; $statement = $fof_connection->prepare($query); $statement->bindValue(':user_id', $user_id); $result = $statement->execute(); $statement->closeCursor(); } }