Simple Machines Community Forum

Customizing SMF => Graphics and Templates => Topic started by: Gonzalo Higuaín on July 25, 2015, 01:20:56 PM

Title: I move quickreply first_message ... Why error?
Post by: Gonzalo Higuaín on July 25, 2015, 01:20:56 PM
move quickreply first_message (Why error?)

Hello!! SMF Team. I'm not good at English. I love SMF & Design but I a little knowledge. Please Help me.

Step by Step
1.I Copy+delete code.
Start code.
if ($context['can_reply'] && !empty($options['display_quick_reply']))
   {
      echo '
         <a id="quickreply"></a>
         <div class="tborder" id="quickreplybox">

End code.
aSwapLinks: [
                     {
                        sId: \'msg_', $msgid, '_ignored_link\',
                        msgExpanded: \'\',
                        msgCollapsed: ', JavaScriptEscape($txt['show_ignore_user_post']), '
                     }
                  ]
               });';
      }
   }

   echo '
            // ]]></script>';

2. I Search code.
<hr class="post_separator" />';

3. paste code after and add code if ($message['id'] == $context['first_message'])
if ($message['id'] == $context['first_message'])
if ($context['can_reply'] && !empty($options['display_quick_reply']))
{
echo '
<a id="quickreply"></a>
<div class="tborder" id="quickreplybox">
<div class="cat_bar">
<h3 class="catbg">
<span class="ie6_header floatleft"><a href="javascript:oQuickReply.swap();">
<img src="', $settings['images_url'], '/', $options['display_quick_reply'] == 2 ? 'collapse' : 'expand', '.gif" alt="+" id="quickReplyExpand" class="icon" />
</a>
<a href="javascript:oQuickReply.swap();">', $txt['quick_reply'], '</a>
</span>
</h3>
</div>
<div id="quickReplyOptions"', $options['display_quick_reply'] == 2 ? '' : ' style="display: none"', '>
<span class="upperframe"><span></span></span>
<div class="roundframe">
<p class="smalltext lefttext">', $txt['quick_reply_desc'], '</p>
', $context['is_locked'] ? '<p class="alert smalltext">' . $txt['quick_reply_warning'] . '</p>' : '',
$context['oldTopicError'] ? '<p class="alert smalltext">' . sprintf($txt['error_old_topic'], $modSettings['oldTopicDays']) . '</p>' : '', '
', $context['can_reply_approved'] ? '' : '<em>' . $txt['wait_for_approval'] . '</em>', '
', !$context['can_reply_approved'] && $context['require_verification'] ? '<br />' : '', '
<form action="', $scripturl, '?board=', $context['current_board'], ';action=post2" method="post" accept-charset="', $context['character_set'], '" name="postmodify" id="postmodify" onsubmit="submitonce(this);" style="margin: 0;">
<input type="hidden" name="topic" value="', $context['current_topic'], '" />
<input type="hidden" name="subject" value="', $context['response_prefix'], $context['subject'], '" />
<input type="hidden" name="icon" value="xx" />
<input type="hidden" name="from_qr" value="1" />
<input type="hidden" name="notify" value="', $context['is_marked_notify'] || !empty($options['auto_notify']) ? '1' : '0', '" />
<input type="hidden" name="not_approved" value="', !$context['can_reply_approved'], '" />
<input type="hidden" name="goback" value="', empty($options['return_to_post']) ? '0' : '1', '" />
<input type="hidden" name="last_msg" value="', $context['topic_last_message'], '" />
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
<input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" />';

// Guests just need more.
if ($context['user']['is_guest'])
echo '
<strong>', $txt['name'], ':</strong> <input type="text" name="guestname" value="', $context['name'], '" size="25" class="input_text" tabindex="', $context['tabindex']++, '" />
<strong>', $txt['email'], ':</strong> <input type="text" name="email" value="', $context['email'], '" size="25" class="input_text" tabindex="', $context['tabindex']++, '" /><br />';

// Is visual verification enabled?
if ($context['require_verification'])
echo '
<strong>', $txt['verification'], ':</strong>', template_control_verification($context['visual_verification_id'], 'quick_reply'), '<br />';

echo '
<div class="quickReplyContent">
<textarea cols="600" rows="7" name="message" tabindex="', $context['tabindex']++, '"></textarea>
</div>
<div class="righttext padding">
<input type="submit" name="post" value="', $txt['post'], '" onclick="return submitThisOnce(this);" accesskey="s" tabindex="', $context['tabindex']++, '" class="button_submit" />
<input type="submit" name="preview" value="', $txt['preview'], '" onclick="return submitThisOnce(this);" accesskey="p" tabindex="', $context['tabindex']++, '" class="button_submit" />';

if ($context['show_spellchecking'])
echo '
<input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'postmodify\', \'message\');" tabindex="', $context['tabindex']++, '" class="button_submit" />';

echo '
</div>
</form>
</div>
<span class="lowerframe"><span></span></span>
</div>
</div>';
}
else
echo '
<br class="clear" />';

