Webboard

Pełna wersja: Nie działa szybka odpowiedź w prywatnych wiadomościach
Aktualnie przeglądasz uproszczoną wersję forum. Kliknij tutaj, by zobaczyć wersję z pełnym formatowaniem.
Adres forum:
GameSkill.pl


Wersja silnika:
Najnowsza


Opis problemu:
Tak jak w tytule, nie działa szybka odpowiedź w wiadomościach prywatnych.
Na domyślnym szablonie działają.

private_quickreply szablonu domyślnego:
Kod:
<br />
<form action="private.php" method="post" name="input">
<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
<input type="hidden" name="to" value="{$to}" />
<input type="hidden" name="bcc" value="{$bcc_form_val}" />
<input type="hidden" name="subject" value="Re: {$subject}" />
<input type="hidden" name="action" value="do_send" />
<input type="hidden" name="pmid" value="{$pmid}" />
<input type="hidden" name="do" value="reply" />
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<thead>
<tr>
<td class="thead{$collapsedthead['quickreply']}" colspan="2">
<div class="expcolimage"><img src="{$theme['imgdir']}/collapse{$collapsedimg['quickreply']}.png" id="quickreply_img" class="expander" alt="{$expaltext}" title="{$expaltext}" /></div>
<div><strong>{$lang->quick_reply}</strong></div>
</td>
</tr>
</thead>
<tbody style="{$collapsed['quickreply_e']}" id="quickreply_e">
<tr>
              <td class="{$trow}" valign="top" width="22%">
<strong>{$lang->message}</strong><br />
<span class="smalltext">{$lang->message_note}<br /><br />
<label><input type="checkbox" class="checkbox" name="options[signature]" value="1"{$optionschecked['signature']} {$postoptionschecked['signature']} />&nbsp;<strong>{$lang->quickreply_signature}</strong></label><br />
<label><input type="checkbox" class="checkbox" name="options[disablesmilies]" value="1"{$optionschecked['disablesmilies']} />&nbsp;<strong>{$lang->quickreply_disable_smilies}</strong></label><br />
<label><input type="checkbox" class="checkbox" name="options[savecopy]" value="1"{$optionschecked['savecopy']} />&nbsp;<strong>{$lang->quickreply_save_copy}</strong></label>{$private_send_tracking}</span>
</td>
<td class="{$trow}">
<div style="width: 95%">
<textarea style="width: 100%; padding: 4px; margin: 0;" rows="8" cols="80" name="message" id="message" tabindex="1">{$quoted_message}</textarea>
</div>
</td>
</tr>
<tr>
<td colspan="2" align="center" class="tfoot"><input type="submit" class="button" value="{$lang->send_message}" tabindex="2" accesskey="s" /> <input type="submit" class="button" name="preview" value="{$lang->preview}" tabindex="3" /></td>
</tr>
</tbody>
</table>
</form>

private_quickreply mojego szablonu:
Kod:
<br />
<form action="private.php" method="post" name="input">
<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
<input type="hidden" name="to" value="{$to}" />
<input type="hidden" name="bcc" value="{$bcc_form_val}" />
<input type="hidden" name="subject" value="Re: {$subject}" />
<input type="hidden" name="action" value="do_send" />
<input type="hidden" name="pmid" value="{$pmid}" />
<input type="hidden" name="do" value="reply" />
<div class="category qreply">
<div class="post_title">
<h2 class="title">{$lang->quick_reply}</h2>
</div>
<div class="content" id="qreply_container">
<div class="settings">
<h4 class="subtitle">{$lang->message}</h4>
<h5 class="subtitle">{$lang->message_note}</h5>
<label>
<input type="checkbox" class="checkbox" name="options[signature]" value="1"{$optionschecked['signature']} {$postoptionschecked['signature']} />&nbsp;<strong>{$lang->quickreply_signature}</strong>
</label><br />
<label>
<input type="checkbox" class="checkbox" name="options[disablesmilies]" value="1"{$optionschecked['disablesmilies']} />&nbsp;<strong>{$lang->quickreply_disable_smilies}</strong>
</label><br />
<label>
<input type="checkbox" class="checkbox" name="options[savecopy]" value="1"{$optionschecked['savecopy']} />&nbsp;<strong>{$lang->quickreply_save_copy}</strong>
</label>
{$private_send_tracking}</span>
</div>
<div class="text_content">
<textarea style="width: 100%; padding: 4px; margin: 0;" rows="8" cols="80" name="message" id="message" tabindex="1">{$quoted_message}</textarea>
<div class="row_buttons">
<input type="submit" class="button2" value="{$lang->send_message}" tabindex="2" accesskey="s" /> 
<input type="submit" class="button2" name="preview" value="{$lang->preview}" tabindex="3" />
</div>
</div>
</div>
</div>
</form>

Konto testowe, na którym można przetestować, że szybka odpowiedź nie działa:
Login: test
Hasło: 123456
Zacznij od zaktualizowania js względem domyślnego stylu. Konsola ci wypluwa błąd, wystarczy kopiuj/wklej z domyślnego stylu (szablon private_read).

Zamień cały theme.js na ten:

