Ejemplo n.º 1
0
function show_level()
{
    $title = "User Reputation Manager - Overview";
    $html = "<p>On this page you can modify the minimum amount required for each reputation level. Make sure you press Update Minimum Levels to save your changes. You cannot set the same minimum amount to more than one level.<br />From here you can also choose to edit or remove any single level. Click the Edit link to modify the Level description (see Editing a Reputation Level) or click Remove to delete a level. If you remove a level or modify the minimum reputation needed to be at a level, all users will be updated to reflect their new level if necessary.</p><br />";
    $query = mysql_query('SELECT * FROM reputationlevel ORDER BY minimumreputation ASC');
    if (!mysql_num_rows($query)) {
        show_add();
        return;
    }
    $css = "style='font-weight: bold;color: #ffffff;background-color: #0055A4;padding: 5px;'";
    $html .= "<h2>User Reputation Manager</h2>";
    $html .= "<p><span class='btn'><a href='reputation_ad.php?mode=list'>View comments</a></span></p><br />";
    $html .= "<form action='reputation_ad.php' name='show_rep_form' method='post'>\r\n\t\t\t\t<input name='mode' value='doupdate' type='hidden' />";
    $html .= "<table cellpadding='3px'><tr>\n\t\t<td width='5%' {$css}>ID</td>\n\t\t<td width='60%'{$css}>Reputation Level</td>\n\t\t<td width='20%' {$css}>Minimum Reputation Level</td>\n\t\t<td width='15%' {$css}>Controls</td></tr>";
    while ($res = mysql_fetch_assoc($query)) {
        $html .= "<tr>\n" . "\t<td>#" . $res['reputationlevelid'] . "</td>\n" . "\t<td>User <b>" . htmlentities($res['level']) . "</b></td>\n" . "\t<td align='center'><input type='text' name='reputation[" . $res['reputationlevelid'] . "]' value='" . $res['minimumreputation'] . "' size='12' /></td>\n" . "\t<td align='center'><span class='btn'><a href='reputation_ad.php?mode=edit&amp;reputationlevelid=" . $res['reputationlevelid'] . "'>Edit</a></span>&nbsp;<span class='btn'><a href='reputation_ad.php?mode=dodelete&amp;reputationlevelid=" . $res['reputationlevelid'] . "'>Delete</a></span></td>\n" . "</tr>\n";
    }
    $html .= "<tr><td colspan='3' align='center'>\r\n\t\t\t\t\t<input type='submit' value='Update' accesskey='s' id='button' /> \r\n\t\t\t\t\t<input type='reset' value='Reset' accesskey='r' id='button' /></td>\r\n\t\t\t\t\t<td align='center'><span class='btn'><a href='reputation_ad.php?mode=add'>Add New</a></span>\r\n\t\t\t\t\t</td></tr>";
    $html .= "</table>";
    $html .= "</form>";
    html_out($html, $title);
}
Ejemplo n.º 2
0
<?php

require_once __DIR__ . '/lib/functions.php';
show_add();