Forum Moderators: coopster

Message Too Old, No Replies

Submit = Preview

Submit button not working properly

         

Jeigh

3:09 am on Mar 25, 2007 (gmt 0)

10+ Year Member



I'm installing a quick reply to my forum, it all worked well except clicking the Submit button has the same effect as clicking the Preview button, they both take you to the normal post screen with a preview of the post. Here is the code I think relates to this bit:

In viewtopic.php

//
// Simple Quick Reply MOD
//
if ($sqr_auth)
{
$template->assign_vars(array(
'L_EMPTY_MSG' => $lang['Empty_message'],
'L_QUICK_REPLY' => $lang['Quick_Reply'],
'L_HIDE_QUICK_REPLY' => $lang['Quick_Reply_Hide'],
'L_USERNAME' => $lang['Username'],
'L_QUICK_SMILIES' => $lang['Quick_Reply_Smilies'],

'L_SUBJECT' => $lang['Subject'],
'L_MESSAGE_BODY' => $lang['Message_body'],
'L_OPTIONS' => $lang['Options'],
'L_PREVIEW' => $lang['Preview'],
'L_SPELLCHECK' => $lang['Spellcheck'],
'L_SUBMIT' => $lang['Submit'],
'L_DISABLE_HTML' => $lang['Disable_HTML_post'],
'L_DISABLE_BBCODE' => $lang['Disable_BBCode_post'],
'L_DISABLE_SMILIES' => $lang['Disable_Smilies_post'],
'L_ATTACH_SIGNATURE' => $lang['Attach_signature'],
'L_NOTIFY_ON_REPLY' => $lang['Notify'],

'S_ATTACH_SIG' => (( $userdata['session_logged_in'] )? $userdata['user_attachsig'] : '')? '1' : '',
'S_NOTIFY' => (( $userdata['session_logged_in'] )? $userdata['user_notify'] : '')? '1' : '',
'S_POSTING' => append_sid('posting.'.$phpEx),
'S_SID' => $userdata['session_id'],
'S_TOPIC_ID' => $topic_id,

'U_QUICK_SMILIES' => append_sid('posting.'.$phpEx.'?mode=smilies') )
);

$template->assign_block_vars('switch_quick_reply', array() );

if(!$userdata['session_logged_in'] )
{
$template->assign_block_vars('switch_quick_reply.switch_user_logged_out', array() );
}
else
{
$template->assign_block_vars('switch_quick_reply.switch_user_logged_in', array() );
}
}
//
// Simple Quick Reply MOD
//

In viewtopic_body.tpl:

<!-- BEGIN switch_quick_reply -->
<form action="{S_POSTING}" method="post" name="post" onsubmit="return checkForm(this)" id="quickreply">
<script language="JavaScript" type="text/javascript"><!--
function checkForm() {
formErrors = false;
if (document.post.message.value.length < 2) {
formErrors = '{L_EMPTY_MSG}';
}
if (formErrors) {
alert(formErrors);
return false;
} else {
return true;
}
}
//--></script>
<table border="0" cellpadding="3" cellspacing="1" class="forumline" align="center">
<tr>
<th class="thHead" colspan="2" height="25" id="quickreply_head"><b>{L_QUICK_REPLY}</b></th>
</tr>
<!-- BEGIN switch_user_logged_out -->
<tr>
<td class="row1"><span class="gen"><b>{L_USERNAME}:</b></span></td>
<td class="row2"><span class="genmed"><input class="post" type="text" name="username" size="25" maxlength="25" value="" /></span></td>
</tr>
<!-- END switch_user_logged_out -->
<tr>
<td width="22%" class="row1" valign="top"><span class="gen"><b>{L_MESSAGE_BODY}:</b></span><br /><br /><span class="gensmall"><a href="{U_QUICK_SMILIES}" onclick="window.open('{U_QUICK_SMILIES}', '_phpbbsmilies', 'HEIGHT=300,resizable=yes,scrollbars=yes,WIDTH=250');return false;" target="_phpbbsmilies">{L_QUICK_SMILIES}</a></span></td>
<td width="78%" class="row2" valign="top"><textarea name="message" rows="10" cols="35" wrap="virtual" style="width:450px" class="post"></textarea></td>
</tr>
<tr>
<td class="catBottom" colspan="2" align="center" height="28">
<input type="hidden" name="attach_sig" value="{S_ATTACH_SIG}" />
<input type="hidden" name="notify" value="{S_NOTIFY}" />
<input type="hidden" name="mode" value="reply" />
<input type="hidden" name="sid" value="{S_SID}" />
<input type="hidden" name="t" value="{S_TOPIC_ID}" />
<input type="submit" name="preview" class="mainoption" value="{L_PREVIEW}" />&nbsp;<input type="submit" accesskey="s" name="post" class="mainoption" value="{L_SUBMIT}" />
</td>
</tr>
</table>
</form>
<!-- END switch_quick_reply -->

In lang_main.php:

// Simple Quick Reply MOD
$lang['Quick_Reply'] = 'Quick Reply';
$lang['Quick_Reply_Smilies'] = 'Add smilies';
$lang['Quick_Reply_Hide'] = 'Hide Quick Reply';

I did try to find help on the phpBB forum that provided this but was unable to find it.

Thanks for any help :)

eelixduppy

4:41 pm on Mar 27, 2007 (gmt 0)



Have you figured this out yet? You will probably get a better response if you asked your question where you found this script. If you have debugged the script already, and have a specific question, then I'm sure someone here will be more than willing to assist you. :)

Best of luck!

Jeigh

6:39 am on Mar 28, 2007 (gmt 0)

10+ Year Member



I havn't figured this out yet, I checked the forum where I got this modification from and other people were having the same problem but it seems that support wasnt being offered on it anymore and the posts had gone unanswered for a while so I thought I'd try here. :)