PDA

View Full Version : Programming a button or link to move a thread with 1 click


BirdOPrey5
04-07-2009, 01:34 AM
After adding several subforums I need to be able to move threads very quickly... I'm looking to program a button/link that shows up for admins only in each thread (showthread.php) that would allow a 1 click solution to move a thread immediately leaving a perm redirect- no confirmation screen, no options- just do it.

I can do the <if> statements and edit the templates and such but no clue on what the code is to move the thread itself...

Anyone know off hand? This should be a 'simple' piece of code I'm sure. I'd hard code the forum ID of where it's going and figure I'd have several links or buttons at the top of the page.

"Quick Move to Forum A"
"Quick Move to Forum B"
"Quick Move to Forum C"
...

Lynne
04-07-2009, 01:45 AM
I do this on my site (kinda). Here is the code I use. I think I changed it correctly from what I had to what you want (of course, use on your test site first!). You will have to put it where you want with the correct html around it, and don't put it inside any other form cuz that won't work.
<form action="postings.php?do=domovethread&amp;t=$threadid" method="post" name="formname">
<input type="hidden" name="s" value="$session[sessionhash]" />
<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
<input type="hidden" name="t" value="$threadid" />
<input type="hidden" name="do" value="domovethread" />
<input type="hidden" name="title" value="$threadinfo[title]" />
<input type="hidden" name="redirect" value="none" />
<input type="hidden" name="redirecttitle" value="$threadinfo[title]" />
<input type="hidden" name="destforumid" value="xx" />
<input type="submit" class="button" value="Move Show" />
</form>Replace xx with the forumid and each form should have a unique name (I put formname as an example in this one). You will need a form for each Quick Move button.

BirdOPrey5
04-07-2009, 12:24 PM
Thanks!

Will check it out.

--------------- Added 1239111722 at 1239111722 ---------------

Thanks again, works great...

I changed the "redirect" value from "none" to "perm" and it's leaving permanent redirects which was exactly what I needed, everything else is woking perfectly.

I added it in the SHOWTHREAD template directly below the navbar, I'll make a handful of buttons for all the popular subforums and set it up so myself and senior mods see this and can quickly organize the site as we come upon threads. :)

PaLeRmO
04-30-2009, 12:30 PM
Hello
Post move button add
postbit template add ?
How do I add
please help

Lynne
04-30-2009, 01:59 PM
You want to create a button to move a post? There is already the Moderation dropdown at the bottom of the thread. Just check the box next to the post button and select Move Posts from the dropdown.

PaLeRmO
05-01-2009, 10:20 PM
moving with a single button
very important for me
thank you

Lynne
05-01-2009, 11:11 PM
You can't move a post with a single button in the post. Moving it requires a form and you can't have a form in a post because the posts are all in a form already (you can't have a form within a form).