Auschnitt meiner include/templates/forum/showforum.htm
<table width="100%" border="0" cellspacing="1" cellpadding="0" class="border">
<tr>
<td colspan="2" class="Cdark" height="20" style="padding-right:8px;"><div style="float:left"><b>Verantwortliche Moderators:</b></div><div style="float:right"><i><b>Legende:</b></i> [ <span style="color:#FF0000">Admin´s</span> ] , [ <span style="color:#FF8800">CoAdmin</span> ] , [ <span style="color:#0000FF">Partner/Sponor</span> ] , [ <span style="color:#088A08">Supporter</span> ] , [ <span style="color:#000">User</span> ]</div></td>
</tr>
<tr>
<td width="5%" align="center" valign="middle" class="Cdark"><img src="include/images/forum/legende/mods.png" width="36" height="36" border="0"></td>
<td width="95%" align="left" valign="middle" class="Cnorm" style="padding-left:9px;">{moda}</td>
</tr>
<tr>
<td class="Cdark" colspan="2" height="20"><div style="float:left"><b>Zurzeit aktive Benutzer :</b></div></td>
</tr>
<tr>
<td width="5%" align="center" valign="middle" class="Cdark"><img src="include/images/forum/legende/activ.png" width="36" height="36" border="0"></td>
<td width="95%" align="left" valign="middle" class="Cnorm" style="padding-left:9px;">{_lang_it} {istsind} {gesonline} {_lang_guestsonline,ofthem} {useronline} {_if_{useronline}=='1'}{_lang_registredand}{/_endif}{_if_{useronline}!='1'}{_lang_registrededand}{/_endif} {gastonline} {_lang_guests}
<p><b>Online:</b> {userliste}</p> </td>
</tr>
<tr>
<td class="Cdark" colspan="2" height="20"><div style="float:left"><b>Es waren Online heute: </b></div></td>
</tr>
<tr>
<td width="5%" align="center" valign="middle" class="Cdark"><img src="include/images/forum/legende/user.png" width="36" height="36" border="0"></td>
<td width="95%" align="left" valign="middle" class="Cnorm" style="padding-left:9px;">{userliste_today}</td>
</tr>
<tr>
<td class="Cdark" colspan="2" height="20"><div style="float:left"><b>Statistiken</b></div></td>
</tr>
<tr>
<td width="5%" align="center" valign="middle" class="Cdark"><img src="include/images/forum/legende/statistik.png" width="36" height="36" border="0"></td>
<td width="95%" align="left" valign="middle" class="Cnorm" style="padding-left:9px;"><p><b>{users}</b> {_lang_membershaveritten}
<b>{posts}</b> {_lang_postsin}
<b>{topics}</b> {_lang_topics}</p></td>
</tr>
<tr class="Cnorm">
<td class="Cdark" colspan="2" align="center"><img src="include/images/forum/ntop.png" alt="neue Beiträge" border="0" align="middle" /> {_lang_newposts}
<img src="include/images/forum/top.png" alt="keine neuen Beiträge" border="0" align="middle" /> {_lang_nonewposts}
<img src="include/images/forum/ctop.png" alt="Thema geschlossen" border="0" align="middle" /> {_lang_topicclosed} <img src="include/images/forum/htop.png" alt="brisantes Thema" border="0" align="middle" /> brisantes Thema</td>
</tr>
{privmsgpopup}
</table>
Meine include/contents/forum/show_forum.php:
<?php
# Copyright by: Manuel Staechele
# Support: www.ilch.de
defined ('main') or die ( 'no direct access' );
$title = $allgAr['title'].' :: Forum';
$hmenu = $extented_forum_menu.'Forum'.$extented_forum_menu_sufix;
$design = new design ( $title , $hmenu, 1);
$design->header();
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'] );
$r['erst'] = forum_farbname($r['erst']);
$tpl->set_ar ($r);
if ($r['cid'] <> $xcid) {
$tpl->out(1);
//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,2);
}
//Unterkategorien - Ende
$xcid = $r['cid'];
}
$tpl->set_ar_out($r,3);
}
##### Moderartoren
$moda = '';
$erg= db_query("SELECT b.id as uid, b.name, b.recht,c.id FROM prefix_forummods a LEFT JOIN prefix_user b ON b.id = a.uid LEFT JOIN prefix_grundrechte c ON c.id = b.recht GROUP BY b.name ORDER BY b.id");
while ($row = db_fetch_object($erg)) {
$recht_name=@db_result(db_query('SELECT name FROM prefix_grundrechte WHERE id='.$row->recht),0);
switch($row->recht) {
case -9: //Admins
$moda .= '<a href="index.php?user-details-'.$row->uid.'"><span style="color:#FF0000"><i><b>'.$row->name.'</b></i></span></a> , ';
break;
case -8: // CoAdmin
$moda .= '<a href="index.php?user-details-'.$row->uid.'"><span style="color:#FF8800">'.$row->name.'</span></a> , ';
break;
case -7:// SiteAdmin
$moda .= '<a href="index.php?user-details-'.$row->uid.'"><span style="color:#FF8800">'.$row->name.'</span></a> , ';
break;
case -6: // Partner / Sponsor
$moda .= '<a href="index.php?user-details-'.$row->uid.'"><span style="color:#0000FF"><i>'.$row->name.'</i></span></a> , ';
break;
case -5:// Supporter
$moda .= '<a href="index.php?user-details-'.$row->uid.'"><span style="color:#088A08"><i>'.$row->name.'</i></span></a> , ';
break;
case -4: // Member
$moda .= '<a href="index.php?user-details-'.$row->uid.'"><span style="color:#3CF"><i>'.$row->name.'</i></span></a> , ';
break;
case -3:// Trialmember
$moda .= '<a href="index.php?user-details-'.$row->uid.'"><span style="color:#00CCFF"><i>'.$row->name.'</i></span></a> , ';
break;
case -2://Superuser
$moda .= '<a href="index.php?user-details-'.$row->uid.'"><span style="color:#000">'.$row->name.'</span></a> , ';
break;
case -1:// User
$moda .= '<a href="index.php?user-details-'.$row->uid.'"><span style="color:#000">'.$row->name.'</span></a> , ';
break;
default: break;
}
}
# statistic #
$ges_online_user = ges_online();
function user_online_today_liste(){
$OnListe = '';
$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)) {
if ( $row->spezrank <> 0 ) {
$OnListe .= '<a class="'.$row->bez.'" title="'.$row->bez.'" href="index.php?user-details-'.$row->id.'">'.$row->name.'</a>, ';
} else {
$OnListe .= '<a href="index.php?user-details-'.$row->id.'">'.$row->name.'</a>, ';
}
}
$OnListe = substr($OnListe,0,strlen($OnListe) - 3);
return ($OnListe);
}
$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(),
'userliste_today' => user_online_today_liste(),
'moda' => $moda
);
$tpl->set_ar_out($stats_array,4);
$design->footer();
?>
Meine include/includes/func/forum.php
<?php
# Copyright by Manuel Staechele
# Support www.ilch.de
defined ('main') or die ( 'no direct access' );
function getmods ($fid) {
$erg = db_query("SELECT b.id,b.name FROM prefix_forummods a LEFT JOIN prefix_user b ON b.id = a.uid WHERE a.fid = ".$fid);
if ( db_num_rows($erg) > 0 ) {
$mods = '<br /><u>Moderators:</u> ';
while($row = db_fetch_assoc($erg) ) {
$mods .= '<a class="smalfont" href="index.php?user-details-'.$row['id'].'">'.$row['name'].'</a>, ';
}
$mods = substr ( $mods , 0 , -2 );
return ($mods);
} else {
return ('');
}
}
# forum oder topic las update zeit
# id ( forum oder topic id )
# fid ( 0 is forum, > 0 is forum_id_vom_topic )
function icq_status($icq) {
$fp = fsockopen ("status.icq.com", 80, &$errno, &$errstr, 1) or $online="0";
fputs($fp, "GET /online.gif?icq=$icq&img=5&online= HTTP/1.0\n\n");
while(!feof($fp) && !$icq_finished) {
$line = fgets ($fp,128);
if (substr($line,0,9) == 'Location:') {
if (substr($line,13,11) == 'online1.gif') { $online = "1"; $icq_finished = true;}
elseif (substr($line,13,11) == 'online0.gif') { $online = "0"; $icq_finished = true;}
elseif (substr($line,13,11) == 'online2.gif') { $online = "2"; $icq_finished = true;}
}
}
fclose($fp);
if($online == "1") { return "1"; }
elseif($online=="0") { return "0";; }
elseif($online=="2") { return "2"; }
else { echo("da stimmt was nicht"); }
}
function forum_get_ordner ( $ftime, $id, $fid =0 ) {
if ( $ftime >= $_SESSION['lastlogin'] ) {
if ( $fid == 0 ) {
$anzOpenTopics = db_result(db_query("SELECT COUNT(*) FROM prefix_topics LEFT JOIN prefix_posts ON prefix_posts.id = prefix_topics.last_post_id WHERE prefix_topics.fid = ".$id." AND prefix_posts.time >= ".$_SESSION['lastlogin'] ),0);
if ( (($anzOpenTopics > 0 ) AND !isset($_SESSION['forumSEE'][$id]))
OR $anzOpenTopics > count($_SESSION['forumSEE'][$id])
OR max ( $_SESSION['forumSEE'][$id] ) <= ( $ftime - 4 )
) {
return ( 'nord' );
} else {
return ( 'ord' );
}
} else {
if ( isset ($_SESSION['forumSEE'][$fid][$id]) AND $ftime <= $_SESSION['forumSEE'][$fid][$id] ) {
return ( 'ord' );
} else {
return ( 'nord' );
}
}
} else {
return ('ord');
}
}
function forum_farbname ($name) {
$erg = db_query("SELECT id FROM prefix_user WHERE name = BINARY '".$name."'");
if (db_num_rows($erg) > 0)
{
$recht = @db_result(db_query("SELECT recht FROM prefix_user WHERE name = BINARY '".$name."'"),0);
if ($recht == '-9') { return ('<span style="color:#FF0000">'.$name.'</span>'); } // Admin
elseif ($recht == '-8') { return ('<span style="color:#FF8800">'.$name.'</span>'); } // CoAdmin
elseif ($recht == '-7') { return ('<span style="color:#FF8800">'.$name.'</span>'); } // SiteAdmin
elseif ($recht == '-6') { return ('<span style="color:#0000FF">'.$name.'</span>'); } // Leader
elseif ($recht == '-5') { return ('<span style="color:#088A08">'.$name.'</span>'); } // CoLeader
elseif ($recht == '-4') { return ('<span style="color:#3CF">'.$name.'</span>'); } // Member
elseif ($recht == '-3') { return ('<span style="color:#00CCFF">'.$name.'</span>'); } // TrialMember
elseif ($recht == '-2') { return ('<span style="color:#000">'.$name.'</span>'); } // SuperUser
elseif ($recht == '-1') { return ('<span style="color:#000">'.$name.'</span>'); } // User
else { return ('<span style="color:#C0C0C0">'.$name.'</span>'); } // Gast
}
else
{
return ('<span style="color:#C0C0C0">'.$name.'</span>'); // Gast
}
}
function check_for_pm_popup () {
# opt_pm_popup
if (1 == db_result(db_query("SELECT COUNT(*) FROM prefix_user where id = ".$_SESSION['authid']." AND opt_pm_popup = 1"),0,0) AND 1 <= db_result(db_query("SELECT COUNT(*) FROM prefix_pm WHERE gelesen = 0 AND status < 1 AND eid = ".$_SESSION['authid'] ),0) ) {
$x = <<< html
<script language="JavaScript" type="text/javascript"><!--
function closeNewPMdivID () { document.getElementById("newPMdivID").style.display = "none"; }
//--></script>
<div id="newPMdivID" style="position:absolute; top:200px; left:300px; display:inline; width:200px;">
<table width="100%" class="border" border="0" cellspacing="1" cellpadding="4">
<tr>
<td class="Cdark" align="left">
<a href="javascript:closeNewPMdivID()"><img style="float:right; border: 0" src="include/images/icons/del.gif" alt="schliessen" title="schliessen"></a>
<b>neue private Nachricht</b>
bitte deinen <a href="?forum-privmsg">Posteingang</a> kontrolieren.
Damit dieses Fenster dauerhaft verschwindet musst du alle neuen Nachrichten
lesen, oder die Option in deinem <a href="?user-profil">Profil</a> abschalten.
</td>
</tr>
</table>
</div>
html;
return ($x);
}
}
function forum_user_is_mod ($fid) {
if (is_siteadmin()) { return (true); }
if (1 == db_result(db_query("SELECT COUNT(*) FROM prefix_forummods WHERE uid = ".$_SESSION['authid']." AND fid = ".$fid),0)) {
return (true);
}
return (false);
}
function check_forum_failure($ar) {
if ( array_key_exists(0,$ar) ) {
$hmenu = '<a class="smalfont" href="?forum">Forum</a><b> » </b> Fehler aufgetreten';
$title = 'Forum : Fehler aufgetreten';
$design = new design ( $title , $hmenu );
$design->header();
echo '<b>Es ist/sind folgende(r) Fehler aufgetreten</b><br />';
foreach($ar as $v) {
echo $v.'<br />';
}
echo '<br /><a href="javascript:history.back(-1)">zurück</a>';
$design->footer();
exit();
}
return (true);
}
?>
Funkioniert leider nicht wie ich es eingefügt habe
Zuletzt modifiziert von IRvD am 18.12.2011 - 11:37:31