View Single Post
  #118  
Old 12-09-2004, 01:40 PM
rob_daemon's Avatar
rob_daemon rob_daemon is offline
 
Join Date: Sep 2003
Posts: 197
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try this:

Find from in ./inlinemod.php:

PHP Code:
case 'merge'
To the next 'break;' statement.

Replace all that with:

PHP Code:
case 'merge':
            if (!
can_moderate($threadinfo['forumid'], 'canmanagethreads'))
            {
                
print_no_permission();
            }
            if (!
is_array($vars['threads']) OR count($vars['threads']) < 2)
            {
                eval(
print_standard_error('error_invalidid'));
            }
            
            if (empty(
$_POST['do']))
            {
                
define('PRINT_TPL''inline_merge_thread');
            }
            else
            {
                if (
$_POST['title'])
                {
                    
toss_cookies();
                    
                    
$sqlthreads implode(', '$vars['threads']);
                    
                    
$firstpost $DB_site->query_first("SELECT * FROM " TABLE_PREFIX "post WHERE threadid IN ($sqlthreads) ORDER BY dateline ASC");
                    
                    
// sort out poll crap
                    
$threadsortdata $DB_site->query("SELECT * FROM " TABLE_PREFIX "thread WHERE threadid IN ($sqlthreads) ORDER BY dateline ASC");
                    
$threadopen 1;
                    
$threadsticky 0;
                    while (
$threadsort $DB_site->fetch_array($threadsortdata))
                    {
                        if (!
$firstthread)
                        {
                            
$firstthread $threadsort['threadid'];
                        }
                        else
                        {
                            
$mergethreads[] = $threadsort['threadid'];
                        }
                        if (
$threadsort['pollid'])
                        {
                            eval(
standard_error('The threads you specified to merge have a poll(s). You can not use inline moderation for this type of merge. Sorry!'));
                        }
                        if (!
$threadsort['visible'] OR $threadsort['isdeleted'])
                        {
                            eval(
standard_error('You can not merge invisible or deleted threads.'));
                        }
                        
                        
// if any thread is sticky or closed, then the new thread is
                        
if ($threadsort['sticky'])
                        {
                            
$threadsticky 1;
                        }
                        if (!
$threadsort['open'])
                        {
                            
$threadopen 0;
                        }
                        
                        
$votenum += $threadsort['votenum'];
                        
$votetotal += $threadsort['votetotal'];
                        
$views += $threadsort['views'];
                        
$rebuildposts[] = $threadsort['firstpostid'];
                    }
                    
                    
$isqlthreads implode(', '$mergethreads);
                    
                    
// post updates...
                    
$DB_site->query("UPDATE " TABLE_PREFIX "post SET threadid = $firstthread WHERE threadid IN ($sqlthreads)");
                    
                    
// set post parentids
                    
$DB_site->query("UPDATE " TABLE_PREFIX "post SET parentid = $firstpost[postid] WHERE threadid = $firstthread AND postid <> $firstpost[postid] AND parentid IN (" implode(', '$rebuildposts) . ")");
                    
                    
// update new thread
                    
$DB_site->query("UPDATE " TABLE_PREFIX "thread SET title = '" addslashes(htmlspecialchars_uni($_POST['title'])) . "', views = $views, open = $threadopen, sticky = $threadsticky, iconid = 0, votenum = $votenum, votetotal = $votetotal WHERE threadid = $firstthread");
                    
                    
// remove old threads
                    
$DB_site->query("DELETE FROM " TABLE_PREFIX "thread WHERE threadid IN ($isqlthreads)");
                    
                    
// thread ratings
                    
$DB_site->query("DELETE FROM " TABLE_PREFIX "threadrate WHERE threadid IN ($isqlthreads)");
                    
                    
// subscriptions
                    
$DB_site->query("UPDATE " TABLE_PREFIX "subscribethread SET threadid = $firstthread WHERE threadid IN ($isqlthreads)");
                    
                    
// lots-o-updating
                    
foreach ($rebuildposts AS $postid)
                    {
                        
delete_post_index($postid);
                        
build_post_index($postid$vars['forum']);
                    }
                    
                    
build_thread_counters($firstthread);
                    
build_forum_counters($vars['forum']['forumid']);
                    
                    
$url "showthread.php?$session[sessionurl]t=$firstthread&mod=1";
                    eval(
print_standard_redirect('redirect_mergethread'));
                }
                else
                {
                    eval(
standard_error('You did not specify a title!'));
                }
            }
        break; 
I hope that fixes it. Let me know .
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01279 seconds
  • Memory Usage 1,864KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete