Not signed in (Sign In)

Categories

Vanilla 1.1.5 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthorjawele
    • CommentTimeDec 30th 2006
     # 1
    this extension should give the ability to adminstrators to quickly accomplish some basic moderation task, like:
    split selected comments from a discussion and start a new discussion with them.
    merge selected comments from a discussion and move them to another discussion.

    when you ran a forum with lot of members this is a must have....
    •  
      CommentAuthor[-Stash-]
    • CommentTimeDec 30th 2006
     # 2
    That would be nice :) Gonna code it? :D
    • CommentAuthorjawele
    • CommentTimeDec 30th 2006
     # 3
    well I'm not really a good php programmer...
    but I could code it with the help of the communty.... ;)
    but I will have to ask a lot of silly question....
    •  
      CommentAuthorWallPhone
    • CommentTimeDec 30th 2006
     # 4
    Silly questions are our speciality!

    I'v scrounged up a couple comments on how to do this:
    http://lussumo.com/community/discussion/2426/#Item_3
    http://lussumo.com/community/discussion/1985/#Item_2
    • CommentAuthorjawele
    • CommentTimeDec 30th 2006 edited
     # 5
    Thanks WallPhone, for the links....

    and yes it's exactly what I've in my head....

    1 set a configuration like "can moderate forum"
    2 add a split or merge checkbutton to each comment in the comments grid
    3 for the split: in top of the comments.php add a field for the new name of the discussion plus a category menu selector (like when you start a new discussion) and the submit split button.
    4 for the merge: just below the split options the merge field where you enter the destination discussion ID and the merge button.
    5 I need like a javascript function that checks the all the checkbuttons that it will put in an array.
    6 we pass that array to our ajax.php where we make the update to the comment tables and the deletes.

    well for the moment I'm at point 2 how do I add that checkbox in each comment?

    or how do I render the function GetBasicCheckBox??

    ok :) I managed this...

    so now step 3....let's see.... lol
    • CommentAuthorjawele
    • CommentTimeDec 31st 2006 edited
     # 6
    ok done step 3... now before going to do the 4th step,
    comes the question how do I make a query with the selected checkbox and assign the action to the submit button....
    I'v thought doing that with javascript but then came the problem how do I pass an array with php? it is possible?
    or maybe I should use dynamic checkboxes and in the onclick action just add to the array checkedBoxes the value of the checked box?
    •  
      CommentAuthorgarvin
    • CommentTimeDec 31st 2006
     # 7
    You have any screen shots of how this will look? This is exciting. I'm looking forward to this one.
    • CommentAuthorjawele
    • CommentTimeDec 31st 2006
     # 8
    hey Garvin! no screenshot for the moment as the look is ugly... I'm just focusing in doing the program with php then I will style it more nicely... ;)

    back to the extension:
    so I set an array comID[] to each checkbox name
    I got the menu where I can select the category.
    I got the field for the new name of the topic.
    I got the split button.

    now I'm trying to find when I click the split submit button:

    1- a way to check all checked comments and retrieve their comment ids
    2- post an empty discussion and retrieve the id of it
    3- update vanilla db with a sql query like that `LUM_Comment` set `DiscussionID`='$emptyDiscussionID' where `DiscussionID`='$oldDiscussionID' and `CommentID`='$checkedCommentID' this will be in a for statement for each comment checked.

    if anyone has advice or hints or just could point me in the good direction...

    please do it ;)
    •  
      CommentAuthorhutstein
    • CommentTimeDec 31st 2006
     # 9
    for 1 you could use Document.getElementsByClassName from the prototype framework. You could easily add to all checkbox the same class name and then call them via this pointer and look at each of them if it's checked
    • CommentAuthorjawele
    • CommentTimeJan 1st 2007 edited
     # 10
    thx hutsein I will try that... but actually for point 1 I was wondering if it's not better to do it directly with php with out the need of js.....
    btw how do I get the last created DiscussionID?
    •  
      CommentAuthorhutstein
    • CommentTimeJan 1st 2007
     # 11
    I think the function that creates the discussions gives the DiscussionID back as return value. Else you could use mysql_insert_id()
    • CommentAuthorjawele
    • CommentTimeJan 1st 2007
     # 12

    $s = $this->Context->ObjectFactory->NewContextObject($this->Context, 'sqlBuilder');
    $s->SetMainTable('Discussion','d');
    $s->AddSelect('DiscussionID', 'd');
    $s->AddOrderBy('DiscussionID', 'd', 'desc');
    $s->AddLimit(0, 1);



    whit this you get the last id created....or at least I think....
    •  
      CommentAuthorhutstein
    • CommentTimeJan 1st 2007
     # 13
    yes thats a method, but I think it isn't very secure.
    What about the case if a user creates a new discussion in exactly the same moment and then you will get a wrong DicussionID
    • CommentAuthorjawele
    • CommentTimeJan 1st 2007 edited
     # 14
    yes I thought about that...
    so how vanilla does it? to work around that case??

    I've been looking in the frameworks and library found the savediscussion function but could not grasp how the function know how it his the last discussion id?
    or maybe it just write down to the db that's it and my approach is not good....?
    I should then before get the comments and check wich is the lowest id for put it in firstcomment of discussion and then use the savediscussion function?
    but probably I will have to write a modified savediscussion function....
    thx hutstein, for your support... ;)
    •  
      CommentAuthorTiggr
    • CommentTimeJan 1st 2007
     # 15
    Hi!

    Isn't the Id auto_increment, and mysql does all the work?

    Tiggr
    • CommentAuthorvalentinp
    • CommentTimeJan 1st 2007
     # 16
    Yes, I can confirm that the DiscussionID in the Discussion table is set to auto_increment.

    Just assign a blank value to it and mySql will take care of incrementing it.
    • CommentAuthorjawele
    • CommentTimeJan 1st 2007
     # 17
    Thx Tiggr and valentinp.... this is something good to know :D ouff... I was seeing the whole thing getting bigger and bigger and I was thinking that I was trying to swallow a bit that I can't swallow.... this simplifies the things....... ehheheh that's why we use DBs isn't it? ;)
    ok so I can concentrate on just saving the discussion with the checked comments....
    •  
      CommentAuthorhutstein
    • CommentTimeJan 2nd 2007
     # 18
    but if you use your own sql query you need to take a look at all the UserDiscussionCounter thing, Role Block thing, and so on... I think using the framework would be much more secure
    • CommentAuthorjawele
    • CommentTimeJan 2nd 2007
     # 19
    for the Role Block I've set a configuration pref plus I think will check each time if the role have the permission to do the query... but why I should need the UserDiscussionCounter if I just create a new discussion and move some comments in to it, there's no added comment so this will not affect the commentcounter thing... no?
    •  
      CommentAuthorhutstein
    • CommentTimeJan 2nd 2007
     # 20
    but if you take a look at the SaveDiscussion function you can see all the thing that needs to be considered...
    • CommentAuthorjawele
    • CommentTimeJan 2nd 2007
     # 21
    yes I see what you mean.... so many thing to be considered... ;)
    • CommentAuthorjawele
    • CommentTimeJan 9th 2007
     # 22
    Ok I'm almost done.....thanks to the help of the community :)

    so I've almost done the split discussion but for the merge the problem is that vanilla orders comment by date and when you do a merge your merge will mess in the other discussion
    so possible solution:
    1 order comment by id
    2 write new date to comments

    the solution 1 is the most correct I think but it's too much for me... I will need to add a delegate to CommentManager_GetCommentListand and inject $s->AddOrderBy('CommentID', 'm', 'asc'); then I will need to save the selected comment as it was a new comment (to get the new id) and delete it.

    solution 2 I just write the current date of editing to the original date and that's it.

    anyone have some suggestion on why I should not implement solution 2?
    • CommentAuthorjawele
    • CommentTimeJan 10th 2007
     # 23
    so after thinking a while I will not use any of the possible solution mentioned before as they're pointless...
    The normal usage of merge is to use it on newly created discussion and where the destination Discussion ID is an old discussion otherways it doesn't make sense and it will be a mess.
    so I just made an if statement to prevent mess.
    ok now I handle split and merge the only thing now is knowing how do whispers work to manage them properly(now the split and merge work with out the whispers)... and after that I can say that the mod tools extensions are ready for a beta release... Untill now it has been like talking to a blank wall.... so please people if you want this extension to be released in the future let your voice be heard here ;)
    •  
      CommentAuthorWallPhone
    • CommentTimeJan 10th 2007
     # 24
    23 messages (now 24) isin't too quiet, although it has been lately.

    I am looking forward to this, as I'm sure many who requested this earlier are.

    I have a few discussions where a comment should be moved from one discussion to the other--rather than merge, just take the one comment--is this possible with your extension?
    •  
      CommentAuthor[-Stash-]
    • CommentTimeJan 10th 2007
     # 25
    Moving one comment, wholesale, from one discussion to another by means of a simple dropdown or AJAX autocomplete box, or even discussion ID would rule IMO.
    • CommentAuthorjawele
    • CommentTimeJan 10th 2007 edited
     # 26
    thanks boyz for the heads up :D I was feeling alone... and thinking that this extension was only useful for me :( the whole point of making it, was for making it available to the community ;)
    Wallphone said:
    I have a few discussions where a comment should be moved from one discussion to the other--rather than merge, just take the one comment--is this possible with your extension?

    well this is exactly what merge does ;)
    the extension works this way:
    in the discussion grid you got a "moderate discussion" link on each discussion plus each discussion got displayed the discussion ID(this is to know the discussion ID that you want to target with merge).
    once you click on the "moderate discussion" you get teletransported to the "mod tools" tab (before that invisible, of course only visible to who has permission to moderate).
    Once there you got the comment grid and each comment as checkbox " split or merge", on top of the comment grid (below the menu tabs ) you got the split discussion mod form and a link to switch to merge mode.
    split makes a new discussion with selected comments.
    merge moves the selected comments (one or as many as you selected) to another discussion.
    ftm with merge I made possible merging only to old discussion otherways the new comment will mess with the order of comments in the targeted discussion (as vanilla orders comments by date) but I could do that if your targeted discussion is newer than the source discussion, then we will write the current date to the comment, like this the order of the targeted discussion won't be a mess ...
    wow! I hope that is clear... :)
    •  
      CommentAuthorWallPhone
    • CommentTimeJan 10th 2007
     # 27
    Awesome!

    That intermixing problem stumped me. Never considered limiting a total merge to old threads. Maybe have a way to preview/undo a merge? --add an OR clause with the source discussion ID in the where clause... hmm...
    • CommentAuthorjawele
    • CommentTimeJan 10th 2007
     # 28
    well usually when moderators use merge is because someone started a discussion that is already started from someone else some time ago. so they merge it to the old discussion.
    now if you want to move a selected comment to a newer discussion, to respect the "sense" of the discussion the simplest work around is to write the current date so the comment will be at the end as expected...
    yes maybe a preview... or undo.... but in the next release... lol... ;)
    or maybe you want to do that part of it?
    •  
      CommentAuthor[-Stash-]
    • CommentTimeJan 10th 2007
     # 29
    I'm not sure about the terminology used. Split and Merge didn't really do it for me. Move and something more elegant than Create new discussion from comment would make more sense to me, since that's what they do. Other people's thoughts on this?
    • CommentAuthorjawele
    • CommentTimeJan 10th 2007
     # 30
    well I used the same terminology that they used in the phpBB admin tools but if someone come's with a more elegant terminology I will be glad to use it ;)
    • CommentAuthorjawele
    • CommentTimeJan 12th 2007 edited
     # 31
    *eez boyzzz.... I'm in a whisper nightmare.... I mean there are a lot of cases that can arise...I can't handle or imagine all of them....
    or maybe the best is leave the whispers where they are when modding.... any thought on this??
    •  
      CommentAuthorWallPhone
    • CommentTimeJan 12th 2007
     # 32
    That is probably best--as whispers only affect two users and they both will expect them to stay where they originally posted.

    Exception would be a total merge... but I suppose the whispers could remain as the last posts in the discussion effectively making it a private discussion... On second thought, total merges should move whispers because they would be out of context if moved.

    Total merges should have some sort of redirect in place to direct anyone who bookmarked or found a thread in a search engine...

    I visualize a 'check all' checkbox that triggers a total merge.

    As far as previews and such, will be glad to poke around the code and give suggestions, but am a bit busy at the moment.
    • CommentAuthorjawele
    • CommentTimeJan 13th 2007
     # 33
    yes this could be the solution....
    yes for the total merge I will do the check all trigger...
    well nice that you want to poke around with the code and give suggestion :) ... and btw no hurry we could implement the preview feature in the next update release of the extension ;)
    •  
      CommentAuthorgarvin
    • CommentTimeFeb 2nd 2007
     # 34
    Was this made available yet? Or did I miss something?
    • CommentAuthorjawele
    • CommentTimeFeb 6th 2007 edited
     # 35
    I've been busy with my job, and also I've added a whole lot bunch of features, including move discussion to other categories, trash discussion directly from the discussion tab... start discussion as moderator(to set it directly as sticky or closed)... and a few mores....
    they working, for me.... but I need to fix some thing before release a beta... I still have to manage whispers in the merge functions, make some validation to inputs, set the definitions properly for localizations, after that I will release it hopefully asap... I wont promise you a release date.
    The first release will better not test it on your main forum also(better test it on a dummy one before), as I did not understand properly how to implement the cool features that mark has done for us, extension developers, theres a lot of repititions in the code of the vanilla core in there, and probably (certainly) there's a much cleaner way to do it, but hey! this is a start! hopefully it will get better on the road.... will keep you informed... and hopefully announce the extension soon....
    I apologize for the delay.
    •  
      CommentAuthorTiggr
    • CommentTimeFeb 7th 2007
     # 36
    I would be very happy to test early versions! :-)

    Bye
    Tiggr
    •  
      CommentAuthorTiggr
    • CommentTimeFeb 14th 2007 edited
     # 37
    sorry, wrong post
    • CommentAuthorjawele
    • CommentTimeFeb 14th 2007
     # 38
    Ok anyone who want to test the early version release, just whisper me your email...

    the code it's ugly and cumbersome and there's a lot of repeating in there....
    but hey! I'm a PHP newbie, will be glad and thankful to all suggestions as I will learn and at the same time the whole community will benefit from having a nice little tool ;)

    Just one thing, that I want to make clear, as I already wrote on the plugin:
    DO NOT USE THIS ON REAL WORKING FORUMS!! USE IT ON A DUMMY TEST FORUM!!

    there's probably lot of thing that I can't even immagine that can happen so on this early test phase I will try to fix the bugs&problems that will surge...
    • CommentAuthorjawele
    • CommentTimeFeb 17th 2007
     # 39
    they say no news good news.. looks like there's no issue atm :)
    can you confirm that boyz?
    •  
      CommentAuthorgarvin
    • CommentTimeFeb 17th 2007
     # 40
    haven't installed it yet. will try and sit down with it this weekend.
    •  
      CommentAuthorWallPhone
    • CommentTimeFeb 17th 2007 edited
     # 41
    I was a little confused at first, until I gave myself permission to use the tools! :-)

    when using this with panel lists, the tools are scattered across the panel--some at the top, some in the middle and some at the bottom. I think they would be better all grouped in the same panel list--I love the show and hide function--keeps clutter away from the moderator's screen.

    Split and merge both look like they should work... but they don't seem to do anything other than delete the category for that discussion. I have the 'broken' mod-rewrite installed so some of those problems are probably related to that...

    Just scanning through the code, I see a lot of $_GET['blah']'s. Not sure if you know about them, but if you use ForceIncomingString (or int, or bool, etc), defined in framework.functions.php, you can specify a default value if nothing was passed... and it works for both GET and POST.
    • CommentAuthorjawele
    • CommentTimeFeb 17th 2007 edited
     # 42
    yes the panel list are bit confused... but couldn't find a way to make them display the way I wanted...
    I should have mentioned that you need to give permission to your self.. lol sorry about that...
    probably modtools will break with mod-rewrite... I've tested modtools with some plugs in... but obviously could not test it with all...
    I've used it ForceIncomingString... but really didn't knew that I could replace the $_GET with that...I'm sure that knowing better the vanilla framework the code could be half of what is now...
    •  
      CommentAuthorTiggr
    • CommentTimeFeb 20th 2007
     # 43
    strange, nothing! :-(

    Someway to download it?
    •  
      CommentAuthorWallPhone
    • CommentTimeFeb 20th 2007
     # 44
    whisper your email, we'll send it to ya
    • CommentAuthorjawele
    • CommentTimeFeb 20th 2007
     # 45
    this is really weird...... I've been sending succesfully this to everybody.... let's see if wallphone intent will be success
    •  
      CommentAuthorTiggr
    • CommentTimeFeb 22nd 2007
     # 46
    I'm sorry for all the trouble I make! :-(

    I realy don't know, why realy none of your mails got to me. All the spam do, but not your mails! Weird, crazy, like live itself!
    • CommentAuthorfuchka
    • CommentTimeFeb 22nd 2007 edited
     # 47
    so is it working?
    •  
      CommentAuthorgarvin
    • CommentTimeFeb 22nd 2007
     # 48
    I'll be installing this today and trying it out. I finally got an open day from work. I'll post my feedback here.
    •  
      CommentAuthorTiggr
    • CommentTimeFeb 23rd 2007
     # 49
    Got it, thank you both very much! I will to some tests over the weekend!
    •  
      CommentAuthorgarvin
    • CommentTimeFeb 23rd 2007
     # 50
    Ok, right off the bat I'm not getting this to work correctly at all. Here are a few screen shots:

    http://www.inunisonltd.com/vanilla/screengrabs/modtools/

    I'm using VaneaBlack, Who's Online 1.1, BBInsertBar 0.1.5, Better BB Code 1.0, and User Wall 1.0 Beta 6, .