Hallo
Bin soeben damit fertig geworden
include/contents/forum/useractivity.php
<?php
# Copyright by: Manuel
# Support: www.ilch.de
# Modul by OloX
# www.dms-gaming.com +++ mairu.ilch.net
defined ('main') or die ( 'no direct access' );
$q = db_query("SELECT DISTINCT DATE_FORMAT( FROM_UNIXTIME(`time`), '%Y-%m' ) AS `date`
FROM `prefix_posts`
ORDER BY `time` ASC");
$dAr = array();
while($r = db_fetch_assoc($q)) {
$dAr[] = $r['date'];
}
if( count($dAr) > 0 ) {
switch ($menu->get(2)) {
default:
$title = $allgAr['title'].' :: Forum :: Benutzeraktivität';
$hmenu = $extented_forum_menu.'<a class="smalfont" href="index.php?forum">Forum</a> » Benutzeraktivität';
$design = new design ( $title , $hmenu );
$design->header();
$tpl = new tpl ('forum/useractivity');
$i = 0;
$yearAk = '';
foreach($dAr as $year){
$ex = explode("-",$year);
if ($ex[0] != $yearAk ) {
$yearAk = $ex[0];
$tpl->set_out('date', $yearAk,0);
foreach($dAr as $yearmon){
$m = explode("-",$yearmon);
if ($m[0] == $yearAk ) {
$class = $i % 2 == 0 ? 'Cnorm' : 'Cmite';
$i++;
$x = (substr($m[1],0,1) == "0" ? substr($m[1],1,2) : $m[1]);
$ar = array('mon' => getDmon($x), 'date' => $m[0].'-'.$x,'class' => $class);
$tpl->set_ar_out($ar,1);
}
}
$tpl->out(2);
}
}
$design->footer();
case 'show';
$y = intval($menu->get(3));
$m = (strlen($menu->get(4)) == 1 ? '0'.intval($menu->get(4)) : intval($menu->get(4)));
$x = getDmon(intval($menu->get(4)));
if (checkdate($m, 20, $y) && in_array($y.'-'.$m, $dAr) ) {
$title = $allgAr['title'].' :: Forum :: Benutzeraktivität » Übersicht von '.$x.' '.$y;
$hmenu = $extented_forum_menu.'<a class="smalfont" href="index.php?forum">Forum</a> » <a class="smalfont" href="index.php?forum-activity">Benutzeraktivität</a> » Übersicht von '.$x.' '.$y;
$design = new design ( $title , $hmenu );
$design->header();
$tpl = new tpl ('forum/useractivity');
$tpl->out(3);
$i = 0;
$erg = db_query("SELECT `a`.`id` AS `userid`, `a`.`name` AS `aname`, COUNT(`b`.`id`) AS `panz`, `c`.`name` AS `recht_name`
FROM `prefix_user` as `a`
LEFT JOIN `prefix_posts` as `b` ON `a`.`id` = `b`.`erstid`
LEFT JOIN `prefix_grundrechte` as `c` ON `a`.`recht` = `c`.`id`
WHERE DATE_FORMAT( FROM_UNIXTIME(`b`.`time`) , '%Y-%m' ) = '{$y}-{$m}'
GROUP BY `a`.`id`
ORDER BY `panz` DESC");
while ($row = db_fetch_object($erg)) {
$i++;
$class = $i % 2 == 0 ? 'Cnorm' : 'Cmite';
$ar = array('NAME' => $row->aname,
'UID' => $row->userid,
'ANZ' => $row->panz,
'GRUPE' => $row->recht_name,
'class' => $class);
$tpl->set_ar_out($ar,4);
}
$tpl->out(5);
$design->footer();
}
break;
}
} else {
echo $lang['nonewposts'];
}
?>
include/templates/forum/useractivity.htm
<table width="100%" border="0" cellpadding="3" cellspacing="1" class="border">
<tr class="Chead" >
<th height="30" width="30%">{date}</th>
</tr>
{EXPLODE}
<tr class="{class}">
<td><a href="index.php?forum-activity-show-{date}">{mon}</a></td>
</tr>
{EXPLODE}
</table>
<br />
{EXPLODE}
<table width="100%" border="0" cellpadding="3" cellspacing="1" class="border">
<tr class="Chead" >
<th height="30" width="30%">{_lang_name}</th>
<th align="center" width="20%">{_lang_post}</th>
<th align="center" width="20%">{_lang_group}</th>
</tr>
{EXPLODE}
<tr class="{class}">
<td><a href="index.php?user-details-{UID}">{NAME}</a></td>
<td align="center"><font style="font-size: 10px">{ANZ} {_if_{ANZ}=='1'}Beitrag{_else_}{_lang_post}{/_endif}</font></td>
<td align="center">{GRUPE}</td>
</tr>
{EXPLODE}
</table>
include/contents/forum.php
unter der Zeile
case 'search' : $incdatei = 'suchen.php'; break;
das Einfügen
case 'activity' : $incdatei = 'useractivity.php'; break;
Viel Spaß damit ......
Wenn ihr Fragen habt, dann einfach hier Fragen
MfG OloX