[Hỏi đáp] Tìm lại code

  Bài viết hay nhất1
Tình hình là em mới làm forum mới nhưng muốn tìm code quote nhanh của PunBB , em đã tìm rất nhiều nhưng thử vẫn không thành công.
Nay em muốn tìm lại chính nó ạ.
Thanks nhiều ạ !
  Bài viết hay nhất2
Link forum+Demo????
  Bài viết hay nhất3
sao bạn ko dùng backup templates ấy nhỉ
  Bài viết hay nhất4

kingofgame wrote:Link forum+Demo????
Link forum: http://forumchemgio123.123.st/
Nick test : duatthoi
Mật khẩu nick test : Duat2005
  Bài viết hay nhất5
mấy chú thích làm cho mọi thứ rắc rối hóa :v
tạo file js, check vào in the topic
Code:

function getSelectionText() {
    var text;
    if (window.getSelection) {
        text = window.getSelection().toString();
    } else if (document.selection && document.selection.type != 'Control') {
        text = document.selection.createRange().text;
    }
    return text;
}
function fadeIn(newEl, display) {
  newEl.style.opacity = 0;
  newEl.style.display = display || 'inline';
  (function fade() {
    var val = parseFloat(newEl.style.opacity);
    if (!((val += .1) > 1)) {
      newEl.style.opacity = val;
      requestAnimationFrame(fade);
    }
  })();
}
$(function() {
if(_userdata["session_logged_in"] === 1) {
  var newEl = document.createElement('span');
  newEl.className = 'quote_selection';
  newEl.innerHTML = 'Quote';
  style = document.createElement('style');
  style.type = 'text/css';
  style.innerHTML = '.quote_selection {' +
                    '  background: #f0f0f0;' +
                    '  color: #333;' +
                    '  cursor: pointer;' +
                    '  border-radius: 3px;' +
                    '  -webkit-border-radius: 3px;' +
                    '  -moz-border-radius: 3px;' +
                    '  display: none;' +
                    '  -webkit-touch-callout: none;' +
                    '  -webkit-user-select: none;' +
                    '  -khtml-user-select: none;' +
                    '  -moz-user-select: none;' +
                    '  -ms-user-select: none;' +
                    '  user-select: none;' +
                    '  padding: 2px 8px;' +
                    '  position: absolute;' +
                    '  border: 1px solid #ddd;' +
                    '  text-shadow: rgba(255,255,255,0.55) 0px 1px 0px;' +
                    '  font-size: 11px;' +
                    '  -webkit-box-shadow: rgba(0,0,0,0.1) 0px 1px 3px;' +
                    '  -moz-box-shadow: rgba(0,0,0,0.1) 0px 1px 3px;' +
                    '  box-shadow: rgba(0,0,0,0.1) 0px 1px 3px;' +
                    '}';
  document.body.appendChild(style);
  document.body.appendChild(newEl);
  var x = document.querySelectorAll('.post-entry');
  for (var i = 0; i < x.length; i++) {
        x[i].addEventListener('mouseup', function(e) {
            var selectedTxt = getSelectionText();
            if (selectedTxt) {
            fadeIn(newEl);
            newEl.style.top = e.pageY + 'px';
            newEl.style.left = e.pageX + 'px';
            var author = this.parentNode.firstChild.firstChild.firstChild.textContent;
            newEl.onclick = function() {
              $('#text_editor_textarea').sceditor('instance').insertText('[quote="' + author + '"]' + getSelectionText() + '[/quote]');
              newEl.style.display = 'none';
            };
            } else {newEl.style.display = 'none';}
        });
  }
}
});
áp dụng cho quickrep mặc định của punbb
P/S: hôm sau đặt cái đề chú ý tí nhé ^_~
  Bài viết hay nhất6
Vẫn không được ạ
  Bài viết hay nhất7
Code:
https://www.google.com/#q=quote+kh%C3%B4ng+chuy%E1%BB%83n+trang+forumotion
Tìm cái nào phù hợp với forum nhé
  Bài viết hay nhất8
EM đã thử hết nhưng ko thành công ạ
  Bài viết hay nhất9

trandangduat wrote:EM đã thử hết nhưng ko thành công ạ

Thử cái này xem. Làm cách này nhanh, gọn hơn. Nhờ là punbb mặc định nhé.

