vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   vBulletin 4 Request - Default text for new threads (https://vborg.vbsupport.ru/showthread.php?t=326287)

mikez006 04-11-2018 01:40 PM

vBulletin 4 Request - Default text for new threads
 
For one forum, when someone creates a new thread, instead of a blank content box, I want to include text, basically a template where member can answer the questions and submit it.

I'm having a hard time finding a mod that does this. Anyone know if one exists?

MarkFL 04-11-2018 04:29 PM

A simple solution would be to create a plugin hooked at "newthread_forum_start" with PHP code such as:

PHP Code:

if ($foruminfo['forumid'] == XX AND !$newpost['message'])
{
    
$br PHP_EOL PHP_EOL;
    
$newpost['message'] = 'Age: ' $br 'Sex: ' $br 'Location: ';


Replace XX with the forumid where you want this post template to happen, and edit the string to include your desired post template.

mikez006 04-11-2018 06:12 PM

Wow, thanks :)

Would this solution work if I wanted to use some BB code or include links?

MarkFL 04-11-2018 09:07 PM

Quote:

Originally Posted by mikez006 (Post 2594076)
Wow, thanks :)

Would this solution work if I wanted to use some BB code or include links?

I'm not sure I know what you're asking...could you give an example?

final kaoss 04-11-2018 10:53 PM

I think he's asking if he can insert that code into a bbcode code & have it pop out that info when they press it.

mikez006 04-12-2018 01:40 PM

I tested it and BB codes does work :)

However I have another problem. Your code above double spaces each line.

Age

Sex

Location

How do I single space it?

Age
Sex
Location

Dave 04-12-2018 01:47 PM

Change
PHP Code:

$br PHP_EOL PHP_EOL

to
PHP Code:

$br PHP_EOL


mikez006 04-12-2018 01:49 PM

awesome, thanks again :)


All times are GMT. The time now is 04:15 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.01203 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
  • (3)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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