<?php
session_start()
;
if($_SESSION['l
ogged_in'] ==
1) {
include("i
nclude/db.php&q
uot

;
?>
<link
rel="style
sheet"
title="sty
le sheet"
href="temp
late/skin_1/sty
le.css">
;
<?
include("t
emplate/skin_1/
header.php"

;
echo
'<center>
<table
width="100
%">';
echo
'<BR><
table
class="row
1"
width="900
"><t
r><td
width="900
"
align="cen
ter">FO
RUM</td>&
lt;/tr></
table>';
$infogetlast =
mysql_query(&qu
ot;SELECT
MAX(`category_i
d`) FROM
`CATEGORIES`
ORDER BY
category_id
"

;
if(!$infogetlas
t)
die(mysql_error
());
while($infogetl
ast2 =
mysql_fetch_arr
ay($infogetlast
)) {
$gotlastorder
=
$infogetlast2[0
] + 1;
}
$order = 1;
while($order
> 0
&&
$order <
$gotlastorder)
{
$category_info
=
mysql_query(&qu
ot;SELECT *
FROM
`CATEGORIES`
WHERE
`category_id` =
'".$order.
"' ORDER
BY category_id
"

;
if(!$category_i
nfo)
die(mysql_error
());
while($category
_info2 =
mysql_fetch_obj
ect($category_i
nfo)) {
$category_name
=
$category_info2
->category_n
ame;
}
echo
'<BR><
table
class="row
2"
width="900
"
><tr>&
lt;td
class="row
2"
width="450
"
align="cen
ter">'
.$category_name
.
'</td><
;td
class="row
2"
width="75&
quot;
align="cen
ter">TO
PICS</td>
<td
class="row
2"
width="75&
quot;
align="cen
ter">PO
STS</td>&
lt;td
class="row
2"
width="300
"
align="cen
ter">LA
ST
POSTER</td&g
t;</tr>&l
t;/table>';<
br />
$inf =
"SELECT *
FROM
`CATEGORIES`
WHERE
`category_id` =
'".$order.
"' AND
`category_userl
evel` <=
'".$userle
vel."'
ORDER BY
sect_id ASC
";
$info =
mysql_query($in
f);
if(!$info)
die(mysql_error
());
$info_rows =
mysql_num_rows(
$info);
if($info_rows
> 0) {
while($info2 =
mysql_fetch_obj
ect($info)) {
$infolast =
mysql_query(&qu
ot;SELECT *
FROM `TOPICS`
WHERE `sect_id`
=
'".$info2-
>sect_id.&qu
ot;' ORDER BY
id ASC
"

;
if(!$infolast)
die(mysql_error
());
$infototalposte
r2 =
mysql_num_rows(
$infolast);
while($infolast
2 =
mysql_fetch_obj
ect($infolast))
{
$lastposter =
$infolast2->
username;
$lastposter_tim
e =
$infolast2->
time;
$lastposter_dat
e =
$infolast2->
date;
$lastposter_top
ic_id =
$infolast2->
topic_id;
$lastposter_sec
t_id =
$infolast2->
sect_id;
$lastposter_top
ic_subject =
$infolast2->
topic_subject;<
br />
}
$infolast3 =
mysql_query(&qu
ot;SELECT *
FROM `TOPICS`
WHERE
`article_id` =
'1' AND
`sect_id` =
'".$info2-
>sect_id.&qu
ot;' ORDER BY
id ASC
"

;
if(!$infolast3)
die(mysql_error
());
$total_topics =
mysql_num_rows(
$infolast3);
$info_user_id =
mysql_query(&qu
ot;SELECT
`user_id` FROM
`USERS` WHERE
`username` =
'".$lastpo
ster."'
"

;
if(!$info_user_
id )
die(mysql_error
());
while($info_us
er_id2 =
mysql_fetch_obj
ect($info_user_
id )) {
$profile_id =
$info_user_id2-
>user_id;
}
include("i
nclude/users_lo
oks.php"
;
echo
'<table
class="row
3"
width="900
"
><tr>&
lt;td
class="row
3"
width="450
">';
echo '<a
href="topi
cs.php?si='.$in
fo2->sect_id
.'">'
.$info2->sec
tion_title.
'</a>';
echo
'<BR>';
echo
$info2->sect
ion_about;
echo
'<BR>';
echo
'</td>';<
br />
echo
'<td
class="row
3"
width="75&
quot;
align="cen
ter">'.
$total_topics.'
</td><
td
class="row
3"
width="75&
quot;
align="cen
ter">'.
$infototalposte
r2.'</td>
';
echo
'<td
class="row
3"
width="300
"
align="lef
t">TOPI
C: <a
href="post
s.php?si='.$las
tposter_sect_id
.'&to='.$la
stposter_topic_
id.'">'
.$lastposter_to
pic_subject.'&l
t;/a>
<BR>BY:&l
t;a
href="user
info.php?u='.$p
rofile_id.'&quo
t;
>'.$output_u
sername.'</a
>
<BR>DATE:
'.date('h:i:s
a',
$lastposter_tim
e).' on
'.$lastposter_d
ate.'
</td>'
;
echo
'</tr><
;/table>';
} } //end
forum while
repeat
$order = $order
+ 1;
echo
'</table>
';
}
echo
'<BR>';
include("i
nclude/user_onl
ine.php"
} else {
header("Lo
cation:
login.php"<
img
src=http://www.
allsyntax.com/f
orums/images/sm
ilies/wink.gif
border=0>;
}
?>