vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Add text to new post (https://vborg.vbsupport.ru/showthread.php?t=56186)

Sukij 08-14-2003 04:45 AM

Add text to new post
 
HI..

Please recommend how can I add 3-4 lines of predefined texts automatically into the body when someone create a new thread in a certain forum ?

Thanks

Meltdown 08-16-2003 10:15 PM

Open newthread.php.

Add the following to the top:

<?
if ($HTTP_GET_VARS['forumid']== '2') {
$defaultmessage = 'message 1';
} elseif ($HTTP_GET_VARS['forumid']== '3') {
$defaultmessage = 'message2';
} else {
echo ' ';
}
?>

Then open the 'newthread' template and add $defaultmessage between the <textarea> tags.

assassingod 08-16-2003 10:20 PM

Or you can just edit the template...

SmEdD 08-16-2003 11:13 PM

He wants certian forums I belive. Not all ;)

assassingod 08-16-2003 11:23 PM

Quote:

Today at 01:13 AM SmEdD said this in Post #4
He wants certian forums I belive. Not all ;)
Ah right, misread. Meltdowns could work, but there is a more efficient way of doing it.

Sukij 08-17-2003 03:33 AM

Quote:

Today at 12:15 AM Meltdown said this in Post #2
Open newthread.php.

Add the following to the top:

<?
if ($HTTP_GET_VARS['forumid']== '2') {
$defaultmessage = 'message 1';
} elseif ($HTTP_GET_VARS['forumid']== '3') {
$defaultmessage = 'message2';
} else {
echo ' ';
}
?>

Then open the 'newthread' template and add $defaultmessage between the <textarea> tags.

Thanks, Meldown
I will try it on Monday...
and Yes I need the text to be added only selected forum, not all.
Will let you know how it's going on... later..

Sukij 08-18-2003 06:16 AM

Quote:

Yesterday at 12:15 AM Meltdown said this in Post #2
Open newthread.php.

Add the following to the top:

<?
if ($HTTP_GET_VARS['forumid']== '2') {
$defaultmessage = 'message 1';
} elseif ($HTTP_GET_VARS['forumid']== '3') {
$defaultmessage = 'message2';
} else {
echo ' ';
}
?>

Then open the 'newthread' template and add $defaultmessage between the <textarea> tags.

Please excuse to my poor php programming.. Actually, I don't know the php programming !!! I have already tried but it did't show. May be you can help to figure out or give more specific details where should I put the code.

In the Template, I add the $defaultmessage as follow.

- New Posting Template
- NewThread

<td><textarea name="message" rows="20" cols="$textareacols" wrap="virtual" tabindex="2">$defaultmessage $message</textarea>

In the Newthread.php, I add the lines as follow.

<?php
error_reporting(7);


if ($HTTP_GET_VARS['forumid']== '889') {
$defaultmessage = 'message 1';
} elseif ($HTTP_GET_VARS['forumid']== '889') {
$defaultmessage = 'message2';
} else {
echo ' ';
}


$templatesused = "newpost_postpreview,error_nosubject,redirect_post thanks,email_moderator,emailsubject_moderator,newt hread_postpoll,newpost_attachment,newpost_disables miliesoption,forumrules,newthread,posticons,postic onbit";
$templatesused.=",vbcode_smilies,vbcode_smiliebit, vbcode_smilies_getmore,vbcode_buttons,vbcode_sizeb its,vbcode_fontbits,vbcode_colorbits";
require("./global.php");

// get decent textarea size for user's browser
$textareacols = gettextareawidth();
:
:
:

Meltdown 08-19-2003 08:42 AM

Hi Sukij, I sent you a PM.


All times are GMT. The time now is 01:42 AM.

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.01207 seconds
  • Memory Usage 1,726KB
  • 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_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