Esempio n. 1
0
function om_move_posts_load_cache()
{
    ($hook = get_hook('om_move_posts_fn_load_cache_start')) ? eval($hook) : null;
    if (!defined('OM_MOVE_POSTS_CACHE_LOADED') && file_exists(FORUM_CACHE_DIR . 'cache_om_move_posts.php')) {
        include FORUM_CACHE_DIR . 'cache_om_move_posts.php';
    }
    // Regenerate cache only if it not exists
    if (!defined('OM_MOVE_POSTS_CACHE_LOADED')) {
        om_move_posts_generate_cache();
        require FORUM_CACHE_DIR . 'cache_om_move_posts.php';
    }
    return $om_move_posts_max;
}
Esempio n. 2
0
<?php 
    $forum_id = $fid;
    $tpl_temp = forum_trim(ob_get_contents());
    $tpl_main = str_replace('<!-- forum_main -->', $tpl_temp, $tpl_main);
    ob_end_clean();
    // END SUBST - <!-- forum_main -->
    require FORUM_ROOT . 'footer.php';
}
if (isset($_POST['move_posts_to'])) {
    $move_to_topic = isset($_POST['move_to_topic']) && !empty($_POST['move_to_topic']) ? $_POST['move_to_topic'] : array();
    if (empty($posts)) {
        message($lang_misc['No posts selected']);
    }
    if (!defined('OM_MOVE_POSTS_FUNCTIONS_LOADED')) {
        require $ext_info['path'] . '/functions.php';
    }
    $om_move_posts_max = om_move_posts_load_cache() + 1;
    om_move_posts_generate_cache($om_move_posts_max);
    // Move the posts
    $query = array('UPDATE' => 'posts', 'SET' => 'topic_id=' . $move_to_topic . ', om_move_posts=' . $om_move_posts_max, 'WHERE' => 'id IN(' . implode(',', $posts) . ')');
    if (isset($_POST['change_time'])) {
        $query['SET'] .= ', posted=' . time();
    }
    ($hook = get_hook('move_post_qr_update_post')) ? eval($hook) : null;
    $forum_db->query_build($query) or error(__FILE__, __LINE__);
    sync_topic($tid);
    sync_topic($move_to_topic);
    sync_forum($fid);
    ($hook = get_hook('move_post_end_pre_redirect')) ? eval($hook) : null;
    redirect(forum_link($forum_url['topic'], array($tid, sef_friendly($cur_topic['subject']))), 'Move posts');
}