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 12-09-2004 03:07 PM

Quote:

Originally Posted by sv1cec
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

Replace

PHP Code:

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

With:

PHP Code:

$DB_site->query("UPDATE " TABLE_PREFIX "subscribethread SET threadid = $firstthread WHERE subscribethread IN (" implode(', '$subthreads) . ")"); 

And if that doesn't work, then just change:

PHP Code:

$DB_site->query("UPDATE " TABLE_PREFIX "subscribethread SET threadid = $firstthread WHERE subscribethread IN (" implode(', '$subthreads) . ")"); 

To:

PHP Code:

// $DB_site->query("UPDATE " . TABLE_PREFIX . "subscribethread SET threadid = $firstthread WHERE subscribethread IN (" . implode(', ', $subthreads) . ")"); 


sv1cec 12-09-2004 04:41 PM

Quote:

Originally Posted by rob_daemon
Replace

PHP Code:

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

With:

PHP Code:

$DB_site->query("UPDATE " TABLE_PREFIX "subscribethread SET threadid = $firstthread WHERE subscribethread IN (" implode(', '$subthreads) . ")"); 

And if that doesn't work, then just change:

PHP Code:

$DB_site->query("UPDATE " TABLE_PREFIX "subscribethread SET threadid = $firstthread WHERE subscribethread IN (" implode(', '$subthreads) . ")"); 

To:

PHP Code:

// $DB_site->query("UPDATE " . TABLE_PREFIX . "subscribethread SET threadid = $firstthread WHERE subscribethread IN (" . implode(', ', $subthreads) . ")"); 


Can you please check your code in inlinemod.php? for example:

PHP Code:

case 'move':
            if (!
can_moderate($threadinfo['forumid'], 'canmanagethreads')) 

PHP Code:

case 'open':
            if (!
can_moderate($vars['forumid'], 'canopenclose')) 

In the first case, you check for $threadinfo['forumid'] and in the second you check for vars['forumid']. I think the second is the correct, but should it be replaced in all thread-related cases?

sv1cec 12-09-2004 05:20 PM

OK, here is the code I came up with, it is mostly based on the postings.php code, with some mods to make it suitable for more than two threads.

