Работещ ранк в Мemberlist
#
#-----[ Отворете ]------------------------------------------------
#
memberlist.php

#
#-----[ Намерете ]------------------------------------------------
#
'L_ICQ' =>

#
#-----[ След това добавете ]------------------------------------------
#

// Start add - Rank in member list MOD
'L_USER_RANK' => $lang['Poster_rank'],
// End add - Rank in member list MOD

#
#-----[ Намерете ]------------------------------------------------
#
$sql = "SELECT username, user_id

#
#-----[ В реда намерете ]----------------------------------------
#
, user_allowavatar

#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
, user_rank

#
#-----[ След него добавете ]-----------------------------------------
#

// Start add - Rank in member list MOD
$sql = "SELECT *
FROM " . RANKS_TABLE . "
ORDER BY rank_special, rank_min";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not obtain ranks information.", '', __LINE__, __FILE__, $sql);
}
$ranksrow = array();
while ( $row = $db->sql_fetchrow($result) )
{
$ranksrow[] = $row;
}
$db->sql_freeresult($result);
// End add - Rank in member list MOD

#
#-----[ Намерете ]------------------------------------------------
#
$posts = ( $row['user_posts'] ) ? $row['user_posts'] : 0;

#
#-----[ След него добавете ]------------------------------------------
#

// Start add - Rank in member list MOD
//
// Generate ranks, set them to empty string initially
//
$user_rank = '';
$rank_image = '';
if ( $row['user_rank'] )
{
for($j = 0; $j < count($ranksrow); $j++)
{
if ( $row['user_rank'] == $ranksrow[$j]['rank_id'] && $ranksrow[$j]['rank_special'] )
{
$user_rank = $ranksrow[$j]['rank_title'];
$rank_image = ( $ranksrow[$j]['rank_image'] ) ? '<img src="' . $ranksrow[$j]['rank_image'] . '" alt="' . $poster_rank . '" title="' . $poster_rank . '" border="0" /><br />' : '';
}
}
}
else
{
for($j = 0; $j < count($ranksrow); $j++)
{
if ( $row['user_posts'] >= $ranksrow[$j]['rank_min'] && !$ranksrow[$j]['rank_special'] )
{
$user_rank = $ranksrow[$j]['rank_title'];
$rank_image = ( $ranksrow[$j]['rank_image'] ) ? '<img src="' . $ranksrow[$j]['rank_image'] . '" alt="' . $poster_rank . '" title="' . $poster_rank . '" border="0" /><br />' : '';
}
}
}
// End add - Rank in member list MOD

#
#-----[ Намерете ]------------------------------------------------
#
'JOINED' =>

#
#-----[ След него добавете]------------------------------------------
#

// Start add - Rank in member list MOD
'USER_RANK' => $user_rank,
'USER_RANK_IMG' => $rank_image,
// End add - Rank in member list MOD

#
#-----[ Отворете ]------------------------------------------------
#
#
templates/вашият template/memberlist_body.tpl

#
#-----[ Намерете ]------------------------------------------------
#
<th class="thTop" nowrap="nowrap">{L_USERNAME}</th>

#
#-----[ След него добавете]------------------------------------------
#

<!-- Start add - Rank in member list MOD -->
<th class="thTop" nowrap="nowrap">{L_USER_RANK}</th>
<!-- End add - Rank in member list MOD -->

#
#-----[ Намерете ]------------------------------------------------
#
#
{memberrow.USERNAME}

#
#-----[ След него добавете ]------------------------------------------
#

<!-- Start add - Rank in member list MOD -->
<td class="{memberrow.ROW_CLASS}" align="center" valign="middle"><span class="gensmall">{memberrow.USER_RANK_IMG}{memberrow.USER_RANK}</span></td>
<!-- End add - Rank in member list MOD -->

#
#-----[ Запазете & Затворете ]--------------------------------
#

Ако не искате да показва изображенията на РАНГОВЕТЕ просто премахнете {memberrow.USER_RANK_IMG} а ако искате обратното, да се показват само изображенията а не текстовите описания премахнете {memberrow.USER_RANK} :)

Demo:





/ Трябва да сте регистриран за да напишете коментар /
От: tree
0:48 05-11-2009
яко, но за коя версия е?
От: eros
3:50 06-11-2009
демото е за phpbb2
1