コード例 #1
0
        view_list();
        break;
    case 'dolist':
        do_list();
        break;
    case 'editrep':
        show_form_rep('edit');
        break;
    case 'doeditrep':
        do_edit_rep();
        break;
    case 'dodelrep':
        do_delete_rep();
        break;
    default:
        show_level();
        break;
}
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' />";
コード例 #2
0
 function show_level($links, $top = FALSE, $show_children = TRUE, $attributes = array())
 {
     $has_current = FALSE;
     $wrap = isset($attributes['wrap']) && $attributes['wrap'] == true ? true : false;
     $act_class = isset($attributes['active']) ? $attributes['active'] : 'current';
     $output = '<ul';
     if ($top) {
         $output .= empty($attributes['id']) ? '' : ' id="' . $attributes['id'] . '"';
         $output .= empty($attributes['class']) ? '' : ' class="' . $attributes['class'] . '"';
     }
     $output .= '>';
     foreach ($links as $link) {
         $child_html = '';
         $child_current = FALSE;
         $attributes = array();
         if ($show_children && !empty($link->children) and is_array($link->children) and count($link->children)) {
             list($child_html, $child_current) = show_level($link->children, FALSE);
         }
         if ("/" . trim(uri_string(), '/') == $link->url || $child_current) {
             $attributes['class'] = $act_class;
             $has_current = TRUE;
         }
         $output .= "<li";
         $output .= !empty($attributes['class']) ? ' class="' . $attributes['class'] . '"' : '';
         //check for full urls
         if (FALSE === strpos($link->url, 'http')) {
             // allow for relative paths
             $ltitle = $wrap == true ? '<span>' . $link->title . '</span>' : $link->title;
             $output .= ">" . anchor(site_url($link->url), $ltitle, $attributes);
         } else {
             $ltitle = $wrap == true ? '<span>' . $link->title . '</span>' : $link->title;
             $output .= ">" . anchor($link->url, $ltitle, $attributes);
         }
         $output .= $child_html;
         $output .= "</li>" . PHP_EOL;
     }
     $output .= "</ul>" . PHP_EOL;
     return array($output, $has_current);
 }