Esempio n. 1
0
function om_warnings_get_warning_levels()
{
    // check if cache file exists, not - generate it
    if (!file_exists(FORUM_CACHE_DIR . 'cache_om_warnings_levels.php')) {
        om_warnings_generate_levels_cache();
    }
    require FORUM_CACHE_DIR . 'cache_om_warnings_levels.php';
    return $om_warnings_levels;
}
Esempio n. 2
0
            // the admin started editing: we don't want to mess with it
            if (isset($points[$cur_level['id']])) {
                $new_points = $points[$cur_level['id']];
                if ($new_points < 0) {
                    message($lang_om_warnings['Must be integer']);
                }
                // We only want to update if we changed the position
                if ($cur_level['points'] != $new_points) {
                    $query = array('UPDATE' => 'om_warnings_levels', 'SET' => 'points=' . $new_points, 'WHERE' => 'id=' . $cur_level['id']);
                    ($hook = get_hook('om_warnings_update_levels_qr_update_level_points')) ? eval($hook) : null;
                    $forum_db->query_build($query) or error(__FILE__, __LINE__);
                }
            }
        }
        // Regenerate the warnings level cache
        om_warnings_generate_levels_cache();
        // Add flash message
        $forum_flash->add_info($lang_om_warnings['Levels updated']);
        ($hook = get_hook('om_warnings_update_levels_pre_redirect')) ? eval($hook) : null;
        redirect(forum_link($forum_url['om_warnings_levels']), $lang_om_warnings['Levels updated']);
    }
}
// Setup the form
$forum_page['fld_count'] = $forum_page['group_count'] = $forum_page['item_count'] = 0;
// Setup breadcrumbs
$forum_page['crumbs'] = array(array($forum_config['o_board_title'], forum_link($forum_url['index'])), array($lang_admin_common['Forum administration'], forum_link($forum_url['admin_index'])), array($lang_om_warnings['Warnings'], forum_link($forum_url['om_warnings_list'])), array($lang_om_warnings['Warning levels'], forum_link($forum_url['om_warnings_levels'])));
($hook = get_hook('om_warnings_levels_pre_header_load')) ? eval($hook) : null;
define('FORUM_PAGE_SECTION', 'om_warnings');
define('FORUM_PAGE', 'admin-om_warnings_levels');
require FORUM_ROOT . 'header.php';
// START SUBST - <!-- forum_main -->