vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Possible to hand code a link to move a thread to another specific forum? (https://vborg.vbsupport.ru/showthread.php?t=313175)

kh99 08-12-2014 08:24 PM

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">
function move_thread_to_forum(threadid)
{
  if ("move_thread_to_forum" in document.forms)
  {
      var form = document.forms["move_thread_to_forum"];

      form.action += threadid;
      form.elements['threadids'].value = threadid;
      form.submit();
  }
}
</script>
<form name="move_thread_to_forum" method="post" action="inlinemod.php?do=domovethread&amp;threadids=">
<input type="hidden" name="s" value="$session[sessionhash]" />
<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
<input type="hidden" name="destforumid" value="225">
<input type="hidden" name="threadids" value="0">
<input type="hidden" name="do" value="domovethreads">
<input type="hidden" name="redirect" value="none" id="rb_redirect_none" checked="checked" />
</form>

and then for the button:
Code:

<button type="button" value="Move thread to X" onClick="move_thread_to_forum($thread[threadid])">
again I didn't try it, could have typos or other problems.

Lynne 08-13-2014 01:50 AM

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.

kh99 08-13-2014 08:51 AM

Quote:

Originally Posted by Lynne (Post 2511057)
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.

Oh right, that's a good point. I was thinking it was on a page that had multiple threads, but if it's showthread then maybe it can just be moved.

Jo_RHU 08-13-2014 03:46 PM

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:

<if condition="$show['inlinemod']"

and it's working fine. Thanks very much :)


All times are GMT. The time now is 01:17 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.01097 seconds
  • Memory Usage 1,727KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete