query('SELECT NULL FROM '.$db->prefix.'ranks WHERE min_posts='.$min_posts) or error('Unable to fetch rank info', __FILE__, __LINE__, $db->error()); if ($db->num_rows($result)) message('There is already a rank with a minimun posts value of '.$min_posts.'.'); $db->query('INSERT INTO '.$db->prefix.'ranks (rank, min_posts) VALUES(\''.escape($rank).'\', '.$min_posts.')') or error('Unable to add rank', __FILE__, __LINE__, $db->error()); redirect('admin_ranks.php', 'Rank added. Redirecting ...'); } // Update a rank else if (isset($_POST['update'])) { confirm_referer('admin_ranks.php'); $id = key($_POST['update']); $rank = trim($_POST['rank'][$id]); $min_posts = trim($_POST['min_posts'][$id]); if ($rank == '') message('You must enter a rank title.'); if ($min_posts == '' || preg_match('/[^0-9]/', $min_posts)) message('Minimum posts must be a positive integer value.'); $db->query('UPDATE '.$db->prefix.'ranks SET rank=\''.escape($rank).'\', min_posts='.$min_posts.' WHERE id='.$id) or error('Unable to update rank', __FILE__, __LINE__, $db->error()); redirect('admin_ranks.php', 'Rank updated. Redirecting ...'); } // Remove a rank else if (isset($_POST['remove'])) { confirm_referer('admin_ranks.php'); $id = key($_POST['remove']); $db->query('DELETE FROM '.$db->prefix.'ranks WHERE id='.$id) or error('Unable to delete rank', __FILE__, __LINE__, $db->error()); redirect('admin_ranks.php', 'Rank removed. Redirecting ...'); } $page_title = htmlspecialchars($options['board_title']).' / Admin / Ranks'; $form_name = 'ranks'; $focus_element = 'new_rank'; require 'header.php'; admin_menu('ranks'); ?>
Ranks
Add rank  
Enter a rank and the minimum number of posts that a user has to have to aquire the rank. Different ranks cannot have the same value for minimum posts. If a title is set for a user, the title will be displayed instead of any rank. User ranks must be enabled in Options for this to have any effect.

Rank title
Text to be displayed under username.
Minimum posts
The minimum number of posts a user must have to attain this rank.
Edit/remove ranks  
query('SELECT id, rank, min_posts FROM '.$db->prefix.'ranks ORDER BY min_posts') or error('Unable to fetch rank list', __FILE__, __LINE__, $db->error()); if ($db->num_rows($result)) { while ($cur_rank = $db->fetch_assoc($result)) print "\t\t\t\t\t\t\t".'   Rank title       Minimum posts        
'."\n"; } else print "\t\t\t\t\t\t\t".'No ranks in list.'."\n"; ?>