habe da ein kleines Star Rank system auf meiner seite laufen aber irgendwie funktioniert das nur teilweise. Im Profil wird alles richtig angezeig allerdings nicht in den Beiträgen. Woran es liegt kann ich mir irgendwie nicht erklären. Habe alles so gemacht wie im Mod beschrieben.
Problem ist nun das in den Beiträgen bei allen Usern unabhängig von der Beitragsanzahl immer das no-stars Bild angezeigt wird, aus welchem grund auch immer.
Habe die Anzahl der benötigten beiträge bei mir abgeändert aber auch mit der Orinal Einstellung funkioniert es nicht und das sollte ja auch eigendlich nicht der grund sein. Trotz allem hier mal meine Code Zeile
- Code: Alles auswählen
if ($profiledata['user_posts'] < '50'){
$stars = "<img src=images/star/no-stars.gif>";
}
if ($profiledata['user_posts'] >= '50'){
$stars = "<img src=images/star/1.gif>";
}
if ($profiledata['user_posts'] >= '70'){
$stars = "<img src=images/star/2.gif>";
}
if ($profiledata['user_posts'] >= '100'){
$stars = "<img src=images/star/3.gif>";
}
if ($profiledata['user_posts'] >= '135'){
$stars = "<img src=images/star/4.gif>";
}
if ($profiledata['user_posts'] >= '150'){
$stars = "<img src=images/star/5.gif>";
}
Da der mod nicht sooo groß ist werde ich ihn einfach mal hier mir rein posten.
- Code: Alles auswählen
##############################################################
## MOD Title: Star Ranking MOD
## MOD Author: Noam
## MOD Description: This MOD adding star ranking for users by posts.
## MOD Version: 0.0.1 Beta
##
## Installation Level: Easy
## Installation Time: 2-5 Minutes
## Files To Edit: viewtopic.php
## /language/lang_english/lang_main.php
## /includes/usercp_viewprofile.php
## /templates/subSilver/viewtopic_body.tpl
## /templates/subSilver/profile_view_body.tpl
##
## Included Files: images/star/1.gif
## images/star/2.gif
## images/star/3.gif
## images/star/4.gif
## images/star/5.gif
## images/star/no-stars.jpg
##
##############################################################
## Author Notes: images are taken from rating mod (without no-stars image),
## you can change the value number of posts for stars by changing: 20, 40, 70, 100 and 135.
##
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ COPY ]------------------------------------------
#
images/star/1.gif to images/star/1.gif
images/star/2.gif to images/star/2.gif
images/star/3.gif to images/star/3.gif
images/star/4.gif to images/star/4.gif
images/star/5.gif to images/star/5.gif
images/star/no-stars.jpg to images/star/no-stars.jpg
#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
$poster_posts = ( $postrow[$i]['user_id'] != ANONYMOUS ) ? $lang['Posts'] . ': ' . $postrow[$i]['user_posts'] : '';
#
#-----[ AFTER, ADD ]------------------------------------------
#
if ($postrow[$i]['user_posts'] < '20'){
$stars = "<img src=images/star/no-stars.jpg>";
}
if ($postrow[$i]['user_posts'] >= '20'){
$stars = "<img src=images/star/1.gif>";
}
if ($postrow[$i]['user_posts'] >= '40'){
$stars = "<img src=images/star/2.gif>";
}
if ($postrow[$i]['user_posts'] >= '70'){
$stars = "<img src=images/star/3.gif>";
}
if ($postrow[$i]['user_posts'] >= '100'){
$stars = "<img src=images/star/4.gif>";
}
if ($postrow[$i]['user_posts'] >= '135'){
$stars = "<img src=images/star/5.gif>";
}
#
#-----[ FIND ]------------------------------------------
#
'RANK_IMAGE' => $rank_image,
#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_STARS' => $lang['stars'],
'POSTER_STARS' => $stars,
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
//
// That's all Folks!
#
#-----[ BEFORE, ADD ]------------------------------------------
#
$lang['stars'] = 'Stars: ';
#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_viewprofile.php
#
#------[ FIND ]-----------------------------------------
#
//
// Generate page
//
#
#-----[ BEFORE, ADD ]------------------------------------------
#
if ($profiledata['user_posts'] < '20'){
$stars = "<img src=images/star/no-stars.jpg>";
}
if ($profiledata['user_posts'] >= '20'){
$stars = "<img src=images/star/1.gif>";
}
if ($profiledata['user_posts'] >= '40'){
$stars = "<img src=images/star/2.gif>";
}
if ($profiledata['user_posts'] >= '70'){
$stars = "<img src=images/star/3.gif>";
}
if ($profiledata['user_posts'] >= '100'){
$stars = "<img src=images/star/4.gif>";
}
if ($profiledata['user_posts'] >= '135'){
$stars = "<img src=images/star/5.gif>";
}
#
#------[ FIND ]-----------------------------------------
#
'RANK_IMAGE' => $rank_image,
#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_STARS' => $lang['stars'],
'POSTER_STARS' => $stars,
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/viewtopic_body.tpl
#
#------[ FIND ]-----------------------------------------
#
{postrow.POSTER_AVATAR}<br /><br />
#
#-----[ AFTER, ADD ]------------------------------------------
#
{postrow.L_STARS}{postrow.POSTER_STARS}<br />
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/profile_view_body.tpl
#
#------[ FIND ]-----------------------------------------
#
<tr>
<td valign="middle" align="{S_CONTENT_DIR_RIGHT}" nowrap="nowrap"><span class="gen">{L_JOINED}: </span></td>
<td width="100%"><b><span class="gen">{JOINED}</span></b></td>
</tr>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
<tr>
<td valign="middle" align="{S_CONTENT_DIR_RIGHT}" nowrap="nowrap"><span class="gen">{L_STARS} </span></td>
<td width="100%"><b><span class="gen">{POSTER_STARS}</span></b></td>
</tr>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM