<html>
<head>
<meta http-equiv="Content-Type" CONTENT="text/html; charset=EUC-JP">
<?php
include("krt.php3");
require("rbbs.ini");
echo "<body bgcolor=\"$ini_bodycolor\">";
?>
<center>
<img src="../image/subtitle_talk.jpg" width="250" height="86" vspace="10" alt="子育てトーク">
<br>

子育てに関する気になるテーマについて、話し合いましょう。<br>
新しいテーマの提案は<a href="mailto:webmaster@verybaby.net">メール</a>か<a href="../nandemo/index.php3">なんでも談話室</a>で受け付けています。
<p><a href="../tyuui.htm">◆掲示板の使い方</a></p>
</center>
<?php
if(!$offset)$offset = 0;
$nextoffset = $offset + $ini_titlerows;
$prevoffset = $offset - $ini_titlerows;
if($prevoffset < 0) $prevoffset = 0;

$connection = @pg_connect("","",$ini_dbname);

// total rows
$sql = "select count(*) from $ini_topic_table";
$result = @pg_exec($sql);
$total_rows = @pg_result($result,0,0);
@pg_freeresult($result);

$sql = "select topic_id,title,last_replied from $ini_topic_table order by last_replied desc limit $ini_titlerows offset $offset";
$result = @pg_exec($sql);
if($result == false) {
	@pg_close($connection);
	echo "タイトルの検索に失敗しました。code=-1";
	exit;
}
$rows = @pg_numrows($result);
echo "<center>";
echo "<p><font size=-1>";
if($offset!=0)echo "<a href=\"index.php3?offset=$prevoffset\">[前のページを表示]</a> &nbsp;";
if($nextoffset <= $total_rows) echo "<a href=\"index.php3?offset=$nextoffset\">[次のページを表示]</a></font></p>";if($rows == 0) {
	echo "<center><p>これ以上テーマはありません。</p></center>";
}

echo "<table>";
for($i = 0; $i < $rows; $i++) {
	$id = pg_result($result,$i,"topic_id");
	$title = pg_result($result,$i,"title");
	$modified = pg_result($result,$i,"last_replied");
	echo "<tr><td valign=\"top\">●</td><td valign=\"top\" width=300><a href=\"rbbsmessage.php3?id=$id\"><font size=+2><b>$title</b></font></a></td></tr><tr><td></td><td><font size=-1>(updated:$modified)</font></td><tr>";
}
echo "</table>";
echo "<p><font size=-1>";
if($offset != 0)echo "<a href=\"index.php3?offset=$prevoffset\">[前のページを表示]</a> &nbsp;";
if($nextoffset <= $total_rows)echo "<a href=\"index.php3?offset=$nextoffset\">[次のページを表示]</a></font></p>";
echo "</center>";
@pg_freeresult($result);
@pg_close($connection);
?>
<center>
<a href="<?php echo $ini_sitehome; ?>" target="_top"><img src="../image/bottan_home.jpg" width="40" height="40" border="0" alt="ホームページ" align="absmiddle"></a>
</center>
</body>
</html>