Kod:
(function($) {
    $.fn.selectize = function(options) {
        var settings = $.extend({
            auto_submit: false,
            list_direction: "bottom",
        }, options);
        return this.each(function() {
            var s = $(this);
            if (s.is("select")) {
                if (s.attr("selectized") != 1) {
                    s.hide();
                    var id = s.attr("name");
                    var n = s.attr("data-select-name");
                    s.parent().append("<div class='selectize selectize--" + settings.list_direction + "' data-id='" + id + "'><div class='selectize__open dropdown-icon'>" + n + "</div><div class='selectize__options'></div></div>");
                    var h = s.siblings(".selectize[data-id=" + id + "]");
                    if (s.find("option").length > 0) {
                        s.find("option").each(function() {
                            var c = $(this);
                            h.find(".selectize__options").append("<div class='selectize__options__option' data-name='" + c.attr('value') + "'>" + c.text() + "</div>");
                        }).promise().done(function() {
                            h.on('click', ".selectize__open", function() {
                                h.addClass("selectize--opened");
                                $("body").append("<div class='selectize__overlay'></diV>");
                            });
                            $("body").on('click', ".selectize__overlay", function() {
                                $(".selectize.selectize--opened").removeClass("selectize--opened");
                                $(".selectize__overlay").detach();
                            });
                            h.on('click', ".selectize__options__option", function() {
                                s.val($(this).attr("data-name"));
                                if (settings.auto_submit == true) {
                                    s.parents('form:first').submit();
                                }
                            });
                        });
                    }
                    s.attr("selectized", 1);
                }
            }
        });
    }
    $.fn.dropdown = function(options) {
        var el = $(this);
        if (typeof options["activer"] !== "undefined" && $(options["activer"]).length != 0) {
            var activer = options["activer"];
            el.hide();
            activer.click(function() {
                el.clearQueue().fadeToggle();
            });
            $(document).click(function(e) {
                if (!el.is(":hidden") && !$(e.target).is(el) && !$(e.target).parents().is(el) && !$(e.target).is(activer) && !$(e.target).parents().is(activer)) {
                    el.fadeOut();
                }
            });
        }
    }
}
)(jQuery);

$(document).ready(function() {
    $('.partners-slider').slick({
        autoplay: true,
        autoplaySpeed: 3000,
        dots: true,
        infinite: true,
        arrows: false
    });
    $(".theme select").selectize({
        auto_submit: true,
        list_direction: "top"
    });
    $(".language select").selectize({
        auto_submit: true,
        list_direction: "top"
    });

    $('.user-button').on('click', function() {
        $('.user-button').addClass("active");
        return false;
    });
    $('.text_content').on('click', function(e) {
        $(".text_content").addClass("active");
        console.log(e.target)
        return e.target.className == "button2" ? true : false;
    });
    $('#resp-menu > div.button').on('click', function(){$('#resp-menu > div.button').addClass("active")});

    $('html, body').on('click', function(e) {
        if (!document.getElementById('resp-menu').contains(e.target))
            $('.user-button, #resp-menu .button, .text_content').removeClass("active");
    });
    $(".user-drop").click(function(e) {
        e.stopPropagation();
    });

    function customCheckbox(checkboxName) {
        var checkBox = $('input[type="checkbox"]');
        $(checkBox).each(function() {
            $(this).wrap("<span class='custom-checkbox'></span>");
            if ($(this).is(':checked')) {
                $(this).parent().addClass("selected");
            }
        });
        $(checkBox).click(function() {
            $(this).parent().toggleClass("selected");
        });
    }
    $(document).ready(function() {
        customCheckbox("input");
    })

    $("#checkAll").click(function() {
        if ($(this).is(':checked')) {
            if (($('input:checkbox').not(this).parent().hasClass('selected'))) {
                $('input:checkbox').not(this).prop('checked', true).parent().addClass('selected');
            } else {
                $('input:checkbox').not(this).prop('checked', true).parent().addClass('selected');
            }
        } else {
            $('input:checkbox').not(this).prop('checked', false).parent().removeClass('selected');
        }
    });
    $('.up').click(function() {
        $("html, body").animate({
            scrollTop: 0
        }, 600);
        return false;
    });
    $('[data-toggle="tooltip"]').tooltip();
    $(".expcolimage .expander").each(function() {
        if ($(this).data('src')) {
            $(this).addClass($(this).data('src').replace('.png', ''));
        }
    });

    expandables.expandCollapse = function(e, controls) {
        element = $(e);

        if (!element || controls == false) {
            return false;
        }
        var expandedItem = $("#" + controls + "_e");
        var collapsedItem = $("#" + controls + "_c");

        if (expandedItem.length && collapsedItem.length) {
            if (expandedItem.is(":hidden")) {
                expandedItem.toggle("fast");
                collapsedItem.toggle("fast");
                this.saveCollapsed(controls);
            } else {
                expandedItem.toggle("fast");
                collapsedItem.toggle("fast");
                this.saveCollapsed(controls, 1);
            }
        } else if (expandedItem.length && !collapsedItem.length) {
            if (expandedItem.is(":hidden")) {
                expandedItem.toggle("fast");
                element.removeClass("collapse_collapsed").addClass("collapse").attr("alt", "[-]").attr("title", "[-]");
                element.parent().parent('td').removeClass('tcat_collapse_collapsed');
                element.parent().parent('.thead').removeClass('thead_collapsed');
                this.saveCollapsed(controls);
            } else {
                expandedItem.toggle("fast");
                element.removeClass("collapse").addClass("collapse_collapsed").attr("alt", "[+]").attr("title", "[+]");
                element.parent().parent('td').addClass('tcat_collapse_collapsed');
                element.parent().parent('.thead').addClass('thead_collapsed');
                this.saveCollapsed(controls, 1);
            }
        }
        return true;
    }
    ;
});

Nie testowałem, szybki debug. Nie gwarantuję, że nic się nie popsuje.
Dzięki działa