if ($context['show_spellchecking'])
echo '
<form action="', $scripturl, '?action=spellcheck" method="post" accept-charset="', $context['character_set'], '" name="spell_form" id="spell_form" target="spellWindow"><input type="hidden" name="spellstring" value="" /></form>
<script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/spellcheck.js"></script>';

echo '
<script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/topic.js"></script>
<script type="text/javascript"><!-- // --><![CDATA[';

if (!empty($options['display_quick_reply']))
echo '
var oQuickReply = new QuickReply({
bDefaultCollapsed: ', !empty($options['display_quick_reply']) && $options['display_quick_reply'] == 2 ? 'false' : 'true', ',
iTopicId: ', $context['current_topic'], ',
iStart: ', $context['start'], ',
sScriptUrl: smf_scripturl,
sImagesUrl: "', $settings['images_url'], '",
sContainerId: "quickReplyOptions",
sImageId: "quickReplyExpand",
sImageCollapsed: "collapse.gif",
sImageExpanded: "expand.gif",
sJumpAnchor: "quickreply"
});';

if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $context['can_remove_post'])
echo '
var oInTopicModeration = new InTopicModeration({
sSelf: \'oInTopicModeration\',
sCheckboxContainerMask: \'in_topic_mod_check_\',
aMessageIds: [\'', implode('\', \'', $removableMessageIDs), '\'],
sSessionId: \'', $context['session_id'], '\',
sSessionVar: \'', $context['session_var'], '\',
sButtonStrip: \'moderationbuttons\',
sButtonStripDisplay: \'moderationbuttons_strip\',
bUseImageButton: false,
bCanRemove: ', $context['can_remove_post'] ? 'true' : 'false', ',
sRemoveButtonLabel: \'', $txt['quickmod_delete_selected'], '\',
sRemoveButtonImage: \'delete_selected.gif\',
sRemoveButtonConfirm: \'', $txt['quickmod_confirm'], '\',
bCanRestore: ', $context['can_restore_msg'] ? 'true' : 'false', ',
sRestoreButtonLabel: \'', $txt['quick_mod_restore'], '\',
sRestoreButtonImage: \'restore_selected.gif\',
sRestoreButtonConfirm: \'', $txt['quickmod_confirm'], '\',
sFormId: \'quickModForm\'
});';

echo '
if (\'XMLHttpRequest\' in window)
{
var oQuickModify = new QuickModify({
sScriptUrl: smf_scripturl,
bShowModify: ', $settings['show_modify'] ? 'true' : 'false', ',
iTopicId: ', $context['current_topic'], ',
sTemplateBodyEdit: ', JavaScriptEscape('
<div id="quick_edit_body_container" style="width: 90%">
<div id="error_box" style="padding: 4px;" class="error"></div>
<textarea class="editor" name="message" rows="12" style="' . ($context['browser']['is_ie8'] ? 'width: 635px; max-width: 100%; min-width: 100%' : 'width: 100%') . '; margin-bottom: 10px;" tabindex="' . $context['tabindex']++ . '">%body%</textarea><br />
<input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '" />
<input type="hidden" name="topic" value="' . $context['current_topic'] . '" />
<input type="hidden" name="msg" value="%msg_id%" />
<div class="righttext">
<input type="submit" name="post" value="' . $txt['save'] . '" tabindex="' . $context['tabindex']++ . '" onclick="return oQuickModify.modifySave(\'' . $context['session_id'] . '\', \'' . $context['session_var'] . '\');" accesskey="s" class="button_submit" />&nbsp;&nbsp;' . ($context['show_spellchecking'] ? '<input type="button" value="' . $txt['spell_check'] . '" tabindex="' . $context['tabindex']++ . '" onclick="spellCheck(\'quickModForm\', \'message\');" class="button_submit" />&nbsp;&nbsp;' : '') . '<input type="submit" name="cancel" value="' . $txt['modify_cancel'] . '" tabindex="' . $context['tabindex']++ . '" onclick="return oQuickModify.modifyCancel();" class="button_submit" />
</div>
</div>'), ',
sTemplateSubjectEdit: ', JavaScriptEscape('<input type="text" style="width: 90%;" name="subject" value="%subject%" size="80" maxlength="80" tabindex="' . $context['tabindex']++ . '" class="input_text" />'), ',
sTemplateBodyNormal: ', JavaScriptEscape('%body%'), ',
sTemplateSubjectNormal: ', JavaScriptEscape('<a href="' . $scripturl . '?topic=' . $context['current_topic'] . '.msg%msg_id%#msg%msg_id%" rel="nofollow">%subject%</a>'), ',
sTemplateTopSubject: ', JavaScriptEscape($txt['topic'] . ': %subject% &nbsp;(' . $txt['read'] . ' ' . $context['num_views'] . ' ' . $txt['times'] . ')'), ',
sErrorBorderStyle: ', JavaScriptEscape('1px solid red'), '
});

aJumpTo[aJumpTo.length] = new JumpTo({
sContainerId: "display_jump_to",
sJumpToTemplate: "<label class=\"smalltext\" for=\"%select_id%\">', $context['jump_to']['label'], ':<" + "/label> %dropdown_list%",
iCurBoardId: ', $context['current_board'], ',
iCurBoardChildLevel: ', $context['jump_to']['child_level'], ',
sCurBoardName: "', $context['jump_to']['board_name'], '",
sBoardChildLevelIndicator: "==",
sBoardPrefix: "=> ",
sCatSeparator: "-----------------------------",
sCatPrefix: "",
sGoButtonLabel: "', $txt['go'], '"
});

aIconLists[aIconLists.length] = new IconList({
sBackReference: "aIconLists[" + aIconLists.length + "]",
sIconIdPrefix: "msg_icon_",
sScriptUrl: smf_scripturl,
bShowModify: ', $settings['show_modify'] ? 'true' : 'false', ',
iBoardId: ', $context['current_board'], ',
iTopicId: ', $context['current_topic'], ',
sSessionId: "', $context['session_id'], '",
sSessionVar: "', $context['session_var'], '",
sLabelIconList: "', $txt['message_icon'], '",
sBoxBackground: "transparent",
sBoxBackgroundHover: "#ffffff",
iBoxBorderWidthHover: 1,
sBoxBorderColorHover: "#adadad" ,
sContainerBackground: "#ffffff",
sContainerBorder: "1px solid #adadad",
sItemBorder: "1px solid #ffffff",
sItemBorderHover: "1px dotted gray",
sItemBackground: "transparent",
sItemBackgroundHover: "#e0e0f0"
});
}';

if (!empty($ignoredMsgs))
{
echo '
var aIgnoreToggles = new Array();';

foreach ($ignoredMsgs as $msgid)
{
echo '
aIgnoreToggles[', $msgid, '] = new smc_Toggle({
bToggleEnabled: true,
bCurrentlyCollapsed: true,
aSwappableContainers: [
\'msg_', $msgid, '_extra_info\',
\'msg_', $msgid, '\',
\'msg_', $msgid, '_footer\',
\'msg_', $msgid, '_quick_mod\',
\'modify_button_', $msgid, '\',
\'msg_', $msgid, '_signature\'

],
aSwapLinks: [
{
sId: \'msg_', $msgid, '_ignored_link\',
msgExpanded: \'\',
msgCollapsed: ', JavaScriptEscape($txt['show_ignore_user_post']), '
}
]
});';
}
}

echo '
// ]]></script>';



The problem is
1. CSS error.
2. Can't click botton.


(http://upic.me/i/ml/144untitled.jpg)


THANK YOU !!!! ;D :D :)
Title: Re: I move quickreply first_message ... Why error?
Post by: margarett on July 25, 2015, 03:40:39 PM
Yes you can't really to that with such ease (a form inside a form shouldn't be a good idea)

This should work for you
http://custom.simplemachines.org/mods/index.php?mod=1792
You need to emulate 2.0 RC4 to install it but it works fine
How can I install a mod that doesn't work in my SMF version? (http://wiki.simplemachines.org/smf/How_can_I_install_a_mod_that_doesn%27t_work_in_my_SMF_version)

This allows you to have QR *before* the 1st post
http://custom.simplemachines.org/mods/index.php?mod=2929
Title: Re: I move quickreply first_message ... Why error?
Post by: Gonzalo Higuaín on July 26, 2015, 12:56:41 PM
I Install Mod http://custom.simplemachines.org/mods/index.php?mod=1792 (http://custom.simplemachines.org/mods/index.php?mod=1792) success!

but display-page not change(original)
(http://upic.me/i/fb/145untitled.jpg)



I want design move quickreply add after first_message

Please Help me...

(http://upic.me/i/ml/144untitled.jpg)
Title: Re: I move quickreply first_message ... Why error?
Post by: Kindred on July 26, 2015, 05:42:21 PM
Quote from: margarett on July 25, 2015, 03:40:39 PM
Yes you can't really to that with such ease (a form inside a form shouldn't be a good idea)

Additionally... as ause experience, what you are asking for is a BAD user experience... it's poor design, because the quick reply does not BELONG after the "first post" - it belongs after the LAST post...