Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 07-23-2014, 01:54 PM
Jo_RHU Jo_RHU is offline
 
Join Date: Jan 2010
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 07-23-2014, 02:31 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think you can do it with a form. It would be something like:

Code:
<form method="post" action="inlinemod.php?do=domovethread&amp;threadids=TID">
<input type="hidden" name="destforumid" value="FID">
<input type="hidden" name="threadids" value="TID">
<input type="hidden" name="do" value="domovethreads">
</form>
where you'd want to set TID and FID to the threadid and forumid. The threadid would be a available as a variable depending on the template you're putting it in.

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.
Reply With Quote
2 благодарности(ей) от:
blind-eddie, ozzy47
  #3  
Old 07-23-2014, 02:39 PM
blind-eddie's Avatar
blind-eddie blind-eddie is offline
 
Join Date: Apr 2006
Location: Michigan
Posts: 2,310
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Where would this link be on your board?
Reply With Quote
  #4  
Old 07-23-2014, 03:51 PM
Jo_RHU Jo_RHU is offline
 
Join Date: Jan 2010
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:
Originally Posted by kh99 View Post
I think you can do it with a form. It would be something like:

Code:
<form method="post" action="inlinemod.php?do=domovethread&amp;threadids="TID">
<input type="hidden" name="destforumid" value="FID">
</form>
where you'd want to set TID and FID to the threadid and forumid. The threadid would be a available as a variable depending on the template you're putting it in.

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.
This looks promising, thanks. I will test it out and report back ASAP!
Reply With Quote
  #5  
Old 07-23-2014, 10:23 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 07-24-2014, 03:52 PM
Jo_RHU Jo_RHU is offline
 
Join Date: Jan 2010
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Tried the code, thank you I got this error:

Quote:
Your submission could not be processed because a security token was missing.
This was the code I used:

PHP Code:
<form method="post" action="inlinemod.php?do=domovethread&amp;threadids=$thread[threadid]">
<
input type="hidden" name="destforumid" value="225">
<
input type="hidden" name="threadid" value="$thread[threadid]">
<
input type="hidden" name="do" value="domovethreads">
<
input type="submit" value="Submit">
</
form>

</if> 
So now I need to work out how to add the security token.

EDIT:

Added security token code copied over from the threadadmin_movethread template as follows:

PHP Code:
<form method="post" action="inlinemod.php?do=domovethread&amp;threadids=$thread[threadid]">
<
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="threadid" value="$thread[threadid]">
<
input type="hidden" name="do" value="domovethreads">
<
input type="submit" value="Submit">
</
form
And now getting this error:

Quote:
You did not select any valid threads
Hmmmmmm.
Reply With Quote
  #7  
Old 07-24-2014, 06:22 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 07-25-2014, 12:16 PM
Jo_RHU Jo_RHU is offline
 
Join Date: Jan 2010
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great, it works. Thanks so much

For anyone else interested this is the final code (obviously alter the forumid to your needs)

PHP Code:
<form method="post" action="inlinemod.php?do=domovethread&amp;threadids=$thread[threadid]">
<
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="$thread[threadid]">
<
input type="hidden" name="do" value="domovethreads">
<
input type="submit" value="Submit">
</
form

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:
<form method="post" action="inlinemod.php?do=domovethread&amp;threadids=$thread[threadid]">
<
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="$thread[threadid]">
<
input type="hidden" name="do" value="domovethreads">
<
input type="hidden" name="redirect" value="none" id="rb_redirect_none" checked="checked" />
<
input type="submit" value="Move thread to X">
</
form
I found the code in the 'threadadmin_movethread' again so if anyone is looking for different redirect options, look there.
Reply With Quote
3 благодарности(ей) от:
blind-eddie, omardealo, z3r0
  #9  
Old 08-12-2014, 09:45 AM
Jo_RHU Jo_RHU is offline
 
Join Date: Jan 2010
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
  #10  
Old 08-12-2014, 05:00 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You cannot put a <form> within another <form> which is, I am guessing, the problem you are having.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:20 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04637 seconds
  • Memory Usage 2,298KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (4)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (5)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete