fetchRow($db->select('cid', 'title', 'slug', 'created')
->from('table.contents')
->where('created < ?', $this->created) // 比当前文章更早
->where('type = ?', 'post') // 只查询文章,排除页面
->where('status = ?', 'publish') // 只查询已发布的
->order('created', Typecho_Db::SORT_DESC) // 按时间降序(最近的上一篇)
->limit(1));
if ($prev):
// 生成正确链接(兼容伪静态和自定义固定链接)
$prevUrl = Typecho_Router::url('post', $prev, $this->options->index);
?>
fetchRow($db->select('cid', 'title', 'slug', 'created')
->from('table.contents')
->where('created > ?', $this->created) // 比当前文章更新
->where('type = ?', 'post') // 只查询文章,排除页面
->where('status = ?', 'publish') // 只查询已发布的
->order('created', Typecho_Db::SORT_ASC) // 按时间升序(最早的下一条)
->limit(1));
if ($next):
// 生成正确链接(兼容伪静态和自定义固定链接)
$nextUrl = Typecho_Router::url('post', $next, $this->options->index);
?>