vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Auto fill data into new thread (https://vborg.vbsupport.ru/showthread.php?t=289219)

Macsee 10-17-2012 05:46 PM

Auto fill data into new thread
 
In a particular sub-forum on my site I would like that whenever anyone clicks to start a new thread the post appears with some pre-filled text. For example:

Quote:

(Posts in this forum need to include all the below information so please ensure you fill all fields)

1. Company Name
2. Service Advertised
3. Price
4. Estimated Time to Completion
I'm aware of the Easy Forms option, but don't want to go down the forms route.

Is there any way this pre-filling can be done?

kh99 10-17-2012 06:11 PM

You could try this: create a new plugin using hook location newthread_form_start and code like this:

Code:

if ($foruminfo['forumid'] == X)
{
  $newpost['message'] = "
(Posts in this forum need to include all the below information so please ensure you fill all fields)

1. Company Name
2. Service Advertised
3. Price
4. Estimated Time to Completion

";
}


where the X in the first line is the forumid where you want this to be inserted.

Brandon Sheley 10-17-2012 06:39 PM

I used this back in the 3.8 days
https://vborg.vbsupport.ru/showthread.php?t=130162

I'm not sure if it'll still work on 4, but it would be a good start for you.
(looking at the last page, it does work on 4.2)

Macsee 10-18-2012 01:27 PM

Thanks for that useful link, Brandon, but Kevin's suggestion worked the first time I tried it and I've gone ahead with using that.

Thanks very much, guys.

kh99 10-18-2012 01:58 PM

I took a quick look at that mod, it seems like it does the same thing as the plugin I posted but it lets you do a few more things and gives you a place to edit the text in the forum manager.

CAG CheechDogg 10-19-2012 04:14 AM

Great little plugin kh99....thanks !


All times are GMT. The time now is 06:02 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.01129 seconds
  • Memory Usage 1,725KB
  • 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_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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