vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Programming a button or link to move a thread with 1 click (https://vborg.vbsupport.ru/showthread.php?t=210513)

BirdOPrey5 04-07-2009 12:34 AM

Programming a button or link to move a thread with 1 click
 
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 12: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.
HTML Code:

<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 11:24 AM

Thanks!

Will check it out.

--------------- Added [DATE]1239111722[/DATE] at [TIME]1239111722[/TIME] ---------------

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 11:30 AM

Hello
Post move button add
postbit template add ?
How do I add
please help

Lynne 04-30-2009 12: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 09:20 PM

moving with a single button
very important for me
thank you

Lynne 05-01-2009 10: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).


All times are GMT. The time now is 10:34 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.01409 seconds
  • Memory Usage 1,726KB
  • 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
  • (1)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete