vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Opening a new thread with preset title (https://vborg.vbsupport.ru/showthread.php?t=154087)

henrikdam 08-02-2007 06:23 AM

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

nico_swd 08-02-2007 07:08 AM

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

This would make your special link work.

henrikdam 08-02-2007 11:12 AM

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?

testebr 08-02-2007 11:36 PM

nice plugin.

How to add same function to new pm form?

Opserty 08-03-2007 08:55 AM

1 Attachment(s)
Hopefully nico_swd won't mind here:

(Credit to nico_swd for original code)

maasland 08-26-2008 12:32 PM

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!

maasland 08-27-2008 08:08 PM

Beside the fact this thread was started over a year ago :o :), 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...


All times are GMT. The time now is 06:17 AM.

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.01501 seconds
  • Memory Usage 1,723KB
  • 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)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