Guten morgen.
Bitte schön, die showpost.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);
# toipc als gelesen markieren
$_SESSION['forumSEE'][$fid][$tid] = time();
$title = $allgAr['title'].' :: Forum :: '.$aktTopicRow['name'].' :: Beiträge zeigen';
$hmenu = $extented_forum_menu.'<a class="smalfont" href="index.php?forum">Forum</a><b> » </b>'.aktForumCats($aktForumRow['kat']).'<b> » </b><a class="smalfont" href="index.php?forum-showtopics-'.$fid.'">'.$aktForumRow['name'].'</a><b> » </b>';
$hmenu .= $aktTopicRow['name'].$extented_forum_menu_sufix;
$design = new design ( $title , $hmenu, 1);
$design->header();
# Topic Hits werden eins hochgesetzt.
db_query('UPDATE `prefix_topics` SET hit = hit + 1 WHERE id = "'.$tid.'"');
$erg = db_query("SELECT fid FROM `prefix_posts` WHERE tid = ".$tid);
$row = db_fetch_assoc($erg);
$newth = '<a href="index.php?forum-newtopic-'.$row['fid'].'">NEUES THEMA</a>';
# mehrere seiten fals gefordert
$limit = $allgAr['Fpanz']; // Limit
$page = ($menu->getA(3) == 'p' ? $menu->getE(3) : 1 );
$MPL = db_make_sites ($page , "WHERE tid = ".$tid , $limit , 'index.php?forum-showposts-'.$tid , 'posts' );
$anfang = ($page - 1) * $limit;
$antworten = '';
if (($aktTopicRow['stat'] == 1 AND $forum_rights['reply'] == TRUE) OR ($_SESSION['authright'] <= '-7' OR $forum_rights['mods'] == TRUE)) {
$antworten = '<a href="index.php?forum-newpost-'.$tid.'">ANTWORT SCHREIBEN</a>';
}
$class = 'Cmite';
$tpl = new tpl ( 'forum/showpost' );
$ar = array (
'SITELINK' => $MPL,
'tid' => $tid,
'ANTWORTEN' => $antworten,
'TOPICNAME' => $aktTopicRow['name'],
'HMENU' => $hmenu,
'NEWTH' => $newth
);
$tpl->set_ar_out($ar,0);
$i = $anfang +1;
$ges_ar = array ('wurstegal', 'maennlich', 'weiblich');
##################################
#Forenmod by matthias-schlich.de - Vorlage von Benjamin Rau
#Posts
$erg = db_query("SELECT geschlecht, prefix_posts.id,txt,time,erstid,erst,sig,icq,spezrank,avatar,posts FROM `prefix_posts` LEFT JOIN prefix_user ON prefix_posts.erstid = prefix_user.id WHERE tid = ".$tid." ORDER BY time LIMIT ".$anfang.",".$limit);
while($row = db_fetch_assoc($erg)) {
$row['allp'] = $row['erst'];
$class = ( $class == 'Cnorm' ? 'Cmite' : 'Cnorm' );
$row['tid'] = $tid;
/*
## Auslesen der Renopunkte für den Ersteller
$renopts = db_result(db_query("SELECT SUM(punkte) FROM `prefix_reno` WHERE uid = '".$row['erstid']."'"));
## Einträge zählen die auf Renopunkte passen
$countbild = db_result(db_query("SELECT count(bild) FROM `prefix_reno_set` WHERE '".$renopts."' >= `pmin` AND '".$renopts."' <= `pmax` "));
# Falls kein Bild vorhanden das passt.
if ($countbild == 0) { $bild = 1; } else {
# Bild ausgeben
$bild = db_result(db_query("SELECT bild FROM `prefix_reno_set` WHERE '".$renopts."' >= `pmin` AND '".$renopts."' <= `pmax`"));
}
$row['reno'] = '<img src="include/images/reno/'.$bild.'.png" border="0" \>';
## Abfragen ob Ersteller der User ist
if ($row['erstid'] == $_SESSION['authid']) {
$row['renovote'] = '';
$row['reno'] = '<a href="?renomy-'.$row['tid'].'"><img src="include/images/reno/'.$bild.'.png" border="0" \></a>';
} else {
$row['renovote'] = '<a href="?reno-'.$row['erstid'].'-'.$tid.'"><b style="color:#ac00d6;"><u>bewerten</u></b></a>';
$row['reno'] = '<img src="include/images/reno/'.$bild.'.png" border="0" \>';
}
*/
$al = db_query("SELECT gebdatum FROM prefix_user WHERE id = ".$row['erstid']);
$alt = mysql_fetch_array($al);
if($alt['gebdatum'] !== "0000-00-00"){
$gebdatum = date('d.m.Y',strtotime($alt['gebdatum']));
$tag = date('d',strtotime($alt['gebdatum']));
$monat = date('m',strtotime($alt['gebdatum']));
$jahr = date('Y',strtotime($alt['gebdatum']));
$jetzt = mktime(0,0,0,date("m"),date("d"),date("Y"));
$geburtstag = mktime(0,0,0,$monat,$tag,$jahr);
$row['alter'] = " |".intval(($jetzt - $geburtstag) / (3600 * 24 * 365))." Jahre";
} else {$row['alter'] = '';}
/*
$icq1 = str_replace("-","",$row['icq']);
$icq2 = str_replace(" ","",$icq1);
// icq abfrage
// 0 - keine ICQ abfrage
// 1 - ICQ standartbilder bei &design= kann man zwischen den 26 verschiedenen icq bildern wechseln
// 2 - für eigne ICQ Statsubilder
$own_pics = "0";
$icqdesign = "25";
if ($own_pics == "1") {
if (is_numeric($icq2) ){
$row['icq'] = '<a href="http://www.icq.com/whitepages/cmd.php?uin='.$icq2.'&action=add"><img src="http://web.icq.com/whitepages/online?web='.$icq2.'&img='.$icqdesign.'" border="0"></a>';
} else {$row['icq'] = '';}
}
elseif ($own_pics == "0"){
$row['icq'] = '';}
else{
if (is_numeric($icq2) ){
// Eigene ICQ-Bilder
$status = (icq_status($icq2));
if ($status == "1"){
$row['icq'] = '<a href="http://www.icq.com/whitepages/cmd.php?uin='.$icq2.'&action=add"><img src="include/images/forum/icqonline.png" border="0"></a>';
}elseif ($status == "0"){
$row['icq'] = '<a href="http://www.icq.com/whitepages/cmd.php?uin='.$icq2.'&action=add"><img src="include/images/forum/icqoffline.png" border="0"></a>';
}elseif ($status == "2"){
$row['icq'] = '<a href="http://www.icq.com/whitepages/cmd.php?uin='.$icq2.'&action=add"><img src="include/images/forum/icqinactive.png" border="0"></a>';
}else {$row['icq'] = '';}
}else {$row['icq'] = '';}
}
*/
#Spezrank
$spez = db_query("SELECT bez FROM prefix_ranks WHERE id = ".$row['spezrank']);
$spezrang = db_fetch_assoc($spez);
$row['spez'] = '<b style="font-style:italic">'.$spezrang['bez'].'</b>';
# define some vars.
$noimage = '[img]';
$pos = strpos(strtolower($row['sig']),$noimage);
if($pos === false) {$row['sig'] = ( empty($row['sig']) ? '' : '<br /><hr style="width: 100%;" align="left">'.bbcode($row['sig']) );}
else {$row['sig'] = 'ungültige Signatur';}
$row['TID'] = $tid;
$row['class'] = $class;
$row['date'] = date ('d.m.Y - H:i:s', $row['time'] );
$row['delete'] = '';
$row['change'] = '';
if (file_exists($row['avatar'])) { $row['avatar'] = '<img border="1" style="border-color:#fff;" src="'.$row['avatar'].'" width="80" height="80" />'; }
elseif ($allgAr['forum_default_avatar']) { $row['avatar'] = '<img border="1" style="border-color:#fff" src="include/images/avatars/'.$ges_ar[$row['geschlecht']].'.jpg" width="80" height="80" />'; }
else { $row['avatar'] = ''; }
$row['rang2'] = userrang ($row['posts'],$row['erstid']);
$row['post'] = $row['posts'];
$rank_name = '';
$rank_name .= $row['rang2'];
$row['txt'] = (isset($_GET['such']) ? markword(bbcode ($row['txt']),$_GET['such']) : bbcode ($row['txt']) );
$row['i'] = $i;
if ( $row['erstid'] != '' ) {
$user_row = db_fetch_assoc(db_query("SELECT posts,regist FROM prefix_user WHERE id = ".$row['erstid']));
$regsek = mktime ( 0,0,0, date('m'), date('d'), date('Y') ) - $user_row['regist'];
$regday = round($regsek / 86400);
$row['ppday'] = ( $regday == 0 ? 0 : round($row['posts'] / $regday, 2 ) );
$posts = $row['posts'];
if ( $posts == '' ) { $row['posts'] = 'Nicht registriert';}
#Bezugnehmen auf das Ranking des users
/*if ( $row['posts'] != '' ) {
$row['rang'] = '';
$row['urank'] = $rank_name;
$farbe1 = 'include/images/userdetails/prozentbg.png'; //Hintergrundfarbe
$farbe2 = 'include/images/userdetails/gesamtf.png'; //Farbe des Prozentbalkens
$farbe3 = 'include/images/userdetails/gesamtf.png'; //Farbe des Prozentbalkens
$width = 154; //Laenge des Prozentbalkens in Pixel
$gesamt = '';
if ($posts <= '9') {$gesamt = '10'; }
elseif ($posts <= '19') {$gesamt = '20';; }
elseif ($posts <= '29') {$gesamt = '30';; }
elseif ($posts <= '39') {$gesamt = '40';; }
elseif ($posts <= '49') {$gesamt = '50';; }
elseif ($posts <= '59') {$gesamt = '60';; }
elseif ($posts <= '79') {$gesamt = '80';; }
elseif ($posts <= '99') {$gesamt = '100';;}
elseif ($posts <= '149') {$gesamt = '150';; }
elseif ($posts <= '199') {$gesamt = '200';; }
elseif ($posts <= '249') {$gesamt = '250';; }
elseif ($posts <= '299') {$gesamt = '300';; }
elseif ($posts <= '349') {$gesamt = '350';; }
elseif ($posts <= '399') {$gesamt = '400';; }
elseif ($posts <= '449') {$gesamt = '450';; }
elseif ($posts <= '499') {$gesamt = '500';; }
elseif ($posts <= '599') {$gesamt = '600';; }
elseif ($posts <= '699') {$gesamt = '700';; }
elseif ($posts <= '799') {$gesamt = '800';; }
elseif ($posts <= '899') {$gesamt = '900';; }
elseif ($posts <= '999') {$gesamt = '1000';; }
elseif ($posts <= '1499') {$gesamt = '1500';; }
elseif ($posts <= '1999') {$gesamt = '2000';; }
elseif ($posts <= '2499') {$gesamt = '2500';; }
elseif ($posts <= '2999') {$gesamt = '3000';; }
$prozent = ($posts*100)/$gesamt; //Berechnung des Prozentwertes z.B. 50%
$balken = ($width/100)*$prozent; //Berechnung des Prozentbalkens in Pixel
if ($posts <= $gesamt) {
$row['rang'] .=
'<table valign="middle" style="width:160px; height:16px; background:url('.$farbe1.')no-repeat scroll left center transparent">
<tr><td><div style="min-width: 1px; width:'.$balken.'px; height:12px; background:url('.$farbe2.') repeat scroll 0% 0% transparent; text-align: center">
<div style="width:156px; height:12px; text-align:center"><span class="fbar">'.round($prozent, 2).' %</span></div></div></td></tr></table>';
}
else {$row['rang'] .= ""; }*/
#Ranking Balken
#Grafiken definieren
$gesamt = '';
if ($posts <= '9') {$gesamt = '10'; }
elseif ($posts <= '19') {$gesamt = '20';; }
elseif ($posts <= '39') {$gesamt = '40';; }
elseif ($posts <= '59') {$gesamt = '60';; }
elseif ($posts <= '79') {$gesamt = '80';; }
elseif ($posts <= '99') {$gesamt = '100';; }
elseif ($posts <= '199') {$gesamt = '200';; }
elseif ($posts <= '299') {$gesamt = '300';;}
elseif ($posts <= '399') {$gesamt = '400';; }
elseif ($posts <= '499') {$gesamt = '500';; }
elseif ($posts <= '599') {$gesamt = '600';; }
elseif ($posts <= '699') {$gesamt = '700';; }
elseif ($posts <= '799') {$gesamt = '800';; }
elseif ($posts <= '899') {$gesamt = '900';; }
elseif ($posts <= '999') {$gesamt = '1000';; }
elseif ($posts <= '1249') {$gesamt = '1250';; }
elseif ($posts <= '1499') {$gesamt = '1500';; }
elseif ($posts <= '1749') {$gesamt = '1750';; }
elseif ($posts <= '1999') {$gesamt = '2000';; }
elseif ($posts <= '2999') {$gesamt = '3000';; }
$nlevel = $gesamt - $row['posts'];
$rank_00 = '<b>Grad reingestolpert</b><br>';
$rank_01 = '<b>Frischling</b><br>';
$rank_02 = '<b>Wiederholungstäter</b><br>';
$rank_03 = '<b>Kleiner DD Communitianer</b><br>';
$rank_04 = '<b>Mittlerer DD Communitianer</b><br>';
$rank_05 = '<b>Treuer DD Communitianer</b><br>';
$rank_06 = '<b>Warm gepostet</b><br>';
$rank_07 = '<b>Plaudertasche</b><br>';
$rank_08 = '<b>Flinker Finger</b><br>';
$rank_09 = '<b>Dauerschreiber</b><br>';
$rank_10 = '<b>Tastatur Quäler</b><br>';
$rank_11 = '<b>Tastatur Ruinierer</b><br>';
$rank_12 = '<b>Forum-Aktivist</b><br>';
$rank_13 = '<b>DD Fan</b><br>';
$rank_14 = '<b>DD Junkie</b><br>';
$rank_15 = '<b>Foren-Halbgott</b><br>';
$rank_16 = '<b>Am Board festgetackert</b><br>';
$rank_17 = '<b>Foren-Bewohner</b><br>';
$rank_18 = '<b>Foren-Guru</b><br>';
$rank_19 = '<b>Foren-Gott</b><br>';
$rank_20 = '<b>Legende</b><br>';
#Bezugnehmen auf das Ranking des users
if ( $row['posts'] != '' ) {
$row['rang'] = '';
if ($posts <= '9') { $row['rang'] .= $rank_00.$nlevel.' Posts bis zum Frischling'; }
elseif ($posts <= '19') { $row['rang'] .= $rank_01.$nlevel.' Posts bis zum Wiederholungstäter';;}
elseif ($posts <= '39') { $row['rang'] .= $rank_02.$nlevel.' Posts bis zum Kleiner DD Communitianer';; }
elseif ($posts <= '59') { $row['rang'] .= $rank_03.$nlevel.' Posts bis zum Mittlerer DD Communitianer';; }
elseif ($posts <= '79') { $row['rang'] .= $rank_04.$nlevel.' Posts bis zum Treuer DD Communitianer';; }
elseif ($posts <= '99') { $row['rang'] .= $rank_05.$nlevel.' Posts bis zum Warm gepostet';; }
elseif ($posts <= '199') { $row['rang'] .= $rank_06.$nlevel.' Posts bis zum Plaudertasche';; }
elseif ($posts <= '299') { $row['rang'] .= $rank_07.$nlevel.' Posts bis zum Flinker Finger';; }
elseif ($posts <= '399') { $row['rang'] .= $rank_08.$nlevel.' Posts bis zum Dauerschreiber';; }
elseif ($posts <= '499') { $row['rang'] .= $rank_09.$nlevel.' Posts bis zum Tastatur Quäler';; }
elseif ($posts <= '599') { $row['rang'] .= $rank_10.$nlevel.' Posts bis zum Tastatur Ruinierer';; }
elseif ($posts <= '699') { $row['rang'] .= $rank_11.$nlevel.' Posts bis zum Forum-Aktivist';; }
elseif ($posts <= '799') { $row['rang'] .= $rank_12.$nlevel.' Posts bis zum DD-Fan';; }
elseif ($posts <= '899') { $row['rang'] .= $rank_13.$nlevel.' Posts bis zum DD-Junkie';; }
elseif ($posts <= '999') { $row['rang'] .= $rank_14.$nlevel.' Posts bis zum Foren-Halbgott';; }
elseif ($posts <= '1249') { $row['rang'] .= $rank_15.$nlevel.' Posts bis zum Am Board festgetackert';; }
elseif ($posts <= '1499') { $row['rang'] .= $rank_16.$nlevel.' Posts bis zum Foren-Bewohner';; }
elseif ($posts <= '1749') { $row['rang'] .= $rank_17.$nlevel.' Posts bis zum Foren-Guru';; }
elseif ($posts <= '1999') { $row['rang'] .= $rank_18.$nlevel.' Posts bis zum Foren-Gott';; }
elseif ($posts <= '2999') { $row['rang'] .= $rank_19.$nlevel.' Posts bis zum Legende';; }
}
else {$row['rang'] .= ""; }
}
#User Details
if ( $posts != '' ) {
$abf1 = 'SELECT * FROM prefix_user where id = '.$row["erstid"];
$erg1 = db_query($abf1);
$user = db_fetch_object($erg1);
$zeit = date('d. M Y',$user->regist);
$llogin = date('H:i d.m.y',$user->llogin);
$ort = $user->wohnort;
$www = $user->homepage;
$email = $user->opt_mail;
$pm = $user->opt_pm;
$land = $user->staat;
#Flagge
if ($land != '')
{$row['land'] = '<img src="include/images/flags/'.$land.'" >';}
else{$row['land'] = '';}
#Dabei seit
$row['datum'] = $zeit;
#Wohnort
if ($ort != ''){$row['details'] .= "Wohnort: ".$ort."<br>";}
#Homepage
if ($www != ''){$row['www'] = '<a href="'.$www.'" target="_blank"><b>Home</b></a>';}
else{$row['www'] = '';}
#Letzter Login
$row['llogin'] = $llogin;
#PM
if ($pm == '1'){
$row['pm'] = "<a href='?forum-privmsg-new=0&empfid=".$row['erstid']."'><b>PM</b> |</a>";
}else{$row['pm'] = '';}
#email
if ($email == '1'){
$row['email'] = "<a href='?user-mail-".$row['erstid']."'><b>Email</b> |</a>";
}else{$row['email'] = '';}
}
else {
$row['details'] = "";
$row['land'] = '';
$row['pm'] = '';
$row['email'] = '';
$row['www'] = '';
}
if ( $posts != '' ) {
#User Online o Offline
$abf1 = "SELECT * FROM prefix_online where uid = ".$row['erstid'];
$erg1 = db_query($abf1);
$status = db_fetch_object($erg1);
if ($status->uid == $row['erstid']) {
$dif = date('Y-m-d H:i:s', time() - 200);
$row['online'] = 'bgcolor="#2bca15"'; }
else {
$row['online'] = 'bgcolor="#a70c0c"'; }
}
else {$row['online'] = '';}
#
#Edit Ende
##################################
$row['page'] = $page;
$recht=@db_result(db_query('SELECT recht FROM prefix_user WHERE id='.$row["erstid"]),0);
if ( $row['posts'] != 0 && $recht == '-9' ) {$row['erst'] = '<b><a style="color:#c20a0a;font-size:14px;" href="index.php?user-details-'.$row['erstid'].'">'.$row['erst'].'</a></b>';}
elseif ( $row['posts'] != 0 && $recht == '-3') {$row['erst'] = '<a style="color:#3c3c3c;font-size:14px;font-weight:bold" href="index.php?user-details-'.$row['erstid'].'"><span style="color:#C20A0A;font-weight:bold;">[</span>'.$row['erst'].'<span style="color:#C20A0A;font-weight:bold;">]</span></a>';}
elseif ( $row['posts'] != 0 && $recht == '-1') {$row['erst'] = '<a style="color:#626262;font-size:14px;border-bottom:1px;bold;" href="index.php?user-details-'.$row['erstid'].'"><b>'.$row['erst'].'</b></a>';}
elseif ( $row['posts'] != 0 && $recht == '0') {$row['erst'] = '<a style="color:#ff0000;font-size:14px;border-bottom:1px;bold;" href="index.php?user-details-'.$row['erstid'].'"><b>'.$row['erst'].'</b></a>';}
elseif ( $row['posts'] != 0 && $recht == '-5') {$row['erst'] = '<a style="color:#ff7200;font-size:14px;border-bottom:1px;bold;" href="index.php?user-details-'.$row['erstid'].'"><b>'.$row['erst'].'</b></a>';}
elseif ( $row['erstid'] == 0 ) {$row['rang'] = 'gelöschter User';}
if ($forum_rights['mods'] == TRUE AND $i>1) {
$row['delete'] = '<a href="index.php?forum-delpost-'.$tid.'-'.$row['id'].'"> '.$lang['delete'].' |</a>';
}
if ( $forum_rights['mods'] == TRUE ) {
$row['verwarnen'] = '<a style="color:#333333" href="index.php?forum-verwarnen-'.$row['erstid'].'">verwarnen</a>';
}
if ( $forum_rights['reply'] == TRUE AND loggedin() ) {
$row['change'] = ' <a href="index.php?forum-editpost-'.$tid.'-'.$row['id'].'">'.$lang['change'].' |</a>';
}
$row['posts'] = ($row['posts']?'<br />'.$row['posts']:'').'<br />';
// Forumex - begin
$row['txt'] = FE_Vote2HTML($row['id'], $row['txt']);
// Forumex - end
$tpl->set_ar_out($row,1);
$i++;
}
$tpl->set_ar_out( array (
'SITELINK' => $MPL,
'ANTWORTEN' => $antworten ) , 2 );
// anfang qpost
// end qpost
if (loggedin()) {
if ($menu->get(3) == 'topicalert') {
if (1 == db_result(db_query("SELECT COUNT(*) FROM prefix_topic_alerts WHERE uid = ".$_SESSION['authid']." AND tid = ".$tid),0)) {
db_query("DELETE FROM prefix_topic_alerts WHERE uid = ".$_SESSION['authid']." AND tid = ".$tid);
} else {
db_query("INSERT INTO prefix_topic_alerts (tid,uid) VALUES (".$tid.", ".$_SESSION['authid'].")");
}
}
if (1 == db_result(db_query("SELECT COUNT(*) FROM prefix_topic_alerts WHERE uid = ".$_SESSION['authid']." AND tid = ".$tid),0)) {
echo '<table cellpadding="4" cellspacing="1" border="0" width="100%" class="borderF">
<tr>
<td class="Fcat">- <a style="color:#999" href="index.php?forum-showposts-'.$tid.'-topicalert">'.$lang['nomailonreply'].'</a>
</td></tr></table>';
} else {
echo '<table cellpadding="4" cellspacing="1" border="0" width="100%" class="borderF">
<tr>
<td class="Fcat">- <a style="color:#999" href="index.php?forum-showposts-'.$tid.'-topicalert">'.$lang['mailonreply'].'</a>
</td></tr></table>';
}
}
if ( $forum_rights['mods'] == TRUE ) {
$tpl->set ( 'status', ($aktTopicRow['stat'] == 1 ? $lang['close'] : $lang['open'] ) );
$tpl->set ( 'festnorm', ($aktTopicRow['art'] == 0 ? $lang['fixedtopic'] : $lang['normaltopic'] ) );
$tpl->set('tid',$tid);
$tpl->out(3);
}
$design->footer();
?>
Mfg, Galle