Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 08-14-2003, 04:45 AM
Sukij Sukij is offline
 
Join Date: Nov 2001
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 08-16-2003, 10:15 PM
Meltdown Meltdown is offline
 
Join Date: Aug 2003
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 08-16-2003, 10:20 PM
assassingod's Avatar
assassingod assassingod is offline
 
Join Date: Jul 2002
Posts: 3,337
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Or you can just edit the template...
Reply With Quote
  #4  
Old 08-16-2003, 11:13 PM
SmEdD's Avatar
SmEdD SmEdD is offline
 
Join Date: Mar 2003
Location: Ontario, Canada
Posts: 381
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

He wants certian forums I belive. Not all
Reply With Quote
  #5  
Old 08-16-2003, 11:23 PM
assassingod's Avatar
assassingod assassingod is offline
 
Join Date: Jul 2002
Posts: 3,337
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 08-17-2003, 03:33 AM
Sukij Sukij is offline
 
Join Date: Nov 2001
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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..
Reply With Quote
  #7  
Old 08-18-2003, 06:16 AM
Sukij Sukij is offline
 
Join Date: Nov 2001
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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();
:
:
:
Reply With Quote
  #8  
Old 08-19-2003, 08:42 AM
Meltdown Meltdown is offline
 
Join Date: Aug 2003
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Sukij, I sent you a PM.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:29 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03930 seconds
  • Memory Usage 2,226KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete