function func_execute_active_handler()
{
    if (isset($_GET['q'])) {
        $q = format_str($_GET['q']);
        $query = (array) explode('/', $q);
        $GLOBALS['page'] = $query[0];
    } else {
        $query = "";
        $GLOBALS['page'] = "";
    }
    $page = $GLOBALS['func_registry'][$GLOBALS['page']];
    if (!$page) {
        header('HTTP/1.0 404 Not Found');
        die('404 - Page not found.');
    }
    if (isset($page['security']) && $page['security']) {
        user_ensure_authenticated();
    }
    if (isset($page['admin']) && $page['admin']) {
        user_ensure_admin();
    }
    if (function_exists('config_log_request')) {
        config_log_request();
    }
    if (function_exists($page['callback'])) {
        return call_user_func($page['callback'], $query);
    }
    return false;
}
function feedback_show()
{
    user_ensure_admin();
    $args = func_get_args();
    $page = get_post('page');
    $content = '';
    $results = get_feedbacks(10, $page);
    foreach ($results as $r) {
        if ($r['user_id']) {
            $nick = $r['nickname'];
        } else {
            $nick = "游客";
        }
        $content .= '<div class="item" id="' . $r['feedback_id'] . '">
                        <div class="item-delete">
                            <a class="right"></a>
                        </div>
                        <div class="left item-pic">
                            <img alt="" width="50" height="50">
                        </div>
                        <div class="left item-content">
                            <div class="item-blog">
                                <a class="item-blog-name">' . $nick . '</a><a class="item-blog-title">' . $r['question'] . '</a>
                            </div>
                            <div class="item-blog-content close">
                                ' . $r['description'] . '
                            </div>
                            <div class="item-other">
                                <span class="left item-time">' . time_tran($r['post_datetime']) . '</span>
                                <a class="left item-position">' . $r['email'] . '</a>
                                <a class="right item-control last delete">删除</a>
                            </div>
                        </div>
                        <div class="clear">
                        </div>
                    </div>';
    }
    echo $content;
}
function hot_nameupdate()
{
    include_once 'login.inc.php';
    user_ensure_admin();
    connect_db();
    $view = "SELECT DISTINCT tag_group FROM tags WHERE tag_group != 0";
    $list = mysql_query($view);
    $set = array();
    while ($row = mysql_fetch_array($list)) {
        $set[$row['tag_group']] = get_post($row['tag_group']);
    }
    foreach ($set as $tag_group => $tag_group_name) {
        $view = "UPDATE tag_group SET tag_group_name='{$tag_group_name}' WHERE tag_group='{$tag_group}'";
        $list = mysql_query($view);
    }
    header("Location: " . BASE_URL . "hot/editname");
}