Thêm liên kết đánh dấu bài trích dẫn
Giới thiệu
Khi bạn trích dẫn bài viết, code này sẽ thêm liên kết đến bài đó vào nội dung.Demo
![[TUTs] Thêm liên kết đánh dấu bài trích dẫn Quote10](https://i.servimg.com/u/f56/18/59/49/93/quote10.png)
Xem demo
Hướng dẫn
Bước 1
ACP >> Display >> Pictures and Colors >> Colors >> CSS StylesheetThêm vào CSS
- Code:
.post .quoteLink{display:inline-block;height:10px;width:12px;background:url(http://i83.servimg.com/u/f83/16/58/89/73/viewpo10.png) no-repeat transparent;margin-left:3px}
Bước 2
ACP >> Display >> QLTT >> Viewtopic_bodyThêm vào cuối
- Code:
<script type="text/javascript">
//<![CDATA[
$(".post a[href*='&mode=quote']").attr("href", function () {
return this.href + "&r=" + location.pathname.replace(/\/(t\d+(p\d+)?)\-.*/, "$1");
});
$(".post a[href*='/t'][href*='-quote#']").next("br").remove().end().each(function () {
$(this).addClass("quoteLink").attr("href", function () {
return this.href.replace("quote", location.pathname.replace(/\/t\d+(p\d+)?-(.+)/, "$2"))
}).appendTo($(this).next("blockquote").find("cite:first"));
});
//]]>
</script>
Bước 3
ACP >> Display >> Post & Tin nhắn >> posting_bodyThêm vào trước {SCEDITOR}
- Code:
<script type="text/javascript">
//<![CDATA[
if (/r\=t\d+(p\d+)?/.test(location.search)) {
$("#text_editor_textarea").val("[url=http://" + location.host + "/" + GetParam("r") + "-quote#" + GetParam("p") + "][/url]" + $("#text_editor_textarea").val());
}
$(".post a[href*='/t'][href*='-quote#']").next("br").remove().end().each(function () {
$(this).addClass("quoteLink").appendTo($(this).next("blockquote").find("cite:first"));
});
//]]>
</script>