PDA

View Full Version : New post template


Methok
06-07-2011, 10:00 PM
Hi al,

Does anyone know if there is a mod for first post template?

By this I mean as an example if someone is posting in a classifieds section.

When they click new thread and the editor opens up there is a predefined template in the editor itself?

Does this exist?

Thanks all

- Methok

fr?nky
07-01-2011, 07:16 PM
interessting ask

BirdOPrey5
07-02-2011, 03:51 PM
Go to your Admin CP -> Plugin Manager -> Add a New Plugin

Product: vBulletin
Hook: newthread_start
Exe. Order: 5
Title: New Thread Template

PHP Code:

if ($foruminfo['forumid'] == 2)
{
$newpost[message] = "This is a test message.";
}


change "2" to the forumid of the forum you want to enable this in...

Change the test message to the template you want. Use \n for new lines.

Example:
$newpost[message] = "This is a line 1. \n This is line 2. \n This is line 3.";

lokey
05-03-2013, 12:08 AM
Newbie here. If you want this to apply to multiple subforums (but not all), do you just separate the forumid # with commas?

Simon Lloyd
05-03-2013, 12:13 AM
You'd need to use an array, if conditions can be found here https://vborg.vbsupport.ru/showthread.php?t=215032

lokey
05-03-2013, 12:18 AM
Thank you. Again, super newbie here. So just insert "array(1,2,3,6)" instead of just a single number where the forumid # is?

Simon Lloyd
05-03-2013, 12:28 AM
Yep pretty much :)

lokey
05-03-2013, 02:24 AM
Kicking my butt. :(

Lynne
05-03-2013, 02:43 AM
There is a modification called something like a "Stencil" mod and it will work for you. It is in the 3.x section, but it worked when I initially tested it for 4.0.x. So, test it on your test site and see if it still works.

lokey
05-03-2013, 10:53 PM
There is a modification called something like a "Stencil" mod and it will work for you. It is in the 3.x section, but it worked when I initially tested it for 4.0.x. So, test it on your test site and see if it still works.

Found the thread, called "Thread Stencil". "Not working with PHP 5.4" :(

I like the idea of just using the existing newthread_start vbulletin plug-in. The plug-in worked fine on one forum, but I just can't seem to get the array code right within that plug-in code so it will do the same thing to a selection of forumids. :confused:

tbworld
05-04-2013, 12:09 AM
I like the idea of just using the existing newthread_start vbulletin plug-in. The plug-in worked fine on one forum, but I just can't seem to get the array code right within that plug-in code so it will do the same thing to a selection of forumids. :confused:

What are you referring to? Please add a link so the thread is useful. Thanks :)

darnoldy
05-04-2013, 02:12 AM
Thank you. Again, super newbie here. So just insert "array(1,2,3,6)" instead of just a single number where the forumid # is?Not exactly...It should look like:
<if condition="in_array($forum['forumid'], array(1,2,3,6))">
.
.
.
</if>

lokey
05-04-2013, 10:34 AM
What are you referring to? Please add a link so the thread is useful. Thanks :)

https://vborg.vbsupport.ru/showthread.php?t=264867&highlight=newthread_start+plug-in

--------------- Added 1367667559 at 1367667559 ---------------

Not exactly...It should look like:
<if condition="in_array($forum['forumid'], array(1,2,3,6))">
.
.
.
</if>

So, when trying to make the function of the newthread_start plugin work on multiple selected forums, it should look like this? -


if "in_array($foruminfo['forumid'], array (1,2,3,4,5,6,7))"
{
$newpost[message] = "Date: /n Time: /n Address: /n";
}

Lynne
05-04-2013, 06:37 PM
So, when trying to make the function of the newthread_start plugin work on multiple selected forums, it should look like this? -


if "in_array($foruminfo['forumid'], array (1,2,3,4,5,6,7))"
{
$newpost[message] = "Date: /n Time: /n Address: /n";
}
For PHP is would be something like:
if (in_array($foruminfo['forumid'], array (1,2,3,4,5,6,7)))
{
$newpost[message] = "Date: /n Time: /n Address: /n";
}

lokey
05-15-2013, 02:21 PM
Thanks, Lynne. Works great!