예제 #1
0
파일: index.php 프로젝트: kmklr72/lmms.io
function process_params()
{
    $post_funcs = explode(',', POST_FUNCS);
    foreach ($post_funcs as $func) {
        if (!GET_EMPTY($func)) {
            // Process parametrized functions
            switch ($func) {
                case 'rate':
                    update_rating(GET('file'), GET('rate'), SESSION());
                    break;
                    // break for file/rate, return for all others
                // break for file/rate, return for all others
                case 'search':
                    //move down
                //move down
                case 'q':
                    get_results(GET('category'), GET('subcategory'), GET('sort'), GET('q', GET('search', '')), '', GET('order'), GET('commentsearch'));
                    return;
                    // default: // do nothing
            }
            // Process built-in functions
            switch ($func . ":" . GET($func)) {
                case 'comment:add':
                    require "./comment_file.php";
                    return;
                case 'content:add':
                    require "./add_file.php";
                    return;
                case 'content:update':
                    require "./edit_file.php";
                    return;
                case 'content:delete':
                    require "./delete_file.php";
                    return;
                case 'account:settings':
                    require "./user_settings.php";
                    return;
                case 'action:show':
                    show_file(GET("file"), SESSION());
                    return;
                case 'action:register':
                    require "./register.php";
                    return;
                case 'action:browse':
                    // Browsing by category seems is currently only supported "browse" option
                    if (!GET_EMPTY('category')) {
                        get_results(GET('category'), GET('subcategory'), GET('sort'), '', '', GET('order'));
                        return;
                    } else {
                        if (!GET_EMPTY('user')) {
                            get_results(GET('category'), GET('subcategory'), GET('sort'), '', GET('user'), GET('order'));
                            return;
                        }
                    }
                    // default: // do nothing
            }
        }
    }
    // All else fails, show the "Latest Uploads" page
    get_latest();
}
예제 #2
0
    $arr = seller_total($seller_id);
    if ($arr['count'] > 0) {
        $rate = $arr['sum'] / $arr['count'];
    } else {
        $rate = 0;
    }
    return round($rate);
}
if (Params::getParam('seller_rating') == "submit_it") {
    if (osc_is_web_user_logged_in()) {
        $user = Params::getParam('rating_user');
        $seller = Params::getParam('rating_seller');
        $rating = Params::getParam('rating_data');
        if (check_exist($user, $seller)) {
            //UPDATE DATA
            update_rating($seller, $user, $rating);
        } else {
            //INSERT DATA
            insert_rating($seller, $user, $rating);
        }
    }
}
?>


<!-- HTML CODE -->


<!-- JS to add -->
<script type="text/javascript">
  $(document).ready(function(){
예제 #3
0
    $arr = item_total($item_id);
    if ($arr['count'] > 0) {
        $rate = $arr['sum'] / $arr['count'];
    } else {
        $rate = 0;
    }
    return round($rate);
}
if (Params::getParam('item_rating') == "submit_it") {
    if (osc_is_web_user_logged_in()) {
        $user = Params::getParam('rating_user');
        $item = Params::getParam('rating_item');
        $rating = Params::getParam('rating_data');
        if (check_exist($user, $item)) {
            //UPDATE DATA
            update_rating($item, $user, $rating);
        } else {
            //INSERT DATA
            insert_rating($item, $user, $rating);
        }
    }
}
?>



<!-- HTML CODE -->


<!-- JS to add -->
<script type="text/javascript">