![]() |
Possible to hand code a link to move a thread to another specific forum?
Is it possible to create a link that admins/mods can click that will perform the action of moving a thread to a different (specified within the link code) forum, instead of having to use Thread Tools > Move > choose forum
We move threads a lot and if we could code it so that whenever you are viewing a thread in X forum there's a link to move the thread to Y forum, that'd save us a lot of time. I'm comfortable with the 'if the thread is in X forum' code that would display the link in the right place but no idea what the code would be (if it is actually possible) to have the the next step skipped and go direct to the thread being moved to Y forum. Thanks for any pointers anyone can give. I have searched for things like 'hand code thread move' but not found any solutions. |
I think you can do it with a form. It would be something like:
Code:
<form method="post" action="inlinemod.php?do=domovethread&threadids=TID"> You also need to add an input type="submit" or else use some js to submit the form. You can probably make it a link if you want but I'm not really an html person so I don't know how to do it off he top of my head. |
Where would this link be on your board?
|
Sorry, should have given more info.
Ideally somewhere on the individual thread, so in the SHOWTHREAD template. --------------- Added [DATE]1406134322[/DATE] at [TIME]1406134322[/TIME] --------------- Quote:
|
There's a mistake in the above. Well, at least one mistake, I didn't test it. But I think the do and threadids input fields need to be in the form and not in the action (or in addition to being in the action). In the template for the inline mod menu, they're in both the action and the form, but it looks like the code uses 'p' when it cleans the input.
I fixed the above code. |
Tried the code, thank you :) I got this error:
Quote:
PHP Code:
EDIT: Added security token code copied over from the threadadmin_movethread template as follows: PHP Code:
Quote:
|
That's my fault again - the name of the input field should be threadids (with an s). Again, I've fixed my code in the original post.
|
Great, it works. Thanks so much :)
For anyone else interested this is the final code (obviously alter the forumid to your needs) PHP Code:
Edited to add: Another little update, the method above will leave a permanant redirect. I didn't want any redirect so I added an input to handle that: PHP Code:
|
I've found this is conflicting with the inline moderation tools.
Usually when you click the checkbox on a post it highlights it (makes it yellow) then you scroll down to the bottom of the page and the dropdown menu shows you how many posts you've selected, and you can move/delete/merge/etc. With these buttons added the posts don't get highlighted and it says 0 in the dropdown menu, even if some checkboxes are selected. I will keep testing and hopefully find a fix but thought I'd post here in case anyone had any suggestions? Thanks! :) |
You cannot put a <form> within another <form> which is, I am guessing, the problem you are having.
|
Lynne is probably right. What you might be able to do is put the form somewhere outside the inline mod form, and remove the submit button (the rest of the fields are hidden so it shouldn't show up at all. Then use a js function to set the threadid and submit the form. I haven't tested it at all, but something like:
Code:
<script type="text/javascript"> Code:
<button type="button" value="Move thread to X" onClick="move_thread_to_forum($thread[threadid])"> |
What page are you putting this on? I have a single click button/form on my site but it is on the thread page. It works just fine because it is located on top of the thread pagination area and thus outside of the moderation form.
|
Quote:
|
Aha! Yes that was it. I hadn't realised I'd placed the code inside the inlinemod form in the SHOWTHREAD template (lesson learned there!)
I've now moved it above the first instance of: PHP Code:
|
All times are GMT. The time now is 02:16 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|