Um in der Themenübersicht neue Beiträge farblich hervorzuheben (Standardmäßig wird nur ein "neu" Symbol angezeigt) muss man in einer Template Datei eine kleine Änderung machen.
Anleitung für
- SMF 1.0.5 (ohne neu Icon / default Theme) (http://www.simplemachines.org/community/index.php?topic=68413.msg468709#msg468709)
- SMF 1.0.5 (mit neu Icon / default Theme) (http://www.simplemachines.org/community/index.php?topic=68413.msg468715#msg468715)
- SMF 1.1 RC 1 (mit neu Icon / default Theme) (http://www.simplemachines.org/community/index.php?topic=68413.msg468720#msg468720)
- SMF 1.1 RC 2 (mit neu Icon / default Theme) (http://www.simplemachines.org/community/index.php?topic=68413.msg468724#msg468724)
- SMF 1.1 RC 2 (mit neu Icon / babylon Theme) (http://www.simplemachines.org/community/index.php?topic=68413.msg468727#msg468727)
Hier noch ein Screenshot zum verdeutlichen:
SMF 1.0.5 (ohne "neu" Symbol)
Suche in der MessageIndex.template.php nach folgenden Code:
foreach ($context['topics'] as $topic)
{
echo '
<tr>
<td class="windowbg2" valign="middle" align="center" width="5%">
<img src="', $settings['images_url'], '/topic/', $topic['class'], '.gif" alt="" />
</td>
<td class="windowbg2" valign="middle" align="center" width="4%">
<img src="', $settings['images_url'], '/post/', $topic['first_post']['icon'], '.gif" alt="" />
</td>
<td class="windowbg" valign="middle">
', $topic['first_post']['link'];
// Is this topic new? (assuming they are logged in!)
if ($topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $scripturl, '?topic=', $topic['id'], '.from', $topic['newtime'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" border="0" /></a>';
echo '
<span class="smalltext">', $topic['pages'], '</span>
und ersetze diesen mit:
foreach ($context['topics'] as $topic)
{
// Is this topic new? (assuming they are logged in!)
if ($topic['new'] && $context['user']['is_logged'])
echo ' <tr class="new">';
else
echo ' <tr>';
echo '
<td class="windowbg2" valign="middle" align="center" width="5%">
<img src="', $settings['images_url'], '/topic/', $topic['class'], '.gif" alt="" />
</td>
<td class="windowbg2" valign="middle" align="center" width="4%">
<img src="', $settings['images_url'], '/post/', $topic['first_post']['icon'], '.gif" alt="" />
</td>
<td class="windowbg" valign="middle">
', $topic['first_post']['link'];
echo '
<span class="smalltext">', $topic['pages'], '</span>
In deiner style.css fügst du am ende folgendes hinzu:
.new, tr.new td, .new a:link, .new a:visited
{
color: #000000;
font-style: normal;
background-color: #FFCC66;
}
SMF 1.0.5 (mit "neu" Symbol)
Suche in der MessageIndex.template.php nach folgenden Code:
foreach ($context['topics'] as $topic)
{
echo '
<tr>
<td class="windowbg2" valign="middle" align="center" width="5%">
<img src="', $settings['images_url'], '/topic/', $topic['class'], '.gif" alt="" />
</td>
<td class="windowbg2" valign="middle" align="center" width="4%">
<img src="', $settings['images_url'], '/post/', $topic['first_post']['icon'], '.gif" alt="" />
</td>
<td class="windowbg" valign="middle">
', $topic['first_post']['link'];
// Is this topic new? (assuming they are logged in!)
if ($topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $scripturl, '?topic=', $topic['id'], '.from', $topic['newtime'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" border="0" /></a>';
echo '
<span class="smalltext">', $topic['pages'], '</span>
und ersetze diesen mit:
foreach ($context['topics'] as $topic)
{
// Is this topic new? (assuming they are logged in!)
if ($topic['new'] && $context['user']['is_logged'])
echo ' <tr class="new">';
else
echo ' <tr>';
echo '
<td class="windowbg2" valign="middle" align="center" width="5%">
<img src="', $settings['images_url'], '/topic/', $topic['class'], '.gif" alt="" />
</td>
<td class="windowbg2" valign="middle" align="center" width="4%">
<img src="', $settings['images_url'], '/post/', $topic['first_post']['icon'], '.gif" alt="" />
</td>
<td class="windowbg" valign="middle">', $topic['first_post']['link'];
// Is this topic new? (assuming they are logged in!)
if ($topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $scripturl, '?topic=', $topic['id'], '.from', $topic['newtime'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" border="0" /></a>';
echo '
<span class="smalltext">', $topic['pages'], '</span>
In deiner style.css fügst du am ende folgendes hinzu:
.new, tr.new td, .new a:link, .new a:visited
{
color: #000000;
font-style: normal;
background-color: #FFCC66;
}
SMF 1.1 RC1 (mit "neu" Symbol)
Suche in der MessageIndex.template.php nach folgenden Code:
foreach ($context['topics'] as $topic)
{
echo '
<tr class="windowbg2">
<td valign="middle" align="center" width="5%">
<img src="', $settings['images_url'], '/topic/', $topic['class'], '.gif" alt="" />
</td>
<td valign="middle" align="center" width="4%">
<img src="', $topic['first_post']['icon_url'], '" alt="" />
</td>
<td class="windowbg" valign="middle">
', $topic['first_post']['link'];
// Is this topic new? (assuming they are logged in!)
if ($topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $topic['new_href'], '"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" border="0" /></a>';
echo '
<span class="smalltext">', $topic['pages'], '</span>
und ersetze diesen mit:
foreach ($context['topics'] as $topic)
{
// Is this topic new? (assuming they are logged in!)
if ($topic['new'] && $context['user']['is_logged'])
echo ' <tr class="new">';
else
echo ' <tr class="windowbg2">';
echo '
<td valign="middle" align="center" width="5%">
<img src="', $settings['images_url'], '/topic/', $topic['class'], '.gif" alt="" />
</td>
<td valign="middle" align="center" width="4%">
<img src="', $topic['first_post']['icon_url'], '" alt="" />
</td>
<td class="windowbg" valign="middle">
', $topic['first_post']['link'];
// Is this topic new? (assuming they are logged in!)
if ($topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $topic['new_href'], '"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" border="0" /></a>';
echo '
<span class="smalltext">', $topic['pages'], '</span>
In deiner style.css fügst du am ende folgendes hinzu:
.new, tr.new td, .new a:link, .new a:visited
{
color: #000000;
font-style: normal;
background-color: #FFCC66;
}
SMF 1.1 RC2 (mit "neu" Symbol / default Theme)
Suche in der MessageIndex.template.php nach folgenden Code:
foreach ($context['topics'] as $topic)
{
// Do we want to seperate the sticky and lock status out?
if (!empty($settings['seperate_sticky_lock']) && strpos($topic['class'], 'sticky') !== false)
$topic['class'] = substr($topic['class'], 0, strrpos($topic['class'], '_sticky'));
if (!empty($settings['seperate_sticky_lock']) && strpos($topic['class'], 'locked') !== false)
$topic['class'] = substr($topic['class'], 0, strrpos($topic['class'], '_locked'));
echo '
<tr>
<td class="windowbg2" valign="middle" align="center" width="5%">
und ersetze diesen Code mit:
foreach ($context['topics'] as $topic)
{
// Do we want to seperate the sticky and lock status out?
if (!empty($settings['seperate_sticky_lock']) && strpos($topic['class'], 'sticky') !== false)
$topic['class'] = substr($topic['class'], 0, strrpos($topic['class'], '_sticky'));
if (!empty($settings['seperate_sticky_lock']) && strpos($topic['class'], 'locked') !== false)
$topic['class'] = substr($topic['class'], 0, strrpos($topic['class'], '_locked'));
// Is this topic new? (assuming they are logged in!)
if ($topic['new'] && $context['user']['is_logged'])
echo ' <tr class="new">';
else
echo ' <tr class="windowbg2">';
echo '
<td class="windowbg2" valign="middle" align="center" width="5%">
In deiner style.css fügst du am ende folgendes hinzu:
.new, tr.new td, .new a:link, .new a:visited
{
color: #000000;
font-style: normal;
background-color: #FFCC66;
}
SMF 1.1 RC2 (mit "neu" Symbol / Babylon Theme)
Suche in der MessageIndex.template.php nach folgenden Code:
foreach ($context['topics'] as $topic)
{
echo '
<tr class="windowbg2">
<td valign="middle" align="center" width="5%">
<img src="', $settings['images_url'], '/topic/', $topic['class'], '.gif" alt="" />
</td>
und ersetze diesen Code mit:
foreach ($context['topics'] as $topic)
{
// Is this topic new? (assuming they are logged in!)
if ($topic['new'] && $context['user']['is_logged'])
echo ' <tr class="new">';
else
echo ' <tr class="windowbg2">';
echo '
<td valign="middle" align="center" width="5%">
<img src="', $settings['images_url'], '/topic/', $topic['class'], '.gif" alt="" />
</td>
In deiner style.css fügst du am ende folgendes hinzu:
.new, tr.new td, .new a:link, .new a:visited
{
color: #000000;
font-style: normal;
background-color: #FFCC66;
}
Ich benutze RC2, Default Theme...
Eine Frage, kann man auch nur die Links der neuen Threads/Posts fett oder in einer anderen Farbe markieren?
Die Links sind doch in der RC2 von Anfang an fett ;)
Hä... ???
Also, bei mir sind die ungelesenen Threads/Beiträge genau so "normal" wie die gelesenen Threads/Beiträge. Das Einzige, was sie unterscheidet ist das kleine Bild mit "neu" darauf... Kann man das etwa irgendwie im Menü einstellen?
Quote from: pushkin22 on July 30, 2006, 02:04:01 PM
Ich benutze RC2, Default Theme...
Eine Frage, kann man auch nur die Links der neuen Threads/Posts fett oder in einer anderen Farbe markieren?
Ja, dazu einfach die den von mir geposteten code in der style.css anpassen
diesen hier:
.new, tr.new td, .new a:link, .new a:visited
{
color: #000000;
font-style: normal;
background-color: #FFCC66;
}
lg
noex
Nein, ich meine: Nur die Links sollen fett werden bzw. eine andere Farbe haben, wenn sie neu sind. ;) Die Tabellen im Hintergrund sollen immer noch die normale Farbe haben. Wie in vB, ein Beispiel:
(http://img128.imageshack.us/img128/3603/dfdsfdsfsdho9.th.jpg) (http://img128.imageshack.us/my.php?image=dfdsfdsfsdho9.jpg)
ja sag ich doch.
nimm halt die background-color raus, und setze bei color die gewünschte farbe ein
lg
noex
Eine Frage... Hast du es schon selbst getestet?
Also, das Problem... Nach deiner Methode bekommen alle Links in der "neuen" Zeile die definierte Farbe
http://img104.imageshack.us/img104/2933/sdfsdfsdfsdfdsyd6.jpg
Was ich will, ist nur, dass der Link des Threads/zum neuen Beitrag fett bzw. in einer anderen Farbe dargestellt wird, wie in meinem Beispiel ;)
Edit: Gefunden!
http://www.simplemachines.org/community/index.php?topic=83429.0
Gibt es auch die Möglichkeit es bei SMF 2.0.1 anzuwenden?
Ich nutze das Core-Theme :)
Habs selber rausgefunden, war gar nicht so schwer für mich, die mit php auf Kriegsfuss steht :)
Ich habe folgendes gemacht:
Suche nach:
// Do we want to separate the sticky and lock status out?
if (!empty($settings['separate_sticky_lock']) && strpos($topic['class'], 'sticky') !== false)
$topic['class'] = substr($topic['class'], 0, strrpos($topic['class'], '_sticky'));
if (!empty($settings['separate_sticky_lock']) && strpos($topic['class'], 'locked') !== false)
$topic['class'] = substr($topic['class'], 0, strrpos($topic['class'], '_locked'));
Füge danach folgendes ein:
// Is this topic new? (assuming they are logged in!)
if ($topic['new'] && $context['user']['is_logged'])
echo ' <tr class="new">';
else
echo ' <tr class="windowbg2">';
Und natürlich nicht vergessen in die index.css den style einfügen.
Bin mir nicht sicher ob es wirklich richtig ist, aber es funktioniert :D