Demo:
Cách làm:
Bước 1 : ACP --> QLTT --> Forum --> Security
Unauthorize unofficial forms to post messages and private messages on the forum : Không
Bước 2 : ACP --> Display --> CSS :
Title : Quick send message on wall
Place : In all the page
Cách làm:
Bước 1 : ACP --> QLTT --> Forum --> Security
Unauthorize unofficial forms to post messages and private messages on the forum : Không
Bước 2 : ACP --> Display --> CSS :
- Code:
#DNT-walleditor {
background: #fadcaf;
padding: 5px;
margin-bottom: 5px;
box-shadow: inset 0 0 8px #f09839;
-moz-box-shadow: 0 0 5px #f2d4a7;
-webkit-box-shadow: 0 0 5px #f2d4a7;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
max-width: 70%;
border: 1px solid #fc8200;
margin: 10px auto;
}
#DNT-walleditor span {
padding: 3px 10px;
margin: 0 2px;
display :inline-block;
border: 1.5px solid #9e6002;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
font-size: 1.2em;
color: #333333;
text-shadow: 0 1px white;
cursor: pointer;
opacity: 0.4;
}
#DNT-walleditor span:hover {
-moz-box-shadow: inset 0 0 20px white;
-webkit-box-shadow: inset 0 0 20px white;
opacity: 1;
box-shadow: inset 0 0 20px white;
}
#wallmessage {
width: 99%;
height: 85px;
border: 1px solid #2e2e2e;
border-radius: 3px;
color: #1a1a1a;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
margin-top :10px;
}
#sendmessage{
border: 1px solid #c98e46;
border-radius: 3px;
color: white!important;
padding: 3px;
margin-top: 10px;
background: #e3884b;
font-weight: bold;
cursor: pointer;
opacity: 1!important;
text-shadow: none!important;
}
#sendmessage:hover {
text-shadow: none!importamt;
box-shadow: none!importamt;
-moz-box-shadow: none!importamt;
-webkit-box-shadow: none!importamt
}
Title : Quick send message on wall
Place : In all the page
- Code:
$(function(){
if (window.location.pathname.indexOf('/u') == 0 && window.location.pathname.split('w')[1] == "all"){
var href= $('a[href*="mode=post_profile"]').attr("href");
var name = $("#profile-advanced-right .main-head:first").text().substring(0, $("#profile-advanced-right .main-head:first").text().lastIndexOf(" "));
$("#profile-advanced-details .main-content").before('<form action="/privmsg?mode=post_profile" id="DNT-walleditor" onsubmit="return vB_Editor[\'text_editor\'].prepare_submit(0,0)" name="post" method="post" enctype="multipart/form-data"><span class = "wallbutton" value="b" style="font-weight:bold">B</span><span class = "wallbutton" value="i" style="font-style: italic">I</span><span class = "wallbutton" value ="u" style="text-decoration: underline">U</span><span class = "wallbutton" value ="strike" style="text-decoration: line-through;font-weight:bold">S</span><span class = "wallbutton" value="code">Code</span><span class = "wallbutton" value="quote">Quote</span><span class = "wallbutton" value="img">IMG</span><textarea id="wallmessage" placeholder="Gửi tin nhắn..." name="message"></textarea>\n<span id="sendmessage">Gửi tin nhắn</span></form>');
$(".wallbutton").click(function(){
var a = $(this).attr("value");
$("#wallmessage").val($("#wallmessage").val()+'['+a+'][/'+a+']');
});
$("#sendmessage").click(function(){
if($("#wallmessage").val().replace(/\s/g , '').length < 1) {
alert("Bạn phải nhập nội dung mới có thể gửi tin nhắn");
}
else{
$("#DNT-walleditor").before('<div style="margin-left: 300px;" class="ajaxload"><img src="http://i43.servimg.com/u/f43/16/03/04/56/black-10.gif"/></div>');
var valmsg = $("#wallmessage").val();
$.post(href, {
subject: "Tin nhắn",
message: valmsg,
username : name,
mode: "post_profile",
folder: "profile",
"auth[]": $("input[name='auth[]']:last").val(),
post: "Send"
}, function (a) {
console.log(a);
if ($(a).find(".message a[href*='wall']").length){
$.get(window.location.pathname , function(b){
if($("ol li").length){
$(b).find("ol li:first").hide().insertBefore("ol li:first").slideDown(400);
}
else {
$("#profile-advanced-details .main-content").html($(b).find("#profile-advanced-details .main-content").html());
}
});
$("#wallmessage").val("");
$(".ajaxload").remove();
}
else{
alert("Gặp lỗi trong việc gửi bài . Hãy F5 để thử lại");
}
});
}
});
}
});
Được sửa bởi noname2103 ngày Wed Dec 18, 2013 8:12 pm; sửa lần 1.