Code:
// Quick quote by markai
$(function(){
 $('.post a[href*="mode=quote"]').click(function(t){t.preventDefault();var e=$(".sceditor-container").attr("class");if(e.indexOf("sourceMode")>-1)var o=!0;else var o=!1;var i=($(this).closest(".post"),$(this).attr("href"));$("body").append('<div class="quoteload" style="position: fixed;top: 0;width: 100%;height: 100%;background: rgba(0, 0, 0, 0.35);z-index: 999;"><img src="http://printon.md/images/loading.gif" style="position: absolute;top: 35%;left: 45%;"></div>'),$.get(i).done(function(t){var e=$(t).find("#text_editor_textarea").text();0==o&&$(".sceditor-button-source").trigger("click"),$("#quick_reply textarea").sceditor("instance").insert(e),$(".sceditor-button-source").trigger("click"),$("body").animate({scrollTop:$("#quick_reply").offset().top},"200"),$(".quoteload").remove()})});
});
  Bài viết hay nhất10
Kelvin_Kingleon wrote:mấy chú thích làm cho mọi thứ rắc rối hóa :v
tạo file js, check vào in the topic
Code:

function getSelectionText() {
    var text;
    if (window.getSelection) {
        text = window.getSelection().toString();
    } else if (document.selection && document.selection.type != 'Control') {
        text = document.selection.createRange().text;
    }
    return text;
}
function fadeIn(newEl, display) {
  newEl.style.opacity = 0;
  newEl.style.display = display || 'inline';
  (function fade() {
    var val = parseFloat(newEl.style.opacity);
    if (!((val += .1) > 1)) {
      newEl.style.opacity = val;
      requestAnimationFrame(fade);
    }
  })();
}
$(function() {
if(_userdata["session_logged_in"] === 1) {
   var newEl = document.createElement('span');
   newEl.className = 'quote_selection';
   newEl.innerHTML = 'Quote';
   style = document.createElement('style');
   style.type = 'text/css';
   style.innerHTML = '.quote_selection {' +
                     '  background: #f0f0f0;' +
                     '  color: #333;' +
                     '  cursor: pointer;' +
                     '  border-radius: 3px;' +
                     '  -webkit-border-radius: 3px;' +
                     '  -moz-border-radius: 3px;' +
                     '  display: none;' +
                     '  -webkit-touch-callout: none;' +
                     '  -webkit-user-select: none;' +
                     '  -khtml-user-select: none;' +
                     '  -moz-user-select: none;' +
                     '  -ms-user-select: none;' +
                     '  user-select: none;' +
                     '  padding: 2px 8px;' +
                     '  position: absolute;' +
                     '  border: 1px solid #ddd;' +
                     '  text-shadow: rgba(255,255,255,0.55) 0px 1px 0px;' +
                     '  font-size: 11px;' +
                     '  -webkit-box-shadow: rgba(0,0,0,0.1) 0px 1px 3px;' +
                     '  -moz-box-shadow: rgba(0,0,0,0.1) 0px 1px 3px;' +
                     '  box-shadow: rgba(0,0,0,0.1) 0px 1px 3px;' +
                     '}';
   document.body.appendChild(style);
   document.body.appendChild(newEl);
   var x = document.querySelectorAll('.post-entry');
   for (var i = 0; i < x.length; i++) {
        x[i].addEventListener('mouseup', function(e) {
             var selectedTxt = getSelectionText();
             if (selectedTxt) {
             fadeIn(newEl);
             newEl.style.top = e.pageY + 'px';
             newEl.style.left = e.pageX + 'px';
             var author = this.parentNode.firstChild.firstChild.firstChild.textContent;
             newEl.onclick = function() {
               $('#text_editor_textarea').sceditor('instance').insertText('[quote="' + author + '"]' + getSelectionText() + '[/quote]');
               newEl.style.display = 'none';
             };
             } else {newEl.style.display = 'none';}
        });
   }
}
});
áp dụng cho quickrep mặc định của punbb
P/S: hôm sau đặt cái đề chú ý tí nhé ^_~


Chôm cái này ở đâu thế ^^. Cái này quote bài viết thuần text thôi. Những bài viết chứa video hoặc các bài viết có nhiều block quote không dùng được nhé. Thay vì dùng hàm copy text lại khộng trực tiếp lấy nguyên cái html của bài viết chèn vào wysiwyg của sceditor luôn cho nhanh.
  Bài viết hay nhất11
@markai30 : Vẫn không được ạ
Hay là em gửi nick Admin của forum em cho anh sửa nhé
Cũng có thể là forum em bị xung đột
  Bài viết hay nhất12

trandangduat wrote:@markai30 : Vẫn không được ạ
Hay là em gửi nick Admin của forum em cho anh sửa nhé
Cũng có thể là forum em bị xung đột

Lỗi do xài việt hóa button nhé. Đã fix giúp rồi.
  Bài viết hay nhất13
@markai30 : Thank anh rát nhiều
  Bài viết hay nhất14
Nhưng em lại mất cái button ạ

Tin nhắn từ Boom: Lần sau dùng chức năng "Sửa bài" để thêm nhé, không post liên tiếp 2 bài.
  Bài viết hay nhất15
You cannot reply to topics in this forum