Ejemplo n.º 1
0
function om_warnings_get_warning_types()
{
    // check if cache file exists, not - generate it
    if (!file_exists(FORUM_CACHE_DIR . 'cache_om_warnings_types.php')) {
        om_warnings_generate_types_cache();
    }
    require FORUM_CACHE_DIR . 'cache_om_warnings_types.php';
    return $om_warnings_types;
}
Ejemplo n.º 2
0
     }
     if ($points < 0) {
         message($lang_om_warnings['Must be integer']);
     }
     if ($expire < 0) {
         $expire = 0;
     }
     if (!is_null($restriction) && !array_key_exists($restriction, om_warnings_get_restrictions())) {
         message($lang_common['Bad request']);
     }
     // Update warning type in database
     $query = array('UPDATE' => 'om_warnings_types', 'SET' => 'warn_name=\'' . $forum_db->escape($warn_name) . '\', warn_desc=\'' . $forum_db->escape($warn_desc) . '\', points=' . $points . ', expire=' . $expire . ', restriction=' . (is_null($restriction) ? 'NULL' : '\'' . $forum_db->escape($restriction) . '\''), 'WHERE' => 'id=' . $type_id);
     ($hook = get_hook('om_warnings_add_type_qr_add_type')) ? eval($hook) : null;
     $forum_db->query_build($query) or error(__FILE__, __LINE__);
     // Regenerate the warnings types cache
     om_warnings_generate_types_cache();
     // Add flash message
     $forum_flash->add_info($lang_om_warnings['Type saved']);
     ($hook = get_hook('om_warnings_add_type_pre_redirect')) ? eval($hook) : null;
     redirect(forum_link($forum_url['om_warnings_types']), $lang_om_warnings['Type saved']);
 }
 // Setup the form for editing
 $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 types'], forum_link($forum_url['om_warnings_types'])));
 ($hook = get_hook('om_warnings_types_edit_pre_header_load')) ? eval($hook) : null;
 define('FORUM_PAGE_SECTION', 'om_warnings');
 define('FORUM_PAGE', 'admin-om_warnings_types');
 require FORUM_ROOT . 'header.php';
 // START SUBST - <!-- forum_main -->
 ob_start();