News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Pre filled message content - Possible?

Started by Gobo, September 30, 2006, 10:17:31 AM

Previous topic - Next topic

aldenddlove


forummaker

Quote from: sweetdeath on November 30, 2006, 04:25:19 AM
How can it be avoid that the pre filled message will be add again if somebody edit the first post?
I can't find the answer to this question.
If someone modifies their post, it re-populates the pre filled message. How can this be avoided? Thanks.


Carlos Gandra

Quote from: forummaker on June 21, 2008, 08:55:49 AM
Quote from: sweetdeath on November 30, 2006, 04:25:19 AM
How can it be avoid that the pre filled message will be add again if somebody edit the first post?
I can't find the answer to this question.
If someone modifies their post, it re-populates the pre filled message. How can this be avoided? Thanks.

Same question :)
Carlos Gandra
Mundo dos Animais

Minare

I did it, but there seems no change , as if I didn't change anything =)

ThorstenE

Quote from: sweetdeath on November 30, 2006, 04:25:19 AM
How can it be avoid that the pre filled message will be add again if somebody edit the first post?
can be fixed by replacing
$context['is_first_post']
to
empty($context['current_topic'])

Nathaniel

SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

forummaker


Yesdel

#28
...to tweak the code bit...

If the user forget to type in something into the subject field, or another posting error occurs, then the "prefill text" will appear twice or more in the text area.

This code below will prevent that:

$which_boards = array(1,2,3);

// Finally the most important bit - the actual text box to write in!
echo '
<tr>
<td valign="top" align="right"></td>
<td>
<textarea class="editor" name="', $context['post_box_name'], '" rows="', $context['post_box_rows'], '" cols="', $context['post_box_columns'], '" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onchange="storeCaret(this);" tabindex="', $context['tabindex']++, '"', isset($context['post_error']['no_message']) || isset($context['post_error']['long_message']) ? ' style="border: 1px solid red;"' : '', '>', in_array($context['current_board'],$which_boards) && empty($context['current_topic']) && empty($context['post_error']) ? '1) Script Title:
2) More Stuff:' : '' .'', $message, '</textarea>
</td>
</tr>';
}


forummaker

I just added this last night and I thought everything was working with this until I tried to use the PM system for the first time today. For some reason it populated the pre-filled text in the body of the message. Here's the code I'm using.
I thought the calendar board is "0", is it not?

$which_boards = array(0,22);

   // Finally the most important bit - the actual text box to write in!
   echo '
         <tr>
            <td valign="top" align="right"></td>
            <td>
               <textarea class="editor" name="', $context['post_box_name'], '" rows="', $context['post_box_rows'], '" cols="', $context['post_box_columns'], '" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onchange="storeCaret(this);" tabindex="', $context['tabindex']++, '"', isset($context['post_error']['no_message']) || isset($context['post_error']['long_message']) ? ' style="border: 1px solid red;"' : '', '>', in_array($context['current_board'],$which_boards) && empty($context['current_topic']) && empty($context['post_error']) ? 'Here is more information about this event.

Name of Event:

Location:

Date:

Time:

Description:' : '' .' ', $message, '</textarea>
            </td>
         </tr>';
}

Any suggestions to fix would be greatly appreciated.

Jessikard

we wanna use it, but there´s a mod-code in these lines

// Finally the most important bit - the actual text box to write in!
echo '
<tr>';
if ($context['post_box_switch'] == 'off' && $context['post_box_message'] != '' && $context['current_action'] == 'post')
echo '
<td class="tborder" width="18%" height="', $context['post_box_rows'], '" valign="top" align="left" style="overflow: auto; padding: 4px; border: 1px solid red;">
', parse_bbc($context['post_box_message']), '</td>';
else
echo '<td width="18%"></td>';
echo '
<td colspan="2">
<textarea style="width: ', $context['post_box_columns'], ';" name="', $context['post_box_name'], '" rows="', $context['post_box_rows'], '" cols="', $context['post_box_columns'], '" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onchange="storeCaret(this);" tabindex="', $context['tabindex']++, '"', isset($context['post_error']['no_message']) || isset($context['post_error']['long_message']) ? ' style="border: 1px solid red;"' : '', '>', $message, '</textarea>
</td>
</tr>';


i need help to run this "mod" with our codelines - working with two boards for our support-area


Jessikard

okay - i solved it - but now ther´s an error

Quote8: Undefined index: current_board
Datei: /var/www/web0/html/forum/Themes/default/Post.template.php (send sub template - eval?)

how can i fix it ?

Rumbaar

As for Calendar 'board' ID, I wasn't aware it had one.  Unless you mean the one that actual posts are linked too/made.  Then it would be the one you've defined as the default board for new event related posts.

It looks like it's call that code when it's not inside a board, hence the current_board information isn't populated.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

forummaker

Thanks for the reply rumbaar. I've read your reply several times and I'm not sure what your saying.
I'll explain my issue a little better.
I would like this to populate when someone clicks the "post event" link from the calendar.
It only populates if I use the "0" board for use with "post event". The "22" is the board if someone posts a reply from the forum, then it will populate there.
Now the problem is when I use the PM system it populates there, when creating a new message to send to someone.
Maybe I didn't need to explain further, but trying to get down to the nitty-gritty with this issue.
Thanks for any further help with this.

Jessikard

Quote from: Rumbaar on May 05, 2009, 07:34:30 PM
It looks like it's call that code when it's not inside a board, hence the current_board information isn't populated.

can you tell me please where and how i have to include a code to be out of this error ???

H

Jessikard, do you still need help with this? :)
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

Jessikard

thx...
we managed it with a new BBcode-button which filled in the needed text

jhaagmans

This is now easy to do in 1.1.10 using the Post Template Mod. Good luck!

luismanson

would this work on RC2? im looking for an option to enable a template on some boards kinda wikipedia templates

Advertisement: