<?php
global $db;
if(!undodelete_check_table('threads')&&!undodelete_check_table('threadsubscriptions'))
{
$query=$db->simple_select('threads','*','tid='.$tid);
$result=$db->fetch_array($query);
array_walk($result,'undodelete_clean_query');
$db->insert_query(BACKUPTABLE_PREFIX.'threads',$result);
$query=$db->simple_select('threadsubscriptions','*','tid='.$tid);
while($subscription=$db->fetch_array($query))
{
array_walk($subscription,'undodelete_clean_query');
$db->insert_query(BACKUPTABLE_PREFIX.'threadsubscriptions',$subscription);
}
}
$query=$db->simple_select('posts','pid','tid='.$tid);
while($post=$db->fetch_array($query))
{
undodelete_backup_post($post['pid']);
}
$poll=$db->fetch_array($query=$db->simple_select('polls','pid','tid='.$tid));
undodelete_backup_poll($poll['pid']);