$reps = ceil($data['thread_replies'] / $threads_per_page); $data2 = dbarray(dbquery("SELECT post_id FROM ".$db_prefix."posts WHERE thread_id='".$data['thread_id']."' ORDER BY post_id DESC LIMIT 1")); $rstart = ($reply_count > 20 ? "rowstart=".((ceil($reply_count / 20)-1)*20)."&" : ""); $threadsubject = "".$data['thread_subject']."";