Imitating Oso forums (2)
Last Update:2018-12-08
Source: Internet
Author: User
Read. php (used to display related topic content)
<HTML> <Link href = "mypic/style.css" rel = stylesheet type = text/CSS> <Body bgcolor = # cccc99 bottommargin = 0 leftmargin = 0 topmargin = 0 marginwidth = "0" marginheight = "0">
<Table border = 0 cellpadding = 0 cellspacing = 0 width = "100%" class = body_br>
<Tbody>
<Tr>
<TD valign = top> <br>
<Table align = center border = 0 cellpadding = 3 cellspacing = 0 width = 100%>
<Tbody>
<TD> subject: <font class = mid
Color = #993333> <B>
<? PHP
Include "Connect. Inc. php ";
$ Query = "select * From guestbook where id =". $ theme_id;
$ Res = mysql_query ($ query );
$ ROW = mysql_fetch_array ($ res );
Echo $ row ['Theme '];
?>
</B> </font> </TD> </tr> <tr>
<TD align = middle valign = top width = 100%> <
Href = "post. php"> Border = 0 src = "mypic/post.gif"> </a>
<A href = "reply. php? Theme_id = <? PHP echo $ row ['id']?> "> Border = 0
Src = "mypic/reply.gif"> </a> <
Href = "FAQ. php? Page = 1 "> Border = 0
Src = "mypic/theme.gif"> </a> </TD> </tr>
<? PHP
If ($ row ['answer _ count']> 5)
{Echo "<tr> <TD> page: <font class = mid> ";
For ($ j = 1; $ j <= ($ row ['answer _ count']-1)/5 + 1; $ J ++ ){
If ($ J = $ page) echo "<font color = #999999> [". $ J. "] </font> </a> ";
Else echo "<a href = 'read. php? Theme_id = ". $ row ['id']. "& page = ". $ J. "'[". $ J. "] </font> </a> ";
}}
Echo "A total of posts". $ row ['answer _ count']. "</TD> ";
$ This_id = $ row ['id'];
$ Query = "select ID from guestbook where ID <". $ this_id. "And type = 1 order by id desc ";
$ Res = mysql_query ($ query );
$ ROW = mysql_fetch_row ($ res );
$ Pre_id = $ row [0];
$ Query = "select ID from guestbook where ID>". $ this_id. "And type = 1 order by ID ";
$ Res = mysql_query ($ query );
$ ROW = mysql_fetch_row ($ res );
$ Next_id = $ row [0];
?>
</Tr>
</Tbody> </table>
<Table align = center border = 0 cellpadding = 4 cellspacing = 2 width = 100%>
<Tbody>
<Tr>
<TD align = middle bgcolor = # 6f6f6f width = "20%"> <font color = # ffffff>
</Font> </TD>
<TD align = middle bgcolor = # 6f6f6f width = "80%"> <font color = # ffffff>
Capacity </font> </TD> </tr>
<? PHP
$ Query = "select * From guestbook where main_id = ". $ theme_id. "Or Id = ". $ theme_id. "Order by time_open DESC limit ". strval ($ page-1) * 5 ). ", 5 ";
$ Res = mysql_query ($ query );
Function tdbackcolor (){
Static $ colorstr;
If ($ colorstr = "# ededed "){
$ Colorstr = "# dedede ";
} Else {
$ Colorstr = "# ededed ";
}
Return ($ colorstr );
}
For ($ I = 1; $ I <= 5; $ I ++)
{$ ROW = @ mysql_fetch_array ($ res );
If (! $ Row) break;
$ Colorstr = tdbackcolor ();
Echo "<tr> ";
Echo "<TD align = middle bgcolor =". $ colorstr. "valign = top width = '000000'> <font ";
Echo "class = mid> <B> ";
Echo $ row ['name']. "</B> </font> </TD> ";
Echo "<TD bgcolor =". $ colorstr. "valign = top width = '000000'> ";
Echo "<Table border = 0 cellpadding = 0 cellspacing = 0 width = '000000'> ";
Echo "<tbody> ";
Echo "<tr> ";
Echo "<TD align = middle width = 30> Echo "src = 'mypic/icon". $ row ['icon ']. ". gif'> </TD> ";
Echo "<TD> <font color = #336699> published in:". $ row ['time _ open']. "</font> </TD> ";
Echo "<TD align = right> </TD> </tr> ";
Echo "<tr> ";
Echo "<TD colspan = 3> ";
Echo "<HR size = 1> ";
Echo "</TD> </tr> </tbody> </table>". $ row ['content']. "</TD> </tr> ";
Echo "<tr> ";
}
?>
<Tr align = right bgcolor = # 6f6f6f>
<TD> </TD>
<TD> <
Href = "read. php? Theme_id = <? PHP echo $ pre_id?> & Page = 1 "> <font
Color = # ffffff> previous topic </font> </a> <
Href = "read. php? Theme_id = <? PHP echo $ next_id?> & Page = 1 "> <font
Color = # ffffff> next topic </font> </a> </TD> </tr> </tbody> </table>
& Lt; HR size = 1 width = 100% & gt;
<Br> </TD> </tr>
</Tbody> </table>
</Form>
</Html>