Customizing SMF > SMF Coding Discussion
Filled message body
Labradoodle-360:
Try this, maybe...
--- Code: ---if (!empty($_GET['last_msg']))
{
echo '
<textarea class="editor" name="', $editor_id, '" id="', $editor_id, '" rows="', $editor_context['rows'], '" cols="600" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onchange="storeCaret(this);" tabindex="', $context['tabindex']++, '" style="height: ', $editor_context['height'], '; ', isset($context['post_error']['no_message']) || isset($context['post_error']['long_message']) ? 'border: 1px solid red;' : '', '">', $editor_context['value'], '[b]Name[/b] -
[b]E-mail[/b] -
[b]Contact No.[/b] -
[b]Own Device[/b] -
[b]Sales Order No.[/b] - ', isset($_REQUEST['predefined_body']) ? "[b]Name[/b] - \n[b]Location[/b] -" : '', '</textarea>';
}
else
echo '
<textarea class="editor" name="', $editor_id, '" id="', $editor_id, '" rows="', $editor_context['rows'], '" cols="600" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onchange="storeCaret(this);" tabindex="', $context['tabindex']++, '" style="height: ', $editor_context['height'], '; ', isset($context['post_error']['no_message']) || isset($context['post_error']['long_message']) ? 'border: 1px solid red;' : '', '"></textarea>';
--- End code ---
ѕησω:
Adding that has caused syntax errors :\ God I'm code stupid haha
--- Code: ---<div>
<div style="width: 98.8%;">
<div>
if (!empty($_GET['last_msg']))
{
echo '
<textarea class="editor" name="', $editor_id, '" id="', $editor_id, '" rows="', $editor_context['rows'], '" cols="600" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onchange="storeCaret(this);" tabindex="', $context['tabindex']++, '" style="height: ', $editor_context['height'], '; ', isset($context['post_error']['no_message']) || isset($context['post_error']['long_message']) ? 'border: 1px solid red;' : '', '">', $editor_context['value'], '[b]Name[/b] -
[b]E-mail[/b] -
[b]Contact No.[/b] -
[b]Own Device[/b] -
[b]Sales Order No.[/b] - ', isset($_REQUEST['predefined_body']) ? "[b]Name[/b] - \n[b]Location[/b] -" : '', '</textarea>';
}
else
echo '
<textarea class="editor" name="', $editor_id, '" id="', $editor_id, '" rows="', $editor_context['rows'], '" cols="600" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onchange="storeCaret(this);" tabindex="', $context['tabindex']++, '" style="height: ', $editor_context['height'], '; ', isset($context['post_error']['no_message']) || isset($context['post_error']['long_message']) ? 'border: 1px solid red;' : '', '"></textarea>';
</div>
<div id="', $editor_id, '_resizer" class="richedit_resize"></div>
</div>
</div>
<input type="hidden" name="', $editor_id, '_mode" id="', $editor_id, '_mode" value="0" />
<script type="text/javascript"><!-- // --><![CDATA[';
--- End code ---
Labradoodle-360:
You have to add '; the line before the if condition, and a '; and then echo ' after the last textarea.
ѕησω:
Sorry I don't quite understand, do you mean.
--- Code: ---<div>
<div style="width: 98.8%;">
<div>
';
if (!empty($_GET['last_msg']))
{
echo '
<textarea class="editor" name="', $editor_id, '" id="', $editor_id, '" rows="', $editor_context['rows'], '" cols="600" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onchange="storeCaret(this);" tabindex="', $context['tabindex']++, '" style="height: ', $editor_context['height'], '; ', isset($context['post_error']['no_message']) || isset($context['post_error']['long_message']) ? 'border: 1px solid red;' : '', '">', $editor_context['value'], '[b]Name[/b] -
[b]E-mail[/b] -
[b]Contact No.[/b] -
[b]Own Device[/b] -
[b]Sales Order No.[/b] - ', isset($_REQUEST['predefined_body']) ? "[b]Name[/b] - \n[b]Location[/b] -" : '', '</textarea>';
}
else
echo '
<textarea class="editor" name="', $editor_id, '" id="', $editor_id, '" rows="', $editor_context['rows'], '" cols="600" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onchange="storeCaret(this);" tabindex="', $context['tabindex']++, '" style="height: ', $editor_context['height'], '; ', isset($context['post_error']['no_message']) || isset($context['post_error']['long_message']) ? 'border: 1px solid red;' : '', '"></textarea>';
echo '
</div>
<div id="', $editor_id, '_resizer" class="richedit_resize"></div>
</div>
</div>
<input type="hidden" name="', $editor_id, '_mode" id="', $editor_id, '_mode" value="0" />
<script type="text/javascript"><!-- // --><![CDATA[';
--- End code ---
Labradoodle-360:
That's correct. Sorry I wasn't able to write it for you, I couldn't take very long.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version