Ejemplo n.º 1
0
function om_medals_load_medals_cache()
{
    global $forum_om_medals;
    ($hook = get_hook('om_medals_fn_load_medals_cache_start')) ? eval($hook) : null;
    if (!defined('FORUM_OM_MEDALS_LOADED') && file_exists(FORUM_CACHE_DIR . 'cache_om_medals.php')) {
        include FORUM_CACHE_DIR . 'cache_om_medals.php';
    }
    // Regenerate cache only if the cache is more than 30 minutes old
    if (!defined('FORUM_OM_MEDALS_LOADED')) {
        om_medals_generate_medals_cache();
        require FORUM_CACHE_DIR . 'cache_om_medals.php';
    }
}
Ejemplo n.º 2
0
             om_medals_upload_image_file($_FILES['medal_img'], $medal_tmp_file, $medal_type, $medal_width, $medal_height);
         }
         if (empty($errors)) {
             $query = array('UPDATE' => 'om_medals', 'SET' => 'medal_name=\'' . $forum_db->escape($medal_name) . '\',' . 'medal_desc=\'' . $forum_db->escape($description) . '\',' . 'disp_position=' . $position, 'WHERE' => 'id=' . $medal_id);
             // update image data if image was submitted
             if ($om_medals_image_submitted) {
                 $query['SET'] .= ',medal_type=' . $medal_type . ', medal_width=' . $medal_width . ',medal_height=' . $medal_height;
             }
             ($hook = get_hook('om_medals_add_medal_qr_add_medal')) ? eval($hook) : null;
             $forum_db->query_build($query) or error(__FILE__, __LINE__);
             // move image to new directory (if submitted)
             if ($om_medals_image_submitted) {
                 om_medals_move_image($medal_tmp_file, $medal_id, $medal_type);
             }
             // regenerate medals cache
             om_medals_generate_medals_cache();
             // Add flash message
             $forum_flash->add_info($lang_om_medals['Medal updated']);
             ($hook = get_hook('om_medals_save_medal_pre_redirect')) ? eval($hook) : null;
             redirect(forum_link($forum_url['om_medals_admin'], $medal_id), $lang_om_medals['Medal updated']);
         }
     }
 }
 // Setup the form
 $forum_page['item_count'] = $forum_page['group_count'] = $forum_page['fld_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_admin_common['Start'], forum_link($forum_url['admin_index'])), array($lang_om_medals['Medals'], forum_link($forum_url['om_medals_admin'])), $lang_om_medals['Edit medal']);
 ($hook = get_hook('om_medals_edit_medal_pre_header_load')) ? eval($hook) : null;
 define('FORUM_PAGE_SECTION', 'start');
 define('FORUM_PAGE', 'admin-om_medals');
 require FORUM_ROOT . 'header.php';