REGISTER or LOGIN to have the annoying ads removed.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Split posts themselves?
This has always bothered me, so I'm asking if it's even possible. Like when you have a topic going, and someone decides in their post to bring up another topic. That sparks another discussion and hi jacks the thread. You want to split off those posts to another thread, which is no big deal, but what about the initial one? Half of it belongs, but the other half needs to start to new thread. Is it possible to write a plugin or code that would enable admins to split one post into two? Just wondering. Tongue I know that would make my job so much easier, since my members LOVE doing that.
Are you in to test something ? =P

Open the zipfile; contains 3 files
* Textfile; open and do the template change.
* Modified moderation.php; overwrite yours
* Modified ./inc/class_moderation.php; overwrite yours


Old Message = The Original Message that screwed up the thread =P Cut&&Paste everything that doesn't belong to it into the New Message box (will be used in the new thread as message)
Press 'Split Thread' ; everything should be done =P

Attached Files
.zip   Less than 1 minute ago"> (Size: 15.69 KB / Downloads: 0)
Big Grin I'm always up for testing! I'll let you know how it goes! Thanks, Lex!

edit: Seems to work great! Thanks a bunch. One little glitch though. See screenshot:

Less than 1 minute ago" />   

It didn't look like that in your screenshot, which is why I'm wondering what went wrong?

Here is what I have in my template where you said the edit needed to go:

<td class="trow2"><strong>{$lang->new_subject}</strong></td>
<td class="trow2"><input type="text" class="textbox" name="newsubject" value="[split] {$thread['subject']}" size="50" /></td>
<td class="trow2"><strong>Old Message</strong><br /><span class="smalltext>
Paste Everything You Don't Want In this Message into the New Message Box. <br />The Message in this box will be used in the old thread.</span></td>
<td class="trow2"><textarea name="oldmessage" rows="6" cols="45">{$message}</textarea></td>
<td class="trow2"><strong>New Message</strong></td>
<td class="trow2"><textarea name="newmessage" rows="6" cols="45"></textarea></td>

If this helps, my source code doesn't seem to like one of the td tags in that code:

PHP Code:
<td class="trow2"><strong>Old Message</strong><br /><span class="smalltext>
Paste Everything You Don't Want In this Message into the New Message Box. <br />The Message in this box will be used in the old thread.</span></td>
<td class="
trow2"><textarea name="oldmessage" rows="6" cols="45">[color=#000ED7]LOL...going by your calculations, that 
would be 888 posts in a month.  You might have something there, G'dog.  Reward those that actually post.  Right now, the 
member of the week/month gets a certain amount of Jbucks.  But to push others to compete for a grand prize?  Maybe that 
will work.  LOL[/color]</textarea></td>

LOL...never mind, I can see it now. There is no " after smalltext. Tongue
Yep, that fixed it. Looks fine now. Thanks for whipping that out! I'm sure it will come in handy to many others as well.
Stupid templates =P Will update the zip with the fix =P
If there are 'bugs'; let me know =P
I have advanced stats at the bottom of my index. When I split the post, it removes both the original and the new post from those stats. I'm doing a recount now to see if they get restored.

edit: No, the recount did not put them back. I split a last post and it shows that the last post now is the one before it...even though that one I split is still there, and it doesn't account for the new post either? Hmmm...but other than that, both do show up in the list of posts doing a search...and they do show up correctly on the forum itself. Just strange that the advanced stats isn't pulling them.

edit again: I think I found something else that could be considered a bug. This comes up for every post you want to split *using inline moderation*, even the ones where you do want to move the entire post. If you take everything from the old post and move it to the new post, you're left with a blank old post. Is there a way around this?
Found something else that actually gives an error. No error with Inline moderation, but if I try to split a thread using Moderation Options, I get the following:

Warning: Missing argument 5 for Moderation::split_posts(), called in /home/jude/public_html/testforum/moderation.php on line 805 and defined in /home/jude/public_html/testforum/inc/class_moderation.php on line 966

Warning: Missing argument 6 for Moderation::split_posts(), called in /home/jude/public_html/testforum/moderation.php on line 805 and defined in /home/jude/public_html/testforum/inc/class_moderation.php on line 966

Warning: Cannot modify header information - headers already sent by (output started at /home/jude/public_html/testforum/inc/class_moderation.php:966) in /home/jude/public_html/testforum/inc/functions.php on line 621
Thought of that while i was getting into bed; cause $oldmessage and $newmessage don't have a default value if they don't get passed in the function =P

Manual Change;

Open ./inc/class_moderation.php
PHP Code:
    function split_posts($pids$tid$moveto$newsubject$oldmessage$newmessage$destination_tid=0

Change into
PHP Code:
    function split_posts($pids$tid$moveto$newsubject$oldmessage=""$newmessage=""$destination_tid=0

Or redownload the file.

Probably need to change more code; since split_thread doesn't need to do anything; else it will make an empty post =P
Will edit this post again if i tested the code.

Reupload ./inc/class_moderation.php
I'll have to do more testing, but it looks like you fixed all the issues I was having. Big Grin Thanks for putting so much time into it! I appreciate it.

Oh, and I looked at the readme text to see if you changed anything, and I noticed the " after smalltext is still missing! Tongue
judel Wrote:Oh, and I looked at the readme text to see if you changed anything, and I noticed the " after smalltext is still missing! Tongue

Grmbl =P
Tanks cooooooooooooooooooooooooooooooooooool

Forum Jump:

Users browsing this thread: 1 Guest(s)