PHP Code:

        case 'merge':

            if (!
can_moderate($vars['forumid'], 'canmanagethreads'))
            {
                
print_no_permission();
            }
            if (!
is_array($vars['threads']))
            {
                eval(
print_standard_error('error_invalidid'));
            }
            if (empty(
$_POST['do']))
            {
                
define('PRINT_TPL''inline_merge_thread');
            }
            else
            {
            
toss_cookies();
                    
            
$sqlthreads implode(', '$vars['threads']);
            
            
$firstpost $DB_site->query_first("SELECT * FROM " TABLE_PREFIX "post WHERE threadid IN ($sqlthreads) ORDER BY dateline ASC");
            
$notes=$firstpost['notes'];
            
$thrd_firstpost=$firstpost['postid'];
            
$oldtitle=$firstpost['title'];
            
$notes=$firstpost['notes'];
            
$title=$_POST['title'];
            
$threadid=$firstpost['threadid'];
            
$newnotes sprintf('Thread merged from other threads by %1$s on %2$s at %3$s via Moderation Tool.'$bbuserinfo['username'], vbdate($vboptions['dateformat'], TIMENOW), vbdate($vboptions['timeformat'], TIMENOW));
            
$newnotes .= $notes;

            if (
$title=='')
            {
                
$title=$oldtitle;
            }

            foreach (
$vars['threads'] AS $mergethreadid)
            {
                if (
$mergethreadid!=$threadid)
                {
                    
$mergethreadid verify_id('thread'$mergethreadid);
                    
$mergethreadinfo fetch_threadinfo($mergethreadid);
                    
$mergeforuminfo fetch_foruminfo($mergethreadinfo['forumid']);
                
                    if (!
$mergethreadinfo['visible'] OR $mergethreadinfo['isdeleted'] OR $mergethreadid == $threadid)
                    {
                        eval(
print_standard_error('error_invalidid'));
                    }
                
                    
// check forum permissions for the merge forum
                    
$mergeforumperms fetch_permissions($mergethreadinfo['forumid']);
                    if (!(
$mergeforumperms CANVIEW) OR !can_moderate($mergethreadinfo['forumid'], 'canmanagethreads'))
                    {
                        
print_no_permission();
                    }
                
                    
// check if there is a forum password and if so, ensure the user has it set
                    
verify_forum_password($mergeforuminfo['forumid'], $mergeforuminfo['password']);
                    
$mrgthrd_firstpost $DB_site->query_first("
                        SELECT postid
                        FROM " 
TABLE_PREFIX "post
                        WHERE threadid = 
$mergethreadinfo[threadid]
                        ORDER BY dateline ASC
                    "
);
                
                    
// sort out polls
                    
$pollcode '';
                    if (
$mergethreadinfo['pollid'] != 0)
                    { 
// merge thread has poll ...
                        
if ($threadinfo['pollid'] == 0)
                        { 
// ... and original thread doesn't
                            
$pollcode ',pollid = ' $mergethreadinfo['pollid'];
                        }
                        else
                        { 
// ... and original does
                            // if the poll isn't found anywhere else, delete the merge thread's poll
                            
if (!$poll $DB_site->query_first("
                                SELECT threadid
                                FROM " 
TABLE_PREFIX "thread
                                WHERE pollid = 
$mergethreadinfo[pollid] AND
                                    threadid <> 
$mergethreadinfo[threadid]
                                "
))
                            {
                                
$DB_site->query("DELETE FROM " TABLE_PREFIX "poll WHERE pollid = $mergethreadinfo[pollid]");
                                
$DB_site->query("DELETE FROM " TABLE_PREFIX "pollvote WHERE pollid = $mergethreadinfo[pollid]");
                            }
                        }
                    }
                
                    
// move posts
                    
$DB_site->query("UPDATE " TABLE_PREFIX "post SET threadid = $threadid WHERE threadid = $mergethreadid");
                    
$DB_site->query("UPDATE " TABLE_PREFIX "post SET parentid = $thrd_firstpost[postid] WHERE postid = $mrgthrd_firstpost[postid]"); // make merge thread child of first post in other thread
                    
$DB_site->query("UPDATE " TABLE_PREFIX "thread SET title = '" addslashes(htmlspecialchars_uni($title)) . "'$pollcode WHERE threadid = $threadid");
                    
$DB_site->query("DELETE FROM " TABLE_PREFIX "thread WHERE threadid = $mergethreadid");
                    
$DB_site->query("UPDATE " TABLE_PREFIX "thread SET pollid = $threadid WHERE open = 10 AND pollid = $mergethreadid"); // update redirects
                    
$DB_site->query("DELETE FROM " TABLE_PREFIX "threadrate WHERE threadid = $mergethreadid");
                    
$DB_site->query("DELETE FROM " TABLE_PREFIX "subscribethread WHERE threadid = $mergethreadid");
                
                    
// update postindex for the 2 posts who's titles may have changed (first post of each thread)
                    
delete_post_index($thrd_firstpost['postid']);
                    
delete_post_index($mrgthrd_firstpost['postid']);
                    
build_post_index($thrd_firstpost['postid'] , $foruminfo);
                    
build_post_index($mrgthrd_firstpost['postid'] , $foruminfo);
                
                    
build_thread_counters($threadid);
                    
build_forum_counters($threadinfo['forumid']);
                    if (
$mergethreadinfo['forumid'] != $threadinfo['forumid'])
                    {
                        
build_forum_counters($mergethreadinfo['forumid']);
                    }
                }
            }
            if (
$vars['forumid'])
            {
                
$url "forumdisplay.php?$session[sessionurl]f=$vars[forumid]&mod=1";
                eval(
print_standard_redirect('redirect_mergethread'));
            }
        }
        break; 

It works for me!

I just do not know what toss_cookies does!

Rgds

rob_daemon 12-10-2004 04:49 AM

