[b]Credits[/b] : Angell de Ville (Slide Comment) and Feruzz (Commentor Box)
[b]Preview[/b] : [url]http://profiles.friendster.com/bangkanal[/url] (FF view)
Ini ada tutorial sederhana utk menambahkan quick comment sederhana (tanpa smileys) secara otomatis diatas comment yg secara otomatis pula membuat comment kalian dalam bentuk slide
Tambahkan ini ke dalam JS extension kalian dan taruh di bagian paling bawah OK
[b]Ini script utk FF user only[/b]
[spoiler]comLinks=content_18.getElementsByTagName("div")[0].innerHTML
document.getElementById("18").style.display="none"
navBg.innerHTML+="<div id='myComments' class='commonbox myComments'>"
+"<h2>Testimonials and Comments for "+pageOwnerFName+"</h2>"
+"<div id='content_myComments'>"
+"<div class='viewall'>"
+comLinks
+"</div>"
+"<div class='fitem1wrapper' id='fitem1wrapperCom'>"
+"</div>"
+"</div>"
+"</div>"
document.getElementById("6").parentNode.appendChild(myComments)
testiCount=0
slideTesti=new Array()
function getComments(){
a=content_18
b=a.getElementsByTagName('table')
for(x=0;x<b.length;x++){
slideTesti[x]=b[x].innerHTML
}
tickComments()
}
function tickComments(){
if(testiCount<b.length){
fitem1wrapperCom.innerHTML=slideTesti[testiCount]
testiCount++
if(testiCount==slideTesti.length){
testiCount=0
}
setTimeout("tickComments()",3000)
}
}
if(navigator.appName.indexOf("Netscape")!=-1){
getComments()
}
if (!attachOnLoadHandler(function(){COMMENTOR.init();})) window.onload = function(){COMMENTOR.init();};
if (typeof COMMENTOR == "undefined") { COMMENTOR = {}; }
COMMENTOR = {
comment: [],
init: function() {
this.comment = document.getElementById("content_myComments").getElementsByTagName("div")[0];
this.comment.innerHTML = "<div class=\"viewall\" id=\"quickreply\"><center>"+
"<form name=\"testimonial_form\" method=\"post\">"+
"<input type=\"hidden\" name=\"testimonial_firstname\" value=\""+pageOwnerFName+"\">"+
"<input type=\"hidden\" name=\"testimonial_uid\" value=\""+pageViewerID+"\">"+
"<input type=\"hidden\" name=\"_submitted\" value=\"1\">"+
"<table class=\"formtable\"><tr><td class=\"value\">"+
"<textarea id=\"thingy\" rows=\"5\" cols=\"100\" name=\"body\"></textarea>"+
"</td></tr><tr><td class=\"value\">"+
"<input readonly type=\"hidden\" name=\"inputcount\" size=\"4\" maxlength=\"4\" value=\"1000\">"+
"<input style='padding: 4px 0; margin: 10px 0 6px 0;font-family:Arial;font-weight:bold;color:#17728f;border:1px solid #196B91;background-color:#ffffff' type=\"button\" name=\"Submit\" onMouseOver=\"window.status='Post';return true;\" onClick=\"document.testimonial_form.action='http://www.friendster.com/testimonials.php?uid="+pageOwnerID+"&action=add';document.testimonial_form.submit();\" value=\"Submit\"> "+
"<input style='padding: 4px 0; margin: 10px 0 6px 0;font-family:Arial;font-weight:bold;color:#17728f;border:1px solid #196B91;background-color:#ffffff' class=\"cancelButtons\" type=\"reset\" name=\"cancel\" value=\"Clear\" maxlength=\"25\"><br>"+
"</td></tr></table></form></center></div><br><hr><br>";
}
};[/spoiler]
Kalau ada dari kalian yg masih getol pakai [b]IE[/b], scriptnya akan menjadi begini :
[spoiler]comLinks=content_18.getElementsByTagName("div")[0].innerHTML
document.getElementById("18").style.display="none"
navBg.innerHTML+="<div id='myComments' class='commonbox myComments'>"
+"<h2>Testimonials and Comments for "+pageOwnerFName+"</h2>"
+"<div id='content_myComments'>"
+"<div class='viewall'>"
+comLinks
+"</div>"
+"<div class='fitem1wrapper' id='fitem1wrapperCom'>"
+"</div>"
+"</div>"
+"</div>"
document.getElementById("6").parentNode.appendChild(myComments)
testiCount=0
slideTesti=new Array()
function getComments(){
a=content_18
b=a.getElementsByTagName('table')
for(x=0;x<b.length;x++){
slideTesti[x]=b[x].innerHTML
}
tickComments()
}
function tickComments(){
if(testiCount<b.length){
fitem1wrapperCom.innerHTML=slideTesti[testiCount]
testiCount++
if(testiCount==slideTesti.length){
testiCount=0
}
setTimeout("tickComments()",5000)
}
}
getComments()
if (!attachOnLoadHandler(function(){COMMENTOR.init();})) window.onload = function(){COMMENTOR.init();};
if (typeof COMMENTOR == "undefined") { COMMENTOR = {}; }
COMMENTOR = {
comment: [],
init: function() {
this.comment = document.getElementById("content_myComments").getElementsByTagName("div")[0];
this.comment.innerHTML = "<div class=\"viewall\" id=\"quickreply\"><center>"+
"<form name=\"testimonial_form\" method=\"post\">"+
"<input type=\"hidden\" name=\"testimonial_firstname\" value=\""+pageOwnerFName+"\">"+
"<input type=\"hidden\" name=\"testimonial_uid\" value=\""+pageViewerID+"\">"+
"<input type=\"hidden\" name=\"_submitted\" value=\"1\">"+
"<table class=\"formtable\"><tr><td class=\"value\">"+
"<textarea id=\"thingy\" rows=\"5\" cols=\"100\" name=\"body\"></textarea>"+
"</td></tr><tr><td class=\"value\">"+
"<input readonly type=\"hidden\" name=\"inputcount\" size=\"4\" maxlength=\"4\" value=\"1000\">"+
"<input style='padding: 4px 0; margin: 10px 0 6px 0;font-family:Arial;font-weight:bold;color:#17728f;border:1px solid #196B91;background-color:#ffffff' type=\"button\" name=\"Submit\" onMouseOver=\"window.status='Post';return true;\" onClick=\"document.testimonial_form.action='http://www.friendster.com/testimonials.php?uid="+pageOwnerID+"&action=add';document.testimonial_form.submit();\" value=\"Submit\"> "+
"<input style='padding: 4px 0; margin: 10px 0 6px 0;font-family:Arial;font-weight:bold;color:#17728f;border:1px solid #196B91;background-color:#ffffff' class=\"cancelButtons\" type=\"reset\" name=\"cancel\" value=\"Clear\" maxlength=\"25\"><br>"+
"</td></tr></table></form></center></div><br><hr><br>";
}
};[/spoiler]
[b][u]UPDATE[/u] :[/b]
Berhubung hide CSS milik FS diupdate, tambahkan script ini ke dalam CSS extension kalian utk menghilangkan kolom default testimonialnya :
[quote]head:first-child + body .publiccomments{display:none!important}[/quote]
Last edited by KaNaLiTnUk (2008-10-14 12:12:35)