winnie Опубликовано 2 Августа 2004 Жалоба Поделиться Опубликовано 2 Августа 2004 есть такой мод неплохой http://mods.invisionize.com/db/index.php/f/3091он удаляет старые темы из форума-корзиныно в нем одна недоработка есть - после удаления тем не делается ресинхронизация форума.. и в итоге-глюки вообщем исправление очень простое..после строчки 83 $modfunc->topic_delete($tid_array);вставляем $modfunc->forum_recount($ibforums->vars['forum_trash_can_id']); все ... Цитата Ссылка на комментарий Поделиться на других сайтах Прочее
Roix Опубликовано 3 Августа 2004 Жалоба Поделиться Опубликовано 3 Августа 2004 ты на их форуме напиши есчё Цитата Ссылка на комментарий Поделиться на других сайтах Прочее
winnie Опубликовано 11 Августа 2004 Автор Жалоба Поделиться Опубликовано 11 Августа 2004 кхм.. вообщем тут как оказалось все не так просто задача работает по разному если ее запускать из админки или если запускать по крону.. ресиннхронизация форума не проводится, статистика не считается..как исправитьвообщем заменяем в файле задачи функцию function run_task() на ниже лежащий код... после все пересчитывается и ресинхронизируется.. извиняюсь за большой пост но как понял другой способ со скроллерами глючит function run_task() { global $DB, $ibforums, $std, $taskinfo; //--------------------------------------- // Include the modfunctions file //--------------------------------------- require_once ( $this->root_path.'sources/lib/modfunctions.php'); $modfunc = new modfunctions(); //--------------------------------------- // Run the SQL query and delete the topics //--------------------------------------- $time = time()-(60*60*24*$taskinfo['days']); $batch = $DB->query("SELECT tid FROM ibf_topics WHERE forum_id=".$ibforums->vars['forum_trash_can_id']." AND start_date<".$time); $tid_array = array(); while ( $tid = $DB->fetch_row() ) { $tid_array[] = $tid['tid']; } if (Count($tid_array)>0) { //################################################### //---------------------------------------------- // @topic_delete: deletetopic ID(s) $modfunc->topic_delete($tid_array,1); //################################################### //---------------------------------------------- // @forum_recount: Recount topic & posts in a forum $fid = intval($ibforums->vars['forum_trash_can_id']); //---------------------------------------------- // Get the topics.. //---------------------------------------------- $topics = $DB->simple_exec_query( array( 'select' => 'COUNT(*) as count', 'from' => 'topics', 'where' => "approved=1 and forum_id=$fid" ) ); //---------------------------------------------- // Get the QUEUED topics.. //---------------------------------------------- $queued_topics = $DB->simple_exec_query( array( 'select' => 'COUNT(*) as count', 'from' => 'topics', 'where' => "approved=0 and forum_id=$fid" ) ); //---------------------------------------------- // Get the posts.. //---------------------------------------------- $posts = $DB->simple_exec_query( array( 'select' => 'SUM(posts) as replies', 'from' => 'topics', 'where' => "approved=1 and forum_id=$fid" ) ); //---------------------------------------------- // Get the QUEUED posts.. //---------------------------------------------- $queued_posts = $DB->simple_exec_query( array( 'select' => 'SUM(topic_queuedposts) as replies', 'from' => 'topics', 'where' => "forum_id=$fid" ) ); //---------------------------------------------- // Get the forum last poster.. //---------------------------------------------- $DB->simple_construct( array( 'select' => 'tid, title, last_poster_id, last_poster_name, last_post', 'from' => 'topics', 'where' => "approved=1 and forum_id=$fid", 'order' => 'last_post DESC', 'limit' => array( 0,1 ) ) ); $DB->simple_exec(); $last_post = $DB->fetch_row(); //---------------------------------------------- // Reset this forums stats //---------------------------------------------- $dbs = array( 'last_poster_id' => $last_post['last_poster_id'], 'last_poster_name' => $last_post['last_poster_name'], 'last_post' => $last_post['last_post'], 'last_title' => $last_post['title'], 'last_id' => $last_post['tid'], 'topics' => intval($topics['count']), 'posts' => intval($posts['replies']), 'queued_topics' => intval($queued_topics['count']), 'queued_posts' => intval($queued_posts['replies']), ); $DB->do_update( 'forums', $dbs, "id=".$fid ); //---------------------------------------- // Update forum cache //---------------------------------------- foreach( $dbs as $k => $v ) { $ibforums->cache['forum_cache'][ $fid ][ $k ] = $v; } $std->update_cache( array( 'name' => 'forum_cache', 'array' => 1, 'deletefirst' => 0, 'donow'=>1 ) ); //################################################### //---------------------------------------------- // @stats_recount: Recount all topics & posts $topics = $DB->simple_exec_query( array( 'select' => 'count(tid) as tcount', 'from' => 'topics', 'where' => "approved = 1" ) ); $posts = $DB->simple_exec_query( array( 'select' => 'count(pid) as replies', 'from' => 'posts', 'where' => "queued <> 1" ) ); $ibforums->cache['stats']['total_topics'] = intval($topics['tcount']); $ibforums->cache['stats']['total_replies'] = intval($posts['replies'])-intval($topics['tcount']); $std->update_cache( array( 'name' => 'stats', 'array' => 1, 'deletefirst' => 0, 'donow'=>1 ) ); //--------------------------------------- // Log to log table - modify but dont delete //--------------------------------------- $this->class->append_task_log( $this->task, 'Trash Can topics deleted' ); } } Цитата Ссылка на комментарий Поделиться на других сайтах Прочее
d1pro Опубликовано 11 Августа 2004 Жалоба Поделиться Опубликовано 11 Августа 2004 По-моему у этого хака был глюк. Там настройки вне функций и вне класса указывались, так они в функции пустыми оказывались... Цитата Ссылка на комментарий Поделиться на других сайтах Прочее
Рекомендуемые сообщения
Присоединиться к обсуждению
Вы можете ответить сейчас, а зарегистрироваться позже. Если у вас уже есть аккаунт, войдите, чтобы ответить от своего имени.