Tell me if the attached file fixes the bug, it should. If it does I'll release 1.2.1. By the way, the code you posted doesn't handle polls in two or more threads elegantly (which is why I chose to throw an error in this event), it doesn't update the parentid for all the merged threads, and other things for more than two threads. If you just merge two, it should work, but otherwise there will be a problem.

By the way, toss_cookies() is the first of two methods to remove the inline moderation cookies after an action.

sv1cec 12-10-2004 05:23 AM

Quote:

Originally Posted by rob_daemon
Tell me if the attached file fixes the bug, it should. If it does I'll release 1.2.1. By the way, the code you posted doesn't handle polls in two or more threads elegantly (which is why I chose to throw an error in this event), it doesn't update the parentid for all the merged threads, and other things for more than two threads. If you just merge two, it should work, but otherwise there will be a problem.

By the way, toss_cookies() is the first of two methods to remove the inline moderation cookies after an action.

Rob_daemon,

Yes, this file works fine. May I humbly suggest two improvements before you release next version? First, I would like to see a note attached at the merged thread saying "This thread was created by merging other threads, by ...., on ...., at ..... . I'll add that myself if you don't, but I think it is a worthwhile addition.

Second, you do not have to be so restrictive with the title of the new thread. What I would suggest is, to show the mod the title of the first thread you are merging, and allow him to change it, if he so wants. If he doesn't, then you can use the original, first thread title, as the title for the new merged thread.

Finally, since merging two threads can result in a new thread, whose placement needs to be changed (moved to a different forum), why don't you add the forum selection in the template form, and if the user selects a different forum, from the one in which the initial threads were, then move the new, merged thread to the new forum. In that way, the mod does not have to do a merge and then do a move.

Just a couple of thoughts.

One more thing I just found out, although I am not sure if you can do something about it. I have installed another hack, which shows me which members have seen a thread. It looks as if after the merging, that information is lost, since in the merged thread, it only shows me, as having seen it. I think it should show all members who have seen all merged threads. A pain? Yeah, I guess you are right. I'll see if I can do something about this.

By the way, this is one of the most useful hacks I've seen, thank you Sir.

Rgds

rob_daemon 12-10-2004 03:26 PM

Glad that finally fixed :).

I do plan to add logging to all of the inline actions; I do it for a few right now, but I want to add it in for all as well as cleaning up the entire system.

Also in 1.2.1 there will be a small change to the inline_merge_thread template that will set the default title.

Adding a move thread in the merge screen could be a possibility. I'll see about adding that in either 1.2.1 or the next version.

As far as that hack, wherever the hack is storing read information, the table probably needs to be updated to change all the old threadid's to the new ones.

sv1cec 12-10-2004 04:37 PM

Quote:

Originally Posted by rob_daemon
Glad that finally fixed :).

I do plan to add logging to all of the inline actions; I do it for a few right now, but I want to add it in for all as well as cleaning up the entire system.

Also in 1.2.1 there will be a small change to the inline_merge_thread template that will set the default title.

Adding a move thread in the merge screen could be a possibility. I'll see about adding that in either 1.2.1 or the next version.

As far as that hack, wherever the hack is storing read information, the table probably needs to be updated to change all the old threadid's to the new ones.

I have changed the merge_thread template and the code, to do a merging and a move. I also edit it so that it shows the user the title of the first thread, and if he doesn't change it, the merged thread uses that title instead. If you want, I can send you my code.

I also added the remove thread functionality, to show up in the menu only for admins. Admitedly it's a risk, but it's quite useful for cleaning up the forums sometimes.

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

dndog 12-11-2004 02:41 PM

I don't understand, but the inline moderation tools work horridly at my site.

They often deny users with permission the ability to use them. The users are in the registered user group, but they have moderator abilities.

In IE, they cause a "script error, debug" message which pops up on each page where they are.

I am currently using vB3.0.1.

Any fix I can do for this?

rob_daemon 12-11-2004 06:21 PM

Quote:

Originally Posted by dndog
I don't understand, but the inline moderation tools work horridly at my site.

They often deny users with permission the ability to use them. The users are in the registered user group, but they have moderator abilities.

