Ok cool das hat geklappt.
Wie schaff ich es nun das auch in der showtopic die Statistik abgefragt wird
Hier die HTM:
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr class="Chead">
<td height="26"><span style="font-family:Verdana; color:#ffffff; font-weight: bold;"> {CATNAME}</span> Seite:{MPL}</td>
<td height="26" align="right" valign="middle">{NEWTOPIC} </td>
</tr>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="5" class="border">
<tr class="Cdark">
<td width="90" height="26" align="center" valign="middle" class="Cdark"><span style="font-family:Verdana; font-size:8pt; color:#7e7d7d; font-weight:bold;">Status</span></td>
<td height="26" align="left" valign="middle" class="Cdark"><span style="font-family:Verdana; font-size:8pt; color:#7e7d7d; font-weight:bold;">Themen</span></td>
<td width="100" height="26" align="center" valign="middle" class="Cdark"><span style="font-family:Verdana; font-size:8pt; color:#7e7d7d; font-weight:bold;">{_lang_answers}</span></td>
<td width="100" height="26" align="center" valign="middle" class="Cdark"><span style="font-family:Verdana; font-size:8pt; color:#7e7d7d; font-weight:bold;">{_lang_hits}</span></td>
<td width="350" height="26" align="left" valign="middle" class="Cdark"><span style="font-family:Verdana; font-size:8pt; color:#7e7d7d; font-weight:bold;">{_lang_update}</span></td>
</tr>
{EXPLODE}
<tr class="Cnorm">
<td width="90" height="60" align="center" valign="middle" class="Cnorm"><img src="include/images/forum/{TOP}.png" border="0"></td>
<td width="56%" height="60" class="Cnorm"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> {VORT}<span style="font-weight:bold; font-size:16pt;"><a href="index.php?forum-showtopics-{id}">{name}</a></span></td>
</tr>
<tr>
<td class="mods"> <span style="font-family:Verdana; font-size:8pt; color:#7e7d7d;"> Author: </span><span style="font-family:Verdana; font-size:7pt; color:#7e7d7d;"> {erst}</span></td>
</tr>
</table></td>
<td width="100" height="60" align="center" class="Cnorm"><span style="font-family:Verdana; font-size:8pt; color:#7e7d7d; font-weight:bold;">{rep}</span></td>
<td width="100" height="60" align="center" class="Cnorm"><span style="font-family:Verdana; font-size:8pt; color:#7e7d7d; font-weight:bold;">{hit}</span></td>
<td width="350" height="60" align="left" class="Cnorm">
<span style="font-family:Verdana; font-size:8pt; color:#7e7d7d;">{date}</span>
<br />
<a class="smalfont" href="index.php?forum-showposts-{id}-p{page}#{pid}"><span style="font-family:Verdana; font-size:11pt; color:#7e7d7d;">{_lang_lastfrom}:</span> <span style="font-family:Verdana; font-size:11pt; color:#0096ff;">{last}</span></a> </td>
</tr>
{EXPLODE}
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="4" background="include/designs/Community_v2/Bilder/trenn.jpg" ></td>
</tr>
</table>
<table cellpadding="4" cellspacing="1" border="0" width="100%" class="border">
<tr>
<td height="92" valign="top" class="Cnormb"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left">{_lang_it} {istsind} {gesonline} {_lang_guestsonline,ofthem} {useronline} {_if_{useronline}=='1'}{_lang_registredand}{/_endif}{_if_{useronline}!='1'}{_lang_registrededand}{/_endif} {gastonline} {_lang_guests}<br />
{userliste}</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><p><b>{users}</b> {_lang_membershaveritten} <b>{posts}</b> {_lang_postsin} <b>{topics}</b> {_lang_topics}</p></td>
</tr>
</table></td>
<td height="92" align="center" valign="middle" style="text-align: center" class="Cnormb"><img src="include/images/forum/ntop.png" alt="neue Beiträge" border="0" align="middle" /><br />
<br />
<span style="font-family:Verdana; font-size:8pt; color:#7e7d7d; font-weight:bold;">{_lang_newposts}</span></td>
<td height="92" align="center" valign="middle" style="text-align: center" class="Cnormb"><img src="include/images/forum/top.png" alt="keine neuen Beiträge" border="0" align="middle" /><br />
<br />
<span style="font-family:Verdana; font-size:8pt; color:#7e7d7d; font-weight:bold;">{_lang_nonewposts}</span></td>
<td height="92" align="center" valign="middle" style="text-align: center" class="Cnormb"><img src="include/images/forum/ctop.png" alt="Thema geschlossen" border="0" align="middle" /><br />
<br />
<span style="font-family:Verdana; font-size:8pt; color:#7e7d7d; font-weight:bold;">{_lang_topicclosed}</span></td>
<td height="92" align="center" valign="middle" style="text-align: center" class="Cnormb"><img src="include/images/forum/htop.png" alt="brisantes Thema" border="0" align="middle" /><br />
<br />
<span style="font-family:Verdana; font-size:8pt; color:#7e7d7d; font-weight:bold;">brisantes Thema</span></td>
<td width="350" height="92" valign="top" class="Cnormb" style="text-align: right"><a href="index.php?search-augt">{_lang_newtopicssincelastvisit}</a> <br />
<a href="index.php?forum-markallasread">{_lang_markallasread}</a> <br />
<a href="index.php?search-aubt">{_lang_topicwithnoreply}</a> <br />
<a href="index.php?forum-editforum-{id}">{_lang_editforum}</a><br />
<a href="index.php?search-aeit">{_lang_ownposts}</a></td>
</tr>
</table>
{EXPLODE}
und hier die PHP:
<?php
# Copyright by: Manuel Staechele
# Support: www.ilch.de
defined ('main') or die ( 'no direct access' );
# check ob ein fehler aufgetreten ist.
check_forum_failure($forum_failure);
$title = $allgAr['title'].' :: Forum :: '.aktForumCats($aktForumRow['kat'],'title').' :: '.$aktForumRow['name'];
$hmenu = $extented_forum_menu.'<a class="smalfont" href="index.php?forum" style="color:#000000">Forum</a><b> » </b>'.aktForumCats($aktForumRow['kat']).'<b> » </b>'.$aktForumRow['name'].$extented_forum_menu_sufix;
$design = new design ( $title , $hmenu, 1);
$design->header();
$limit = $allgAr['Ftanz']; // Limit
$page = ( $menu->getA(3) == 'p' ? $menu->getE(3) : 1 );
$MPL = db_make_sites ($page , "WHERE fid = '$fid'" , $limit , '?forum-showtopics-'.$fid , 'topics' );
$anfang = ($page - 1) * $limit;
$tpl = new tpl ( 'forum/showtopic' );
$tpl->set('CATNAME' ,$aktForumRow['name']);
$tpl->set('HMENU' ,$hmenu);
if ( $forum_rights['start'] == TRUE ) {
$tpl->set('NEWTOPIC', '<a href="index.php?forum-newtopic-'.$fid.'"><img src="include/images/forum/newth.png" border="0"></a>' );
} else {
$tpl->set('NEWTOPIC','');
}
$tpl->set('MPL', $MPL);
$tpl->set_out('FID', $fid, 0);
$q = "SELECT a.id, a.name, a.rep, a.erst, a.hit, a.art, a.stat, b.time, b.erst as last, b.id as pid
FROM prefix_topics a
LEFT JOIN prefix_posts b ON a.last_post_id = b.id
WHERE a.fid = {$fid}
ORDER BY a.art DESC, b.time DESC
LIMIT ".$anfang.",".$limit;
$erg = db_query($q);
if ( db_num_rows($erg) > 0 ) {
while($row = db_fetch_assoc($erg) ) {
if ($row['stat'] == 0) {
$row['TOP'] = 'cord';
} elseif ($row['rep'] >= 20) {
$row['TOP'] = 'hord'; }else{
#$row['ORD'] = get_ordner($row['time']);
$row['TOP'] = forum_get_ordner($row['time'],$row['id'],$fid);
}
$row['date'] = date('d.m.y - H:i',$row['time']);
$row['page'] = ceil ( ($row['rep']+1) / $allgAr['Fpanz'] );
$row['VORT'] = ( $row['art'] == 1 ? 'Fest: ' : '' );
$tpl->set_ar_out($row,1);
} } else {
echo '<tr><td colspan="6" class="Cnorm"><b>keine Einträe vorhanden</b></td></tr>';
}
$tpl->out(2);
if ( $forum_rights['mods'] == TRUE ) {
$tpl->set('id', $fid);
$tpl->out(3);
}
# statistic #
$ges_online_user = ges_online();
$stats_array = array (
'privmsgpopup' => check_for_pm_popup (),
'topics' => db_result(db_query("SELECT COUNT(ID) FROM `prefix_topics`"),0),
'posts' => db_result(db_query("SELECT COUNT(ID) FROM `prefix_posts`"),0),
'users' => db_result(db_query("SELECT COUNT(ID) FROM `prefix_user`"),0),
'istsind' => ( $ges_online_user > 1 ? 'sind' : 'ist' ),
'gesonline' => $ges_online_user,
'gastonline' => ges_gast_online(),
'useronline' => ges_user_online(),
'userliste' => user_online_liste()
);
$tpl->set_ar_out($stats_array,4);