woha hatte ne lange pause und in meiner show_forum.php die ich von einer alten page uebernommen habe einfach steht ne menge ^^
<?php
# Copyright by: Manuel Staechele
# Support: www.ilch.de
defined ('main') or die ( 'no direct access' );
$title = $allgAr['title'].' ';
$hmenu = 'Forum';
$design = new design ( $title , $hmenu, 1);
$design->header();
echo '<br><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="Chead"> <b>Willkommen - Forum</b>
</td>
</tr>';
echo '<tr>';
echo '<td class="Cdark">';$tpl = new tpl ( 'user/forumh_login.htm' );
if ( loggedin() ) {
$tpl->set('lastLogin', date("j.n.Y", db_result(db_query("SELECT `llogin` FROM `prefix_user` WHERE id = {$_SESSION['authid']}"), 0)));
$tpl->set('date', date("H:i"));
if ( user_has_admin_right($menu,false) ) {
$tpl->set ( 'ADMIN', '<a class="box" href="admin.php?admin">'.$lang['adminarea'].'</a>' );
} else {
$tpl->set ( 'ADMIN', '' );
}
if ( $allgAr['Fpmf'] == 1 ) {
$erg = db_query("SELECT COUNT(id) FROM `prefix_pm` WHERE gelesen = 0 AND status < 1 AND eid = ".$_SESSION['authid']);
$check_pm = db_result($erg,0);
$nachrichten_link = '<a class="box" href="index.php?forum-privmsg">'.$lang['messages'].'</a> ('.$check_pm.')<br>';
} else {
$nachrichten_link = '';
}
$tpl->set ( 'SID' , session_id() );
$tpl->set ( 'NACHRICHTEN' , $nachrichten_link );
$tpl->set ( 'NAME', $_SESSION['authname'] );
$tpl->out (0);
} else {
if (empty($_POST['login_name'])) { $_POST['login_name'] = 'Nickname'; }
if (empty($_POST['login_pw'])) { $_POST['login_pw'] = 'ääääääää'; }
$regist = '';
if ( $allgAr['forum_regist'] == 1 ) {
$regist = ' <a href="index.php?user-regist">Registrieren</a>';
}
$tpl->set_ar_out ( array ( 'regist' => $regist, 'wdlink' => '?'.$allgAr['smodul'], 'PASS' => $_POST['login_pw'], 'NAME' => $_POST['login_name'] ) , 1 );
}
unset($tpl);
echo '</td>';
echo '</tr>';
echo '</table>';
echo '<br />';
if ($menu->get(1) == 'markallasread') {
user_markallasread ();
}
$tpl = new tpl ( 'forum/showforum' );
$tpl->out (0);
$category_array = array();
$forum_array = array();
$q = "SELECT
a.id, a.cid, a.name, a.besch,
a.topics, a.posts, b.name as topic,
c.id as pid, c.tid, b.rep, c.erst, c.time,
a.cid, k.name as cname
FROM prefix_forums a
LEFT JOIN prefix_forumcats k ON k.id = a.cid
LEFT JOIN prefix_posts c ON a.last_post_id = c.id
LEFT JOIN prefix_topics b ON c.tid = b.id
LEFT JOIN prefix_groupusers vg ON vg.uid = ".$_SESSION['authid']." AND vg.gid = a.view
LEFT JOIN prefix_groupusers rg ON rg.uid = ".$_SESSION['authid']." AND rg.gid = a.reply
LEFT JOIN prefix_groupusers sg ON sg.uid = ".$_SESSION['authid']." AND sg.gid = a.start
WHERE ((".$_SESSION['authright']." <= a.view AND a.view < 1)
OR (".$_SESSION['authright']." <= a.reply AND a.reply < 1)
OR (".$_SESSION['authright']." <= a.start AND a.start < 1)
OR vg.fid IS NOT NULL
OR rg.fid IS NOT NULL
OR sg.fid IS NOT NULL
OR -9 = ".$_SESSION['authright'].")
AND k.cid = 0
ORDER BY k.pos, a.pos";
$erg1 = db_query($q);
$xcid = 0;
while ($r = db_fetch_assoc($erg1) ) {
$r['topicl'] = $r['topic'];
$r['topic'] = html_enc_substr($r['topic'],0,23);
$r['ORD'] = forum_get_ordner($r['time'],$r['id']);
$r['mods'] = getmods($r['id']);
$r['datum'] = date('d.m.y - H:i', $r['time']);
$r['page'] = ceil ( ($r['rep']+1) / $allgAr['Fpanz'] );
$tpl->set_ar ($r);
$cidname = $r['cid'];
if ($r['cid'] <> $xcid) {
if($i > 0){$tpl->out(5);}
$tpl->out(1);
$tpl->set("cidname", $cidname);
$i++;
//Unterkategorien
$sql = db_query("SELECT DISTINCT a.name as cname, a.id as cid FROM `prefix_forumcats` a LEFT JOIN `prefix_forums` b ON a.id = b.cid WHERE a.cid = {$r['cid']} AND a.id = b.cid ORDER BY a.pos, a.name");
while ($ucat = db_fetch_assoc($sql)) {
$tpl->set_ar_out($ucat,3);
}
//Unterkategorien - Ende
$xcid = $r['cid'];
}
$tpl->set_ar_out($r,3);
}
function user_online_today_liste(){
$OnListe = '';
$anzonline = 0;
$dif = mktime(0,0,0,date('m'),date('d'),date('Y'));
$erg = db_query("SELECT a.id, a.name, a.llogin, b.bez, a.spezrank FROM `prefix_user` a LEFT JOIN prefix_ranks b ON b.id = a.spezrank WHERE a.llogin > '". $dif."' ORDER BY llogin");
while($row = db_fetch_object($erg)) {
$anzonline++;
if ( $row->spezrank <> 0 ) {
$OnListe .= '<a title="'.$row->bez.'" href="index.php?user-details-'.$row->id.'"><b><i>'.$row->name.'</i></b></a> , ';
} else {
$OnListe .= '<a href="index.php?user-details-'.$row->id.'">'.$row->name.'</a> , ';
}
}
$OnListe = substr($OnListe,0,strlen($OnListe) - 3);
$out = array('liste' => $OnListe, 'anzahl' => $anzonline);
return ($out);
}
# statistic #
$ges_online_user = ges_online();
$online_today = user_online_today_liste();
$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),
'newest_user' => db_result($abfnu = db_query("SELECT name,id FROM prefix_user ORDER BY regist DESC LIMIT 1"),0,0),
'newest_userid' => db_result($abfnu, 0 ,1),
'istsind' => ( $ges_online_user > 1 ? 'sind' : 'ist' ),
'gesonline' => $ges_online_user,
'gastonline' => ges_gast_online(),
'useronline' => ges_user_online(),
'userliste' => user_online_liste(),
'userliste_today' => $online_today['liste'],
'anzregtoday' => $online_today['anzahl']
);
# geburtstag #
$geburtstag = '';
$qry = db_query("SELECT id, name, gebdatum FROM prefix_user WHERE DATE_FORMAT(gebdatum, '%m-%d') = '".date('m-d')."'");
$num = db_num_rows($qry);
if ($num > 0) {
$geburtstag = '<strong>Wir gratulieren zum Geburtstag:</strong><br />';
$i = 1;
$year = date('Y');
while ($gr = db_fetch_assoc($qry)) {
list($geby) = explode('-', $gr['gebdatum']);
$geburtstag .= '<a href="?user-details-'.$gr['id'].'">'.$gr['name'].'</a> ('.($year - $geby).')'.($i != $num ? ', ' : '');
$i++;
}
} else {
$geburtstag = 'Keiner hat heute Geburtstag';
}
$tpl->set('geburtstag', $geburtstag);
$tpl->set_ar_out($stats_array,4);
;$tpl = new tpl ( 'user/forum_login.htm' );
if ( loggedin() ) {
if ( user_has_admin_right($menu,false) ) {
$tpl->set ( 'ADMIN', '<a class="box" href="admin.php?admin">'.$lang['adminarea'].'</a>' );
} else {
$tpl->set ( 'ADMIN', '' );
}
if ( $allgAr['Fpmf'] == 1 ) {
$erg = db_query("SELECT COUNT(id) FROM `prefix_pm` WHERE gelesen = 0 AND status < 1 AND eid = ".$_SESSION['authid']);
$check_pm = db_result($erg,0);
$nachrichten_link = '<a class="box" href="index.php?forum-privmsg">'.$lang['messages'].'</a> ('.$check_pm.')<br>';
} else {
$nachrichten_link = '';
}
$tpl->set ( 'SID' , session_id() );
$tpl->set ( 'NACHRICHTEN' , $nachrichten_link );
$tpl->set ( 'NAME', $_SESSION['authname'] );
$tpl->out (0);
} else {
if (empty($_POST['login_name'])) { $_POST['login_name'] = 'Nickname'; }
if (empty($_POST['login_pw'])) { $_POST['login_pw'] = 'ääääääää'; }
$regist = '';
if ( $allgAr['forum_regist'] == 1 ) {
$regist = ' <a href="index.php?user-regist">Registrieren</a>';
}
$tpl->set_ar_out ( array ( 'regist' => $regist, 'wdlink' => '?'.$allgAr['smodul'], 'PASS' => $_POST['login_pw'], 'NAME' => $_POST['login_name'] ) , 1 );
}
unset($tpl);
echo '<br />';
echo '<table border="0" cellspacing="0" cellpadding="0" align="center" valign="top">
<tr>
<td width="33"><img src="include/images/forum/nord.gif" alt="neue Beiträge" border="0" /></td>
<td width="120" valign="middle">neue Beiträge</td>
<td width="33"><img src="include/images/forum/ord.gif" alt="keine neuen Beiträge" border="0" /></td>
<td width="150" valign="middle">keine neuen Beiträge</td>
<td width="33"><img src="include/images/forum/cord.gif" alt="Thema geschlossen" border="0" /></td>
<td width="150" valign="middle">Thema geschlossen</td>
</tr>
</table>';
$design->footer();
?>
Zuletzt modifiziert von Mairu am 10.04.2009 - 11:38:02