diff -r 75df0b2c596c -r 0103428e2179 plugins/admin/UserRanks.php --- a/plugins/admin/UserRanks.php Sat Jun 07 12:46:18 2008 -0400 +++ b/plugins/admin/UserRanks.php Sat Jun 07 12:48:39 2008 -0400 @@ -24,7 +24,50 @@ return; } - echo 'Hello world!'; + // This should be a constant somewhere + $protected_ranks = array( + RANK_ID_MEMBER, + RANK_ID_MOD, + RANK_ID_ADMIN, + RANK_ID_GUEST + ); + + if ( $paths->getParam(0) == 'action.json' ) + { + // ajax call + return true; + } + + // draw initial interface + // yes, four paragraphs of introduction. Suck it up. + echo '

' . $lang->get('acpur_heading_main') . '

'; + echo '

' . $lang->get('acpur_intro_para1') . '

'; + echo '

' . $lang->get('acpur_intro_para2') . '

'; + echo '

' . $lang->get('acpur_intro_para3') . '

'; + echo '

' . $lang->get('acpur_intro_para4') . '

'; + + // fetch ranks + $q = $db->sql_query('SELECT rank_id, rank_title, rank_style FROM ' . table_prefix . "ranks ORDER BY rank_title ASC;"); + if ( !$q ) + $db->_die(); + + echo '
'; + while ( $row = $db->fetchrow() ) + { + // format rank according to what its users look like + // rank titles can be stored as language strings, so have the language manager fetch this + // normally it refetches (which takes time) if a string isn't found, but it won't try to fetch + // a string that isn't in the category_stringid format + $rank_title = $lang->get($row['rank_title']); + // FIXME: make sure htmlspecialchars() is escaping quotes and backslashes + echo '' . htmlspecialchars($rank_title) . ' '; + } + echo '
'; + + echo '
'; + echo $lang->get('acpur_msg_select_rank'); + echo '
'; + echo ''; } ?>