vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   New post template (https://vborg.vbsupport.ru/showthread.php?t=264867)

Methok 06-07-2011 10:00 PM

New post template
 
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:
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:
Code:

  $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

Quote:

Originally Posted by Lynne (Post 2419718)
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

Quote:

Originally Posted by lokey (Post 2419823)
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

Quote:

Originally Posted by lokey (Post 2419699)
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

Quote:

Originally Posted by tbworld (Post 2419828)
What are you referring to? Please add a link so the thread is useful. Thanks :)

https://vborg.vbsupport.ru/showthrea..._start+plug-in

--------------- Added [DATE]1367667559[/DATE] at [TIME]1367667559[/TIME] ---------------

Quote:

Originally Posted by darnoldy (Post 2419834)
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

Quote:

Originally Posted by lokey (Post 2419881)
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:
PHP Code:

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!


All times are GMT. The time now is 06:51 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.01407 seconds
  • Memory Usage 1,752KB
  • 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
  • (2)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (15)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