In IE, they cause a "script error, debug" message which pops up on each page where they are.

I am currently using vB3.0.1.

Any fix I can do for this?

What version of the inline moderation tools are you using? If you're not using at least 1.2.0 you should upgrade which will fix all of the javascript errors and other problems.

WebMasterAJ 12-11-2004 08:12 PM

Thanks for that first fix... but I have some good news and some bad news.

It now displays the drop down menu for my, however, there are no check boxes in the forum display and posts. It just displays a black cell in the forum display...

Any ideas?

Thanks again for your time and energy!

Sincerely,
Andrew Tatum

rob_daemon 12-11-2004 08:44 PM

Thanks for finding this. This is a small bug. In the instructions for the threadbit template, use the following:

Find:

HTML Code:

</tr>
Add before:

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>

Edit: ZIP package updated and link to this post added

aab 12-12-2004 12:04 AM

help me please...

Invalid inline moderation items specified. If you followed a valid link, please notify the webmaster

rob_daemon 12-12-2004 05:36 AM

I need more information than that. What exactly did you do to reach that error?

aab 12-12-2004 09:36 AM

i can a little speak english,

i applyed your inline Moderation tools.

but dont work. please help me,

best regards.

rob_daemon 12-12-2004 09:42 AM

Quote:

Originally Posted by aab
i can a little speak english,

i applyed your inline Moderation tools.

but dont work. please help me,

best regards.

You need to select the check boxes in each post to perform the actions on it.

aab 12-12-2004 05:02 PM

i am sorry , thank you very much rob daemon.

dndog 12-12-2004 05:15 PM

Quote:

Originally Posted by rob_daemon
What version of the inline moderation tools are you using? If you're not using at least 1.2.0 you should upgrade which will fix all of the javascript errors and other problems.

I am not sure which version I am running.

Is there anyway I can find out? :ermm:

rob_daemon 12-12-2004 05:58 PM

Quote:

Originally Posted by dndog
I am not sure which version I am running.

Is there anyway I can find out? :ermm:

Open inlinemod.php and look at the top. It will have the version number there.

Delphiprogrammi 12-13-2004 09:59 AM

hi,

nice mode thanks dude working fine

Delphiprogrammi 12-13-2004 11:11 AM

while testing some stuff with your mod i get permission denied page when i try to close a thread

permission denied is impossible because i am logged in on my administrator account wich has more rights then a moderator so ????

Revan 12-13-2004 11:14 AM

Quote:

(Wed Dec 11 15:26:30 PDT 2004)
Erm by which calendar is this? :rolleyes:

Upgrading to newest version now :)

rob_daemon 12-13-2004 02:01 PM

Quote:

Originally Posted by Delphiprogrammi
while testing some stuff with your mod i get permission denied page when i try to close a thread

permission denied is impossible because i am logged in on my administrator account wich has more rights then a moderator so ????

Odd... does the forum have special permissions? Also does the "Go" button have a number of selected items on it? The no permission can be thrown in the following events:

- You don't have any moderator permissions
- There is no forumid (caused by search results or not having the proper cookie set)
- You don't have permission to close threads

Not sure why this would be happening...

Revan: Type "date" in a UNIX shell and that's the date that comes out. And my ZIP packager is just a shell script, so that's how that date is formed ;).

Delphiprogrammi 12-13-2004 04:27 PM

hi,

now it works only if you enable that redirection messages the wrong template is shown but that isn't that worse mean thing is the stuff is working

Zachariah 12-14-2004 02:52 AM

rob_daemon - damb sexy sir.
How about a hard del option w/ soft del.

I don't even use soft del in windows OS. :D (disable) ahahha

rob_daemon 12-14-2004 04:18 AM

Delphiprogrammi: I'll resolve this for the next update.

Harry: I've considered a hard delete in the past but it wasn't added in because you could accidentally hit the wrong button. I may add it in the future, though.

Zachariah 12-14-2004 04:47 PM

Quote:

Originally Posted by rob_daemon
Delphiprogrammi: I'll resolve this for the next update.

