PDA

View Full Version : Add text to new post


Sukij
08-14-2003, 04:45 AM
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
Today at 01:13 AM SmEdD said this in Post #4 (https://vborg.vbsupport.ru/showthread.php?postid=426492#post426492)
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
Today at 12:15 AM Meltdown said this in Post #2 (https://vborg.vbsupport.ru/showthread.php?postid=426465#post426465)
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
Yesterday at 12:15 AM Meltdown said this in Post #2 (https://vborg.vbsupport.ru/showthread.php?postid=426465#post426465)
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_postt hanks,email_moderator,emailsubject_moderator,newth read_postpoll,newpost_attachment,newpost_disablesm iliesoption,forumrules,newthread,posticons,postico nbit";
$templatesused.=",vbcode_smilies,vbcode_smiliebit,vbcode_smilies_ge tmore,vbcode_buttons,vbcode_sizebits,vbcode_fontbi ts,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.