Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-02-2007, 07:23 AM
henrikdam henrikdam is offline
 
Join Date: Aug 2007
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Opening a new thread with preset title

Hi,
I have two questions. I really hope you can help me out:

1. I would like to have my users clicking a special link to open a new thread, and then the title/subject will be filled out already.
For example: They click the link
http://www.mysite.com/newthread.php?...SPECIALSUBJECT
and the new thread site opens with the title field already filled out with "MYSPECIALSUBJECT".

2. I want to be able to add an extra id to a new thread, and save it along with the other thread info in the mysql database when the users submits the new thread. It should work in the same way as the other, so when they click the link to open a new thread:
http://www.mysite.com/newthread.php?...3&extraid=5000
it would add the value "5000" in a field in the database when they submit the thread.
I know how to create the field in the database, I just don't know how to add these data into it.

I hope you can help me out.

Thanks.

Kind regards
Henrik
Reply With Quote
  #2  
Old 08-02-2007, 08:08 AM
nico_swd's Avatar
nico_swd nico_swd is offline
 
Join Date: Dec 2005
Location: Spain
Posts: 170
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

As for 1: install this. (Admin CP -> Plugins & Products -> Download / Upload Plugins)

This would make your special link work.
Attached Files
File Type: xml vbulletin-plugins.xml (356 Bytes, 35 views)
Reply With Quote
  #3  
Old 08-02-2007, 12:12 PM
henrikdam henrikdam is offline
 
Join Date: Aug 2007
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks nico_swd. It worked perfectly!

Just stuck with my question #2 now
I think I know the solution some of the way... But I can't figure out where in the process of starting a New Thread that the values are put in the database. Because it should be here that I need to add some extra lines...
I'm used to working with php and mysql, but with this I can't find the place in the php codes where it "INSERT"s the values into the database after submitting a new thread.
Does somebody know in what file this is hidden?
Reply With Quote
  #4  
Old 08-03-2007, 12:36 AM
testebr testebr is offline
 
Join Date: Jan 2004
Posts: 353
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nice plugin.

How to add same function to new pm form?
Reply With Quote
  #5  
Old 08-03-2007, 09:55 AM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hopefully nico_swd won't mind here:

(Credit to nico_swd for original code)
Attached Files
File Type: xml vbulletin-plugins(2).xml (361 Bytes, 18 views)
Reply With Quote
  #6  
Old 08-26-2008, 01:32 PM
maasland's Avatar
maasland maasland is offline
 
Join Date: Apr 2008
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the plugin (1), nico_swd. It works great to place a thread title through a link, but is it also possible to add a body-message/txt to the editor as well?

Example:
Code:
http://www.mysite.com/newthread.php?do=newthread&f=3&subject=MYSPECIALSUBJECT&message=MYSPECIALMESSAGE

I'm aware that with the 'Thread Stencil' product one can put pre-defined info in, but I need to pass variables in use of the script through the link. And as I said, plugin (1) works great!
Reply With Quote
  #7  
Old 08-27-2008, 09:08 PM
maasland's Avatar
maasland maasland is offline
 
Join Date: Apr 2008
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Beside the fact this thread was started over a year ago , I figured it out.
A new plugin in: newthread_form_start

Code:
if (empty($newpost['message']))
{
    $newpost['message'] = $vbulletin->input->clean_gpc('g', 'message', TYPE_NOHTML);
}

does the trick...
Reply With Quote
Reply


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 06:56 PM.


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.03870 seconds
  • Memory Usage 2,240KB
  • Queries Executed 14 (?)
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
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (2)postbit_attachment
  • (7)postbit_onlinestatus
  • (7)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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete