if ($action == "threads") {
if(!$start) {
$start = 0;
mysql_query("DELETE FROM $PW"."threads");
mysql_query("DELETE FROM $PW"."posts");
mysql_query("DELETE FROM $PW"."attachs");
mysql_query("DELETE FROM $PW"."tmsgs");
mysql_query("DELETE FROM $PW"."polls");
}
$end = $start + $percount;
$goon = 0;
$query = mysql_query("SELECT * FROM $tablepre"."ltxx where ltbh=23 LIMIT $start, $percount");
while($threads = mysql_fetch_array($query)) {
if($threads[bh]>0){
$result=mysql_query("INSERT INTO $PW"."threads(tid,fid,author,authorid,subject,ifcheck,postdate,lastpost,lastposter,hits,replies,topped,digest,pollid,ifupload)
VALUES ('', '2', 1, '', '$threads[hyzh]', 1712, '$threads[ftzt]', '', 0, 1, 0, 1150853609, 1150853609, '$threads[yhzh]', 3, 0, 0, 0, 0, 0, 0, 0, 0)");
mysql_query("INSERT INTO $PW"."tmsgs VALUES ('', '', '', 1, '', '', '', 1, '$threads[ftnr]', '', '', '')");
}
$goon++;
}
if($goon==$percount){
redirect("$basename?action=threads&start=$end");
} else {
redirect("$basename?action=post");
}
}