Hier kann eine Notiz zum Merk-Eintrag hinzugefügt werden (optional)
| [ Anmelden zum schreiben ] |
| Last Forum Box | |||
|---|---|---|---|
| Nickbeinacht Mitglied
Posts: 12 |
Hallo,
bin neu auf dem Gebiet und hab nur ne kurze Bitte. Ich habs auch schon selbst versucht aber is irgendwie nix geworden. Könnte mir jemand mal den Code so mchen, das es aussieht wie auf dem Bild ? Die Farben sind auf dem Bild so wie es dann auch später aussehen soll. Breite der Box : 249 Pixel. Höhe ist wurst, so das eben 5 Beiträge reinpassen. Hintergrundfarbe grau : #181818 ( Arial ) Zwischenlinien hellgrau : #505050 ( Arial ) Schriftfarbe Forum Post grün : #27DE09 ( Arial Black ) Schriftfarbe von wem und wann... weiss : #ffffff ( Arial ) Schriftfarbe Name rot : #FE0202 ( Arial ) [img]http://666kb.com/i/bjc6qv0f2a87tk40v.bmp[/img] Wäre jemand so nett und könnt mir das mal coden ? betroffene Homepage: nochimbau.de Zuletzt modifiziert von Nickbeinacht am 19.05.2010 - 12:57:42 |
||
| Lord|Schirmer Administrator
Posts: 4409 |
Hier mal ein Lösung!
Der style Anteil könnte auch in die style.css <style type="text/css">
.lastforum {
background-color: #181818;
font-size: 12px;
width: 249px;
margin: 0;
padding: 0;
}
.lastforumtitel {
color: #27DE09;
font-family: "Arial Black";
}
.lastforuminfo {
color: #FFFFFF;
font-family: "Arial";
}
.lastforumname {
color: #FE0202;
font-family: "Arial";
}
</style>
<?php
# Copyright by Manuel
# Support www.ilch.de
defined ('main') or die ( 'no direct access' );
### Einstellungen
$maxtitel = 25; # maximale Titellänge in Zeichen
$anzahl = 5; # Ausgaben Menge
###
$query = "SELECT a.id, a.name, a.rep, c.erst as last, c.id as pid, c.time
FROM prefix_topics a
LEFT JOIN prefix_forums b ON b.id = a.fid
LEFT JOIN prefix_posts c ON c.id = a.last_post_id
LEFT JOIN prefix_groupusers vg ON vg.uid = ".$_SESSION['authid']." AND vg.gid = b.view
LEFT JOIN prefix_groupusers rg ON rg.uid = ".$_SESSION['authid']." AND rg.gid = b.reply
LEFT JOIN prefix_groupusers sg ON sg.uid = ".$_SESSION['authid']." AND sg.gid = b.start
WHERE ((".$_SESSION['authright']." <= b.view AND b.view < 1)
OR (".$_SESSION['authright']." <= b.reply AND b.reply < 1)
OR (".$_SESSION['authright']." <= b.start AND b.start < 1)
OR vg.fid IS NOT NULL
OR rg.fid IS NOT NULL
OR sg.fid IS NOT NULL
OR -9 >= ".$_SESSION['authright'].")
ORDER BY c.time DESC
LIMIT 0,".$anzahl;
echo '<table class="lastforum">';
$resultID = db_query($query);
$x=1;
while ($row = db_fetch_assoc($resultID)) {
$row['date'] = date('d.m.Y',$row['time']);
$row['page'] = ceil ( ($row['rep']+1) / $allgAr['Fpanz'] );
if ($x<$anzahl) {$x++; $zelle='border-bottom: 1px solid #505050;text-align: center';} ELSE {$zelle='text-align: center';}
echo '<tr><td style="'.$zelle.'"><a href="?forum-showposts-'.$row['id'].'-p'.$row['page'].'#'.$row['pid'].'" title="'.$row['name'].'"><span class="lastforumtitel">'.((strlen($row['name'])<$maxtitel) ? $row['name'] : substr($row['name'],0,($maxtitel-3)).'...').'</span></a><br /><span class="lastforuminfo">Last Post von:</span> <span class="lastforumname">'.$row['last'].'</span> <span class="lastforuminfo">'.$row['date'].'</span></td></tr>';
}
echo '</table>';
?>"In mir schlummert ein Genie, leider wacht es nicht auf!" my portfolio | my community | important link |
||
| Nickbeinacht Mitglied
Posts: 12 |
![]() ![]() Super ![]() ![]()
Funktioniert und sieht Topi aus. |
||
| Lord|Schirmer Administrator
Posts: 4409 |
Gern geschehen!
"In mir schlummert ein Genie, leider wacht es nicht auf!" my portfolio | my community | important link |
||
| Hershor Mitglied
Posts: 9 |
Das sieht wirklich klasse aus.
Ist es möglich, auch die Kategorie oder Forumtitel vor dem Titel anzeigen zu lassen? Habs selber gelöst...
<style type="text/css">
.lastforum {
font-size: 12px;
width: 300px;
margin: 0;
padding: 0;
}
.lastforumtitel {
color: #27DE09;
font-family: "Arial Black";
}
.lastforuminfo {
color: #FFFFFF;
font-family: "Arial";
}
.lastforumname {
color: #FE0202;
font-family: "Arial";
}
</style>
<?php
# Copyright by Manuel
# Support www.ilch.de
defined ('main') or die ( 'no direct access' );
### Einstellungen
$maxtitel = 35; # maximale Titellänge in Zeichen
$anzahl = 20; # Ausgaben Menge
###
$query = "SELECT a.id, a.name, a.rep, c.erst as last, c.id as pid, c.time, b.name AS fname
FROM prefix_topics a
LEFT JOIN prefix_forums b ON b.id = a.fid
LEFT JOIN prefix_posts c ON c.id = a.last_post_id
LEFT JOIN prefix_groupusers vg ON vg.uid = ".$_SESSION['authid']." AND vg.gid = b.view
LEFT JOIN prefix_groupusers rg ON rg.uid = ".$_SESSION['authid']." AND rg.gid = b.reply
LEFT JOIN prefix_groupusers sg ON sg.uid = ".$_SESSION['authid']." AND sg.gid = b.start
WHERE ((".$_SESSION['authright']." <= b.view AND b.view < 1)
OR (".$_SESSION['authright']." <= b.reply AND b.reply < 1)
OR (".$_SESSION['authright']." <= b.start AND b.start < 1)
OR vg.fid IS NOT NULL
OR rg.fid IS NOT NULL
OR sg.fid IS NOT NULL
OR -9 >= ".$_SESSION['authright'].")
ORDER BY c.time DESC
LIMIT 0,".$anzahl;
echo '<div style="width:330px; height: 100px; overflow-x:hidden; overflow-y: scroll; "><table width="330">';
echo '<table class="lastforum">';
$resultID = db_query($query);
$x=1;
while ($row = db_fetch_assoc($resultID)) {
$row['date'] = date('d.m.Y',$row['time']);
$row['page'] = ceil ( ($row['rep']+1) / $allgAr['Fpanz'] );
if ($x<$anzahl) {$x++; $zelle='border-bottom: 1px solid #505050;text-align: center';} ELSE {$zelle='text-align: center';}
echo '<tr><td style="'.$zelle.'"><a href="?forum-showposts-'.$row['id'].'-p'.$row['page'].'#'.$row['pid'].'" title="'.$row['name'].'"><span class="lastforumtitel">'.$row['fname'].' <span class="lastforuminfo"> >>> </span> '.((strlen($row['name'])<$maxtitel) ? $row['name'] : substr($row['name'],0,($maxtitel-3)).'...').'</span></a><br /><span class="lastforuminfo">Last Post von:</span> <span class="lastforumname">'.$row['last'].'</span> <span class="lastforuminfo">'.$row['date'].'</span></td></tr>';
}
echo '</table>';
?>
Zuletzt modifiziert von Hershor am 13.10.2010 - 15:32:36 |
||
| WinterKA Mitglied
Posts: 32 |
Servus
die Idee ist gut und ich habe sie auf meiner HP auch eingebastelt. Leider habe ich das Problem das der Abstand in der höhe nicht stimmt vielleicht kann mir da jemand helfen? Hier die Seite: web1.v1825.ncsrv.de/AI1/ |
||
| [ Anmelden zum schreiben ] |