vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Inline Moderation Tools (v1.2.1) (https://vborg.vbsupport.ru/showthread.php?t=68791)

rob_daemon 11-15-2004 04:21 AM

Yes, the current version does not cache the templates and I have fixed that. Currently the project is a mess in development and I'm trying to clean it up and release a new version which will fix a ton of bugs and add some features.

As far as limiting the power, they only have access to the tools that they'd have in the "Thread Tools" popup menu. Do you want to prevent them from using inline moderation all together?

And don't forget to click install ;).

Zoints 11-15-2004 04:35 AM

Quote:

Originally Posted by rob_daemon
Yes, the current version does not cache the templates and I have fixed that. Currently the project is a mess in development and I'm trying to clean it up and release a new version which will fix a ton of bugs and add some features.

As far as limiting the power, they only have access to the tools that they'd have in the "Thread Tools" popup menu. Do you want to prevent them from using inline moderation all together?

And don't forget to click install ;).

Yes, i'd like to limit them from seeing/using the inline tools altogether. I only want my REAL mods, supermods, and admin to see it.

And I just licked install.

*edit* and clicked it

theArchitect 11-15-2004 04:59 AM

I have finally sourced the error that was causing the error in the inline.js file.
Code:

// ################################################################### // Set the name of the go button function write_button(avalue)
  {
  fetch_object("inline_go").value = "Go (" + avalue + ")";
 }

Everytime my friend tries to access a thread he got and error message, and the above code was what his debugger returned.

Your help with this would be apprecaited.

Zoints 11-15-2004 08:24 AM

Nevermind, I got it figured out. Thanks again for a great hack.

rob_daemon 11-15-2004 01:55 PM

theArchitect: when does this happen? Does he press the checkboxes or does this only occur when the page loads? Is he a moderator and does he have access to the inline tools?

thegunowner149: glad you got it working, the new version has a usergroup setting to control the usage of inline moderation tools.

theArchitect 11-16-2004 12:15 PM

Quote:

Originally Posted by rob_daemon
theArchitect: when does this happen? Does he press the checkboxes or does this only occur when the page loads? Is he a moderator and does he have access to the inline tools?

thegunowner149: glad you got it working, the new version has a usergroup setting to control the usage of inline moderation tools.

It happens on most pages for him, but mainly when replying to a post or creating a thread.

He is not a moderator and does not have access to the inline tools.

Hope this helps with the trouble shooting.

rob_daemon 11-16-2004 01:50 PM

I'll hopefully have the new version of the tools out by next Tuesday. Hopefully that'll fix the problem. It will not show any of the tool items or load any of the scripts unless the user has moderator powers in that specific forum. I'll also do some rigorous JavaScript testing in IE6 with high security settings, etc.

theArchitect 11-17-2004 12:53 AM

Quote:

Originally Posted by rob_daemon
I'll hopefully have the new version of the tools out by next Tuesday. Hopefully that'll fix the problem. It will not show any of the tool items or load any of the scripts unless the user has moderator powers in that specific forum. I'll also do some rigorous JavaScript testing in IE6 with high security settings, etc.

Many Thanks for your support.

Zoints 11-17-2004 06:15 AM

I'm getting the same error as theArchitect. I can give a lot more information on it.

It only occurs with IE. It occurs when loading forumdisplay.php and showthread.php pages.

MY exact error is:

Code:

Line: 94
Char: 2
Error: Null is null or not an object
Code: 0

It's a problem with inline_moderation.js -- It's trying to set the value of a button called inline_go but the button doesn't exist on the pages anywhere.

Ideas how to fix it?

rob_daemon 11-17-2004 06:16 PM

As I stated above, it will be fixed in the future. Thanks for the information :). This is the new version of write_button() in inline_moderation.js. Replace this:

Code:

// ###################################################################
// Set the name of the go button
function write_button(avalue)
{
        fetch_object("inline_go").value = "Go (" + avalue + ")";
}

With:

Code:

// ###################################################################
// Set the name of the go button
function write_button(avalue)
{
        if (thebutton = fetch_object("inline_go"))
        {
                thebutton.value = "Go (" + avalue + ")";
        }
}

That should do the trick, but I have yet to test it on IE.

Zoints 11-17-2004 07:51 PM

That fixed it rob_daemon, thank you! Great support.

rob_daemon 11-18-2004 05:08 AM

Glad that fixed it up :).

Zoints 11-22-2004 05:29 AM

Here's a troublesome bug. I found today when doing an IP search that some people were showing as having posted under other's IP's, including admin, supermods, and such. I thought there was an exploit until I investigated and found it was a bug with this hack. When merging posts, you use:

