Seite 1 von 1

Postcount Stars

Verfasst: 08.08.2007 20:18
von parariedel
Hallo,

habe wahrscheinlich eine dumme frage?!

Möchte denn Mod installieren, eigentlich kein Problem.

Die änderungen in der viewtopic.php sind klar. Nur habe ich eine Frage zur änderung folgender Datei:
templates/subSilver/viewtopic_body.tpl

Der genaue installationstext lautet:

Tip: This may be a partial find and not the whole line.
<td width="150" align="left" valign="top" class="{postrow.ROW_CLASS}"><span class="name"><a name="{postrow.U_POST_ID}">
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
{postrow.POSTER_STARS}
In-line Find
Tip: This is a partial match of a line for in-line operations.
class="{postrow.ROW_CLASS}">
Nur egal wo ich
{postrow.POSTER_STARS}
einfüge passiert nichts.

Wenn ich ins Forum gehe sehe ich keine Sterne!?

Danke an alle die mir helfen.

Gruß

Markus

Verfasst: 08.08.2007 20:26
von Conmark
Hallo,

bei mir liegt der Code in Zeile 29 in der viewtopic_body.tpl.

Code: Alles auswählen

<td width="150" align="left" valign="top" class="{postrow.ROW_CLASS}">{postrow.POSTER_STARS}<span class="name">...
Gruß Uwe

Verfasst: 08.08.2007 20:41
von parariedel
@ Conmark:

Habe es genau in der gleichen Zeile, habe es auch in der gleichen Stelle eingefügt wie du, nur erscheinen keine Sterne!?

Zählt dieser Mod auch die bereits geposteten post oder erst die neuen posts nach der installation?

Oder habe ich folgendes falsch gemacht:?

Open: viewtopic.php

Find
Tip: This may be a partial find and not the whole line.

$poster_posts =
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.

// Posting Stars Hack START
$poster_stars = "";
if ( $userdata['session_logged_in'] )
{
if ( isset($poststars[$postrow[$i][user_id]]))
{
// If we calculated this before use the cache
$poster_stars = $poststars[$postrow[$i][user_id]];
}
else
{
$pposts = $postrow[$i]['user_posts'];
// Only do this if the users has at least one post
if ( $pposts )
{
$image_path = $phpbb_root_path . "/images/stars/";
// Calculate the parts
$posts_10k = floor($pposts/10000);
$posts_1k = floor($pposts%10000/1000);
$posts_1c = floor($pposts%1000/100);
$posts_1d = floor($pposts%100/10);
if ( $posts_1d )
{
for ($starcount = 1; $starcount<= $posts_1d; $starcount++)
{
$poster_stars .= "<img src='{$image_path}green.gif'>";
}
}
if ( $posts_1c )
{
$poster_stars .= ( !empty($poster_stars) ) ? '<br />' : '';
for ($starcount = 1; $starcount<= $posts_1c; $starcount++)
{
$poster_stars .= "<img src='{$image_path}yellow.gif'>";
}
}
if ( $posts_1k )
{
$poster_stars .= ( !empty($poster_stars) ) ? '<br />' : '';
for ($starcount = 1; $starcount<= $posts_1k; $starcount++)
{
$poster_stars .= "<img src='{$image_path}pink.gif'>";
}
}
if ( $posts_10k )
{
$poster_stars .= ( !empty($poster_stars) ) ? '<br />' : '';
for ($starcount = 1; $starcount<= $posts_10k; $starcount++)
{
$poster_stars .= "<img src='{$image_path}blink.gif'>";
}
}
$poster_stars .= '<br />';
// Cache it
$poststars[$postrow[$i][user_id]] = $poster_stars;
}
}
}
// Posting Stars Hack END
Comment:
Complete line should be $poster_posts = ( $postrow[$i]['user_id'] != ANONYMOUS ) ? $lang['Posts'] . ': ' . $postrow[$i]['user_posts'] : '';

So habe ich es installiert:
$poster_posts =
( $postrow[$i]['user_id'] != ANONYMOUS ) ? $lang['Posts'] . ': ' . $postrow[$i]['user_posts'] : '';
// Posting Stars Hack START
$poster_stars = "";
if ( $userdata['session_logged_in'] )
{
if ( isset($poststars[$postrow[$i][user_id]]))
{
// If we calculated this before use the cache
$poster_stars = $poststars[$postrow[$i][user_id]];
}
else
{
$pposts = $postrow[$i]['user_posts'];
// Only do this if the users has at least one post
if ( $pposts )
{
$image_path = $phpbb_root_path . "/images/stars/";
// Calculate the parts
$posts_10k = floor($pposts/10000);
$posts_1k = floor($pposts%10000/1000);
$posts_1c = floor($pposts%1000/100);
$posts_1d = floor($pposts%100/10);
if ( $posts_1d )
{
for ($starcount = 1; $starcount<= $posts_1d; $starcount++)
{
$poster_stars .= "<img src='{$image_path}green.gif'>";
}
}
if ( $posts_1c )
{
$poster_stars .= ( !empty($poster_stars) ) ? '<br />' : '';
for ($starcount = 1; $starcount<= $posts_1c; $starcount++)
{
$poster_stars .= "<img src='{$image_path}yellow.gif'>";
}
}
if ( $posts_1k )
{
$poster_stars .= ( !empty($poster_stars) ) ? '<br />' : '';
for ($starcount = 1; $starcount<= $posts_1k; $starcount++)
{
$poster_stars .= "<img src='{$image_path}pink.gif'>";
}
}
if ( $posts_10k )
{
$poster_stars .= ( !empty($poster_stars) ) ? '<br />' : '';
for ($starcount = 1; $starcount<= $posts_10k; $starcount++)
{
$poster_stars .= "<img src='{$image_path}blink.gif'>";
}
}
$poster_stars .= '<br />';
// Cache it
$poststars[$postrow[$i][user_id]] = $poster_stars;
}
}
}
// Posting Stars Hack END
Dies war kein Problem:
Find
Tip: This may be a partial find and not the whole line.

'POSTER_RANK' => $poster_rank,
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.

'POSTER_STARS' => $poster_stars,
Gruß

Markus

Verfasst: 09.08.2007 17:04
von Conmark
Hallo,

ich habe alles mit easy_mod installiert. Lade dir den mal hier runter und installiere ihn. Danach geht alles ganz einfach. Hier gibts eine super Anleitung zm installieren der Mods.

Hat bei mir sofort geklappt und auch gleich Sterne, auch für schon gepostete Beiträge, angezeigt.

Lösche mal alles wieder raus und mach es mit easy_mod. Alles andere ist wirklich Quälerei.

Uwe