function tbxVideoDelete() { $DB = GetDB(); $username = AuthenticateUser::GetUsername(); $video = $DB->Row('SELECT * FROM `tbx_video` WHERE `username`=? AND `video_id`=?', array($username, $_REQUEST['video_id'])); if (!empty($video)) { DeleteVideo($video); } }
function tbxUserDelete($user) { $DB = GetDB(); $DB->Update('DELETE FROM `tbx_user` WHERE `username`=?', array($user['username'])); $DB->Update('DELETE FROM `tbx_user_stat` WHERE `username`=?', array($user['username'])); $DB->Update('DELETE FROM `tbx_user_custom` WHERE `username`=?', array($user['username'])); $DB->Update('DELETE FROM `tbx_user_favorite` WHERE `username`=?', array($user['username'])); $DB->Update('DELETE FROM `tbx_user_session` WHERE `username`=?', array($user['username'])); if (!empty($user['avatar_id'])) { Uploads::RemoveExisting($user['avatar_id']); } // Delete all of the user's videos $result = $DB->Query('SELECT * FROM `tbx_video` WHERE `username`=?', array($user['username'])); while ($video = $DB->NextRow($result)) { DeleteVideo($video); } $DB->Free($result); return true; }