Code:

$DB_site->query("UPDATE " . TABLE_PREFIX . "post SET pagetext = '" . addslashes($_POST['finalpost']) . "', userid = " . intval($_POST['mergeuser']) . ", title = '" . addslashes(htmlspecialchars_uni($_POST['title'])) . "' WHERE postid = {$vars['newpost']['postid']}");
However, it just updates the userid, but not the username which wreaks all kinds of havok.

rob_daemon 11-22-2004 09:08 PM

Quote:

Originally Posted by thegunowner149
Here's a troublesome bug. I found today when doing an IP search that some people were showing as having posted under other's IP's, including admin, supermods, and such. I thought there was an exploit until I investigated and found it was a bug with this hack. When merging posts, you use:

Code:

$DB_site->query("UPDATE " . TABLE_PREFIX . "post SET pagetext = '" . addslashes($_POST['finalpost']) . "', userid = " . intval($_POST['mergeuser']) . ", title = '" . addslashes(htmlspecialchars_uni($_POST['title'])) . "' WHERE postid = {$vars['newpost']['postid']}");
However, it just updates the userid, but not the username which wreaks all kinds of havok.

Thanks. I've set it to now update all the user-based fields. The new update should be coming either today or tomorrow :).

theArchitect 11-27-2004 09:18 PM

Quote:

Originally Posted by rob_daemon
Thanks. I've set it to now update all the user-based fields. The new update should be coming either today or tomorrow :).

Sorry to bug you, I know that you are busy with School, but do you have an eta on the update?

sv1cec 12-03-2004 06:17 AM

I just installed this hack, and it is a God-send, thank you.

Just one suggestion, instead of using can_moderate(), why don't you use can_moderate($forumid, '', $bbuserinfo[userid])? In that way, the checkboxes etc. will appear only in the forums that the moderator can actually moderate. This works in forumdisplay, etc. In postbit and postbit_legacy, use can_moderate($forum[forumid], '', $bbuserinfo[userid]).

I also noticed a dangerous issue here. A moderator can delete a post, which is made by an administrator or a super moderator. I am sure you wouldn't like this happening. I am working on finding a way to prevent that.

Now, I am going to see what I can do about the search results thing.

Rgds
----------
John
SV1CEC

rob_daemon 12-03-2004 10:01 PM

For the first bit: yes, as I stated above the new version that I hope to release this weekend does take care of that by having a conditions that attend to that.

For the second bit: That's how the vB permission system works. If a moderator can delete posts, he or she is eligible to delete any posts, regardless of the users' rank.

sv1cec 12-04-2004 04:27 AM

Quote:

Originally Posted by rob_daemon
For the first bit: yes, as I stated above the new version that I hope to release this weekend does take care of that by having a conditions that attend to that.

For the second bit: That's how the vB permission system works. If a moderator can delete posts, he or she is eligible to delete any posts, regardless of the users' rank.

Rob,

You are right on the last issue, I did some checks yesterday. It's not difficult however, to add some functionality over vB's standard permissions. For example, in my Advanced Warning Hack, I use an hierarchical warning schema, where the admins can warn everyone, the Super mods can warn mods and simple users and the mods can warn only simple users.

Actually, I had modified your code yesterday, enough to have it working like this, a simple mod couldn't delete an admin's thread or post etc. Then I screwed up something and had to remove the code from the forumdisplay and threadbits, but it still works in the postbit part. If you want, I can work with you on that, later today, it requires a couple of modifications in the forumdisplay query that gets the threads and then some conditionals in the forumdisplay, threadbit and threadbit_deleted templates.

I plan to do them for my system today, since the twins will be at their grandmother (peace of mind), so if you want, they are all yours.

Rgds
-------------

John

rob_daemon 12-04-2004 08:51 AM

