<?php
# Copyright by Manuel
# Support www.ilch.de
defined (
'main'
)
or
die
(
'no direct access'
);
$anzahl
= 10;
$title
=
$allgAr
[
'title'
].
' :: Neueste Foreneinträge'
;
$hmenu
=
'Neueste Foreneinträge'
;
$design
=
new
design (
$title
,
$hmenu
);
$design
->header();
$query
= "SELECT a.id, a.name, a.rep, c.erst
as
last, c.id
as
pid, c.time
FROM xic_topics a
LEFT JOIN xic_forums b ON b.id = a.fid
LEFT JOIN xic_posts c ON c.id = a.last_post_id
LEFT JOIN xic_groupusers vg ON vg.uid =
".$_SESSION['authid']."
AND vg.gid = b.view
LEFT JOIN xic_groupusers rg ON rg.uid =
".$_SESSION['authid']."
AND rg.gid = b.reply
LEFT JOIN xic_groupusers sg ON sg.uid =
".$_SESSION['authid']."
AND sg.gid = b.start
WHERE ((
".$_SESSION['authright']."
<= b.view AND b.view < 1)
OR (
".$_SESSION['authright']."
<= b.reply AND b.reply < 1)
OR (
".$_SESSION['authright']."
<= b.start AND b.start < 1)
OR vg.fid IS NOT NULL
OR rg.fid IS NOT NULL
OR sg.fid IS NOT NULL
OR -9 >=
".$_SESSION['authright']."
)
ORDER BY c.time DESC
LIMIT 0,
'$anzahl'
";
$nr
= 1;
echo
'<table width="100%" class="border" cellpadding="0" cellspacing="0">'
;
$resultID
= db_query(
$query
);
$class
=
"Cmite"
;
while
(
$row
= db_fetch_assoc(
$resultID
)) {
if
(
$class
==
"Cmite"
) {
$class
=
"Cnorm"
; }
else
{
$class
=
"Cmite"
; }
$row
[
'date'
] =
date
(
'd.m.y - H:i'
,
$row
[
'time'
]);
$row
[
'page'
] =
ceil
( (
$row
[
'rep'
]+1) /
$allgAr
[
'Fpanz'
] );
echo
'<tr class="'
.
$class
.
'"><td valign="top" align="center"><b>'
.
$nr
.
'</b></td><td><a href="?forum-showposts-'
.
$row
[
'id'
].
'-p'
.
$row
[
'page'
].
'#'
.
$row
[
'pid'
].
'" title="'
.
$row
[
'date'
].
'">'
.((
strlen
(
$row
[
'name'
])<18) ?
$row
[
'name'
] :
substr
(
$row
[
'name'
],0,15).
'...'
).
'<br /><span class="smalfont"> von '
.
$row
[
'last'
].
'</span></a></td></tr>'
;
$nr
++;
}
echo
'</table>'
;
$design
->footer();
?>