Skip to content

Commit

Permalink
Fixing loading the ranks cache multiple times if there are no ranks d…
Browse files Browse the repository at this point in the history
…efined. Spotted by daris.
  • Loading branch information
reines committed Jul 29, 2010
1 parent 40da324 commit aa6bab9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ function get_title($user)
}

// If not already loaded in a previous call, load the cached ranks
if ($pun_config['o_ranks'] == '1' && empty($pun_ranks))
if ($pun_config['o_ranks'] == '1' && !defined('PUN_RANKS_LOADED'))
{
if (file_exists(FORUM_CACHE_DIR.'cache_ranks.php'))
include FORUM_CACHE_DIR.'cache_ranks.php';
Expand Down Expand Up @@ -805,7 +805,7 @@ function get_title($user)
{
foreach ($pun_ranks as $cur_rank)
{
if (intval($user['num_posts']) >= $cur_rank['min_posts'])
if ($user['num_posts'] >= $cur_rank['min_posts'])
$user_title = pun_htmlspecialchars($cur_rank['rank']);
}
}
Expand Down

0 comments on commit aa6bab9

Please sign in to comment.