Thanks for the offer, but I like to keep the permissions system based on the true vB3 permissions set to prevent confusion (both on my end and the users'). You're more than welcome to post the changes in the thread, though.

sv1cec 12-04-2004 10:18 AM

Quote:

Originally Posted by rob_daemon
Thanks for the offer, but I like to keep the permissions system based on the true vB3 permissions set to prevent confusion (both on my end and the users'). You're more than welcome to post the changes in the thread, though.

I have one question. An admin of one forum cannot delete a thread from the forumdisplay, while he can from the thread tools within the thread. I checked your code in inlinemod.php and it appears that you are using the following conditional:

PHP Code:

if (!can_moderate($vars['forumid'], 'canremoveposts'))
{
    
print_no_permission();


Wouldn't that check for permanent deletion? I suppose that you should use candeleteposts, instead of canremoveposts, but I am not sure. Can you please clarify?

Rgds and tnx

rob_daemon 12-04-2004 11:10 AM

Quote:

Originally Posted by sv1cec
I have one question. An admin of one forum cannot delete a thread from the forumdisplay, while he can from the thread tools within the thread. I checked your code in inlinemod.php and it appears that you are using the following conditional:

PHP Code:

if (!can_moderate($vars['forumid'], 'canremoveposts'))
{
    
print_no_permission();


Wouldn't that check for permanent deletion? I suppose that you should use candeleteposts, instead of canremoveposts, but I am not sure. Can you please clarify?

Rgds and tnx

Thanks for catching that. It should be candeleteposts, not canremoveposts; hard delete is a separate entity.

Dean C 12-04-2004 11:18 AM

Thankyou for sharing your work with the community :)

sv1cec 12-07-2004 07:16 AM

Quote:

Originally Posted by Dean C
Thankyou for sharing your work with the community :)

Do we have an ETA for the merge threads option?

Tnx
---------
John

rob_daemon 12-07-2004 01:48 PM

Quote:

Originally Posted by sv1cec
Do we have an ETA for the merge threads option?

Tnx
---------
John

Merging threads is in the next version. I was planning to release it last night, but after six hours of homework I really wasn't up for it. Should be updated this evening.

sv1cec 12-07-2004 02:21 PM

Quote:

Originally Posted by rob_daemon
Merging threads is in the next version. I was planning to release it last night, but after six hours of homework I really wasn't up for it. Should be updated this evening.

Thanks for your response, I know it is hard for you, given your school obligations.

No hurry for me, I came up with my own version, but I would be interested to see how it compares with yours. If you need the code, please let me know.

Rgds
-----------
John

sv1cec 12-08-2004 06:12 AM

I am not sure if someone would be interested in that, but I noticed that if you do a search and come up with the results, then you do an inline moderation action, like delete a thread (supposing you are allowed to do that), then you are no longer returned to the search results, but to the forums home page.

That bothered me, since I use the search to find all posts since yesterday, and I want to return there to check for more.

What I came up with, is that you may catch up the fact that you called the inlinemod.php from the search results, and have the program return you there. All you have to do is to pass a hidden parameter from the search_results template form to inlinemod.php.

Here is what you have to do:

Open your search_results template and find:

HTML Code:

<input type="hidden" name="unsafe" value="1" />
Right below that, add:

HTML Code:

<input type="hidden" name="searchid" value="$searchid" />
Save the template. Now open your inlinemod.php file and find:

PHP Code:

if ($_POST['type'] == 'thread')
{
    
// Set our globals
    
$vars['inlineid'] = htmlspecialchars_uni($_COOKIE['bbinlineid']);
    
$vars['forumid'] = intval(end(explode('_'$vars['inlineid'])));
    
$vars['action'] = htmlspecialchars_uni($_POST['inlinemodact']);
    
$vars['forum'] = fetch_foruminfo($vars['forumid']); 

Right below that, add:

PHP Code:

    $searchid=$_POST['searchid']; 

Further down in the same file, find:

PHP Code:

if ($vars['forumid'])
    {
        
$url "forumdisplay.php?$session[sessionurl]f=$vars[forumid]&mod=1";
    } 

Replace all occurences of that piece of code, with:

PHP Code:

if ($vars['forumid'])
    {
            
$url "forumdisplay.php?$session[sessionurl]f=$vars[forumid]&mod=1";
    }
if (
$searchid!='')
    {
        
$url "search.php?searchid=$searchid";
    } 

Now everytime you went to inlinemod.php from a search results page, you will be returned to your search results, after the inline moderation action is completed.

Rgds
---------
John

rob_daemon 12-08-2004 06:16 AM

Alrighty! At long last, here it is! Inline Moderation Tools 1.2.0 should resolve all of the JavaScript users were having. Check boxes now only display when they need to, all templates are now cached, thread merging has been added (however, threads with polls it will not merge because it was too much work to figure out all of that logic), it removed search results moderation (sorry but this was a security hole that needed to be closed (if you want it enabled, I can explain how for you)), and a few other various fixes.

Upgrade instructions as well as fresh install ones are in the ZIP. Don't forget to click install!

sv1cec 12-08-2004 07:48 AM

Quote:

Originally Posted by rob_daemon
Alrighty! At long last, here it is! Inline Moderation Tools 1.2.0 should resolve all of the JavaScript users were having. Check boxes now only display when they need to, all templates are now cached, thread merging has been added (however, threads with polls it will not merge because it was too much work to figure out all of that logic), it removed search results moderation (sorry but this was a security hole that needed to be closed (if you want it enabled, I can explain how for you)), and a few other various fixes.

Upgrade instructions as well as fresh install ones are in the ZIP. Don't forget to click install!

Terrific,

Just change your instruction in global.php, it should say:

PHP Code:

if (THIS_SCRIPT == 'showthread' OR THIS_SCRIPT == 'forumdisplay')
{
    
$show['inlinemod'] = true;
}
else
{
    
$show['inlinemod'] = false;


you use forumdisplay.php, while the script name is forumdisplay.

Rgds

Revan 12-08-2004 09:05 AM

Great, thanks for the update :) And thank you for that fix sv1, dunno if I'd notice that on my own, well now we dont have to find out ;)

Small suggestion: Getting rid of the .DS_Store files to save zip space :p
PS: I just wanted to say, whatever you did to the install HTML file, thank you! You have no idea how great it is to be able to use Crtl+A inside a textarea to fetch only the text inside that :D Oooh me happy now :D
*ahem*
Ill go away now :p

WebMasterAJ 12-08-2004 12:00 PM

Hello -

I've installed this hack, but for some reason nothing displays at all. Am I supposed to activate it someway?

Please let me know!

Thank you for your time and energy!

rob_daemon 12-08-2004 01:27 PM

Quote:

Originally Posted by sv1cec
Terrific,

Just change your instruction in global.php, it should say:

PHP Code:

if (THIS_SCRIPT == 'showthread' OR THIS_SCRIPT == 'forumdisplay')
{
    
$show['inlinemod'] = true;
}
else
{
    
$show['inlinemod'] = false;


you use forumdisplay.php, while the script name is forumdisplay.

Rgds

Thanks sv1ec, I thought I had changed the upgrade XML file, guess not. I'll do so and then rebuild the HTML instructions :).

Raven: I guess that's a bug in my ZIP packager then for not removing .DS_Store. I'll get rid of it when I repackage the zip tonight. Glad you like the installer :D. I love being able to do Apple/Control + A to select all the text, too. It's so much easier :D.

WebMasterAJ: If you are upgrading, make sure that in global.php the following:

PHP Code:

// #############################################################################
// are we on a script that uses inline moderation
if (THIS_SCRIPT == 'showthread.php' OR THIS_SCRIPT == 'forumdisplay.php')
{
    
$show['inlinemod'] = true;
}
else
{
    
$show['inlinemod'] = false;


Is actually:

PHP Code:

// #############################################################################
// are we on a script that uses inline moderation
if (THIS_SCRIPT == 'showthread' OR THIS_SCRIPT == 'forumdisplay')
{
    
$show['inlinemod'] = true;
}
else
{
    
$show['inlinemod'] = false;



sv1cec 12-08-2004 03:18 PM

I think I found one more little thing. In the threadbit template, your instructions (at least for those upgrading from 1.1.0) ask us to enter:

HTML Code:

<if condition="can_moderate($thread['forumid'])">
                        <td class="alt1" align="center"><if condition="$show['threadmoved']">-<else /><input type="checkbox" id="inlinemod_$thread[threadid]" name="inlinemod_$thread[threadid]" value="1" onclick="select_item($thread[threadid], this);" /></if>
                </if>

I think this should be:

HTML Code:

<if condition="(can_moderate($thread['forumid']) AND $show['inlinemod'])">
                        <td class="alt1" align="center"><if condition="$show['threadmoved']">-<else /><input type="checkbox" id="inlinemod_$thread[threadid]" name="inlinemod_$thread[threadid]" value="1" onclick="select_item($thread[threadid], this);" /></if>
                </if>

or else the checkboxes will appear in the search results.

Rgds

rob_daemon 12-08-2004 03:39 PM

Quote:

Originally Posted by sv1cec
I think I found one more little thing. In the threadbit template, your instructions (at least for those upgrading from 1.1.0) ask us to enter:

HTML Code:

<if condition="can_moderate($thread['forumid'])">
                        <td class="alt1" align="center"><if condition="$show['threadmoved']">-<else /><input type="checkbox" id="inlinemod_$thread[threadid]" name="inlinemod_$thread[threadid]" value="1" onclick="select_item($thread[threadid], this);" /></if>
                </if>

I think this should be:

HTML Code:

<if condition="(can_moderate($thread['forumid']) AND $show['inlinemod'])">
                        <td class="alt1" align="center"><if condition="$show['threadmoved']">-<else /><input type="checkbox" id="inlinemod_$thread[threadid]" name="inlinemod_$thread[threadid]" value="1" onclick="select_item($thread[threadid], this);" /></if>
                </if>

or else the checkboxes will appear in the search results.

Rgds

Thanks. It was hard to remember what I changed and what I didn't as there's no easy way to diff between templates.

sv1cec 12-08-2004 03:43 PM

Quote:

Originally Posted by rob_daemon
Thanks. It was hard to remember what I changed and what I didn't as there's no easy way to diff between templates.

Don't worry, I know what you mean. And your hack touches 4-5 templates, mine deals with about 20 of them.

Rgds

rob_daemon 12-09-2004 12:00 AM

Okay, the ZIP should now be all fixed with those two problems with the instructions and the .DS_Store files are now removed :).

sv1cec 12-09-2004 11:43 AM

I am getting the following error when trying to merge two threads (IDs are: 1791 and 1793)

Database error in vBulletin 3.0.3:

Invalid SQL: UPDATE subscribethread SET threadid = 1791 WHERE threadid IN (1793, 1791)
mysql error: Duplicate entry '1-1791' for key 2

mysql error number: 1062

Date: Thursday 09th of December 2004 08:42:23 AM
Script: http://forum.m1911.org/inlinemod.php
Referer: http://forum.m1911.org/inlinemod.php
Username: John
IP Address: 62.38.176.245

Any idea?

Rgds

rob_daemon 12-09-2004 01:40 PM

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 :).

sv1cec 12-09-2004 02:17 PM

Quote:

Originally Posted by rob_daemon
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 :).

Sorry, this time the error message is:

Database error in vBulletin 3.0.3:

Invalid SQL: UPDATE subscribethread SET threadid = 1799 WHERE threadid IN (1800)
mysql error: Duplicate entry '1-1799' for key 2

mysql error number: 1062

Date: Thursday 09th of December 2004 11:16:10 AM
Script: http://forum.m1911.org/inlinemod.php
Referer: http://forum.m1911.org/inlinemod.php
Username: John
IP Address: 62.38.176.245

rgds

rob_daemon 12-09-2004 02:43 PM

Quote:

Originally Posted by sv1cec
Sorry, this time the error message is:

Database error in vBulletin 3.0.3:

Invalid SQL: UPDATE subscribethread SET threadid = 1799 WHERE threadid IN (1800)
mysql error: Duplicate entry '1-1799' for key 2

mysql error number: 1062

Date: Thursday 09th of December 2004 11:16:10 AM
Script: http://forum.m1911.org/inlinemod.php
Referer: http://forum.m1911.org/inlinemod.php
Username: John
IP Address: 62.38.176.245

rgds

Honestly, I have on idea. Try finding:

PHP Code:

                    $DB_site->query("UPDATE " TABLE_PREFIX "subscribethread SET threadid = $firstthread WHERE threadid IN ($isqlthreads)"); 

Replace it with:

PHP Code:

                    $subs $DB_site->query("SELECT * FROM " TABLE_PREFIX "subscribethread WHERE threadid IN ($isqlthreads)");
                    while (
$sub $DB_site->fetch_array($subs))
                    {
                        
$subthreads[] = $sub['subscribethread'];
                    }
                    
$DB_site->query("UPDATE " TABLE_PREFIX "subscribethread SET threadid = $firstthread WHERE subscribethread IN ($subthreads)"); 


sv1cec 12-09-2004 02:59 PM

Quote:

Originally Posted by rob_daemon
Honestly, I have on idea. Try finding:

PHP Code:

                    $DB_site->query("UPDATE " TABLE_PREFIX "subscribethread SET threadid = $firstthread WHERE threadid IN ($isqlthreads)"); 

Replace it with:

PHP Code:

                    $subs $DB_site->query("SELECT * FROM " TABLE_PREFIX "subscribethread WHERE threadid IN ($isqlthreads)");
                    while (
$sub $DB_site->fetch_array($subs))
                    {
                        
$subthreads[] = $sub['subscribethread'];
                    }
                    
$DB_site->query("UPDATE " TABLE_PREFIX "subscribethread SET threadid = $firstthread WHERE subscribethread IN ($subthreads)"); 


Nope!

Database error in vBulletin 3.0.3:

Invalid SQL: UPDATE subscribethread SET threadid = 281 WHERE subscribethread IN (Array)
mysql error: Unknown column 'subscribethread' in 'where clause'

mysql error number: 1054

Date: Thursday 09th of December 2004 11:57:56 AM
Script: http://forum.m1911.org/inlinemod.php
Referer: http://forum.m1911.org/inlinemod.php
Username: John
IP Address: 62.38.176.245


All times are GMT. The time now is 04:07 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02643 seconds
  • Memory Usage 2,070KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code_printable
  • (6)bbcode_html_printable
  • (18)bbcode_php_printable
  • (18)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete