PDA

View Full Version : vBulletin 4 Request - Default text for new threads


mikez006
04-11-2018, 01:40 PM
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:

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
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
$br = PHP_EOL . PHP_EOL;
to
$br = PHP_EOL;

mikez006
04-12-2018, 01:49 PM
awesome, thanks again :)