<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>查记录</title>
</head>
<body>
<?php

if (!is_numeric($_GET['id'])) {
  die('ID参数错误！</body></html>');
}
if ($_GET['seek'] != 'pre' && $_GET['seek'] != 'next') {
  die('SEEK参数错误！</body></html>');
}
if ($_GET['seek'] == 'pre') {
  $a = 'id<'.$_GET['id'].'';
  $b = '前面';
} else {
  $a = 'id>'.$_GET['id'].'';
  $b = '后面';
}

@ require ('inc/set/set.php');
@ require ('inc/set/set_sql.php');
if (!isset($sql['db_err'])) {
  db_conn();
}
if ($sql['db_err'] == '') {
  $result = @mysql_query('SELECT id FROM '.$sql['pref'].''.$sql['data']['承载主题文章的表名'].' WHERE '.$a.' AND area_id=(SELECT area_id FROM '.$sql['pref'].''.$sql['data']['承载主题文章的表名'].' WHERE id="'.$_GET['id'].'") AND area_check="" LIMIT 1', $db);
  if ($row = @mysql_fetch_assoc($result)) {
    $sitemode = (!empty($_GET['mode']) && file_exists('inc/css/'.$_GET['mode'].'/article.php')) ? $_GET['mode'] : $web['sitemode'];
    $article_url = $web['url_html_article'] == 1 ? 'article.'.$sitemode.'.'.$row['id'].'.1.html' : 'article.php?mode='.$sitemode.'&id='.$row['id'].'';
    echo '<script> location.href="'.$article_url.'"; </script>';
  } else {
    echo '本分类'.$b.'没有记录了！<a href="javascript:window.history.back()">返回</a>';
  }
  @mysql_free_result($result);
} else {
  echo $sql['db_err'];
}
@mysql_close();

?>
</body>
</html>