Harry: I've considered a hard delete in the past but it wasn't added in because you could accidentally hit the wrong button. I may add it in the future, though.


Thats an easy fix. Warning popup "ARE YOU SURE YOU WANT TO DEL"
Yes (button) / No (button)

Just thoughts.

dndog 12-14-2004 08:16 PM

Quote:

Originally Posted by rob_daemon
Open inlinemod.php and look at the top. It will have the version number there.

Thanks so much. I got it working.

-dndog

IC-Games 12-15-2004 01:52 PM

WOHOO! Exactly what I wanted

I love you :D

rob_daemon 12-15-2004 06:16 PM

Glad you like it :).

Don't forget to click install!

trackpads 12-17-2004 11:08 PM

Hi,

For some reason I am getting the No permissions page when I try to move threads. I am logged on as an admin and even made myself the mod of those forums but no luck.

Any ideas?

Thanks again for the help,

-Jason

Delphiprogrammi 12-18-2004 07:34 PM

you could add a "check all" "uncheck all" link to the bottom of those checkboxes just an idea i have but i don't wanna steel somebody elses work so i tell you here ;) this can be done quite easly with javascript

IC-Games 12-20-2004 12:09 AM

[high]* IC-Games clicks install
[/high]

sorry about that :)

red_baron2000 12-23-2004 10:24 AM

thanks "rob_daemon" for this great hack..however whenever i want to move or delete etc some posts i get this error message i am admins tho: any idea?

thanking you in advance :)

trackpads 12-23-2004 01:40 PM

Quote:

Originally Posted by trackpads
Hi,

For some reason I am getting the No permissions page when I try to move threads. I am logged on as an admin and even made myself the mod of those forums but no luck.

Any ideas?

Thanks again for the help,

-Jason


*bump* please!

rob_daemon 12-23-2004 03:18 PM

red_barron2000: this could be caused by the inline moderation cookie expiring. Does this happen every time or only after a certain period of time. Also if you visit another forum or thread while you're selecting inline moderation items, the selected item information will be over-written.

trackpads: I don't know why this would be happening. I took a look at the permissions in the code and all of them appear to be set fine.

trackpads 12-24-2004 03:18 AM

Quote:

Originally Posted by rob_daemon
red_barron2000: this could be caused by the inline moderation cookie expiring. Does this happen every time or only after a certain period of time. Also if you visit another forum or thread while you're selecting inline moderation items, the selected item information will be over-written.

trackpads: I don't know why this would be happening. I took a look at the permissions in the code and all of them appear to be set fine.

As funny as this sounds it was working fine until I upgraded :)

Tonight I comletely removed it and then reinstalled it and still had the same problem. I then opened the 1.1.0 version and uploaded just the inlinemod.php and now it is working fine.

Any ideas?

Thanks again,

-Jason

rob_daemon 12-24-2004 03:28 AM

Try this:

Upload inlinemod.php from 1.2.1 and find:

PHP Code:

if (!can_moderate($vars['forumid'], 'canmanagethreads')) 

Replace it with:

PHP Code:

if (!can_moderate($threadinfo['forumid'], 'canmanagethreads')) 


trackpads 12-24-2004 03:51 AM

Quote:

Originally Posted by rob_daemon
Try this:

Upload inlinemod.php from 1.2.1 and find:

PHP Code:

if (!can_moderate($vars['forumid'], 'canmanagethreads')) 

Replace it with:

PHP Code:

if (!can_moderate($threadinfo['forumid'], 'canmanagethreads')) 


No luck. There were 5 occurances in that file of that string and I replaced them all.

Thanks again,

-Jason

Jmonto 12-27-2004 11:32 PM

how can i make it so administrators can use this function without adding themselves to every forum as a mod?

rob_daemon 12-27-2004 11:51 PM

Administrators should be able to use it if they are marked as "Super Moderators" in the usergroup management screen.


All times are GMT. The time now is 12:47 PM.

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.01726 seconds
  • Memory Usage 1,958KB
  • 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
  • (2)bbcode_html_printable
  • (15)bbcode_php_printable
  • (15)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