This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Thứ Ba, 6 tháng 12, 2011

Tạo phân trang Paper script 2.0


 Giới thiệu: Mỗi kiểu phân trang đều có ưu điểm và vẻ đẹp riêng của nó. Mỗi blogger đều có sở thích riêng và tất nhiên sẽ lựa chọn kiểu phân trang riêng để cài đặt cho blog của mình. Đây là kiểu phân trang đơn giản cả về giao diện và thủ thuật.


CÁCH THỰC HIỆN 

1. Đăng nhập Blogger Dashboard (Bảng điều khiển) 
2. Chọn: Design (Thiết kế) > Edit HTML (Chỉnh sữa HTML)
3. Đánh dấu chọn ô: Expand Widget Templates (Mở rộng mẫu tiện ích)
4. Chèn script 

Bước 1: Tìm dòng <b:include name='nextprev'/>

- Thay thế nó bằng đoạn code sau:

 <!-- Tạo phân trang Paper script 2.0 -->
  <b:if cond='data:blog.pageType == &quot;index&quot;'>
<style type='text/css'>
.blogpager {
font-size:12px;
color: #060;
font-weight:bold;
padding:0px 2px;
}
</style>
<div align='center' style='margin:5px;'>
<form action='#' name='pager20'>
<span id='vwg-pager-first'/> <span id='vwg-pager-prev'/> <input name='showingpage' onfocus='this.select()' size='4' title='Gõ vào số trang mà bạn muốn đến'; type='text' value='init...'/>/<input disabled='disabled' name='pagestotal' size='4' type='text' value='init...'/> <input onclick='checkpager()' type='button' value='Go'/> <span id='vwg-pager-next'/> <span id='vwg-pager-last'/>
</form>
</div>
<script type='text/javascript'>
var blogID = "
2273867814436170597"; // ID blog bạn
var home_page = "http://chiase-vanthuc.blogspot.com"; // Địa chỉ blog bạn
var pager_max_main = 10;  // Số bài hiện trên trang chủ
var pager_first_text = "Đầu trang";
var pager_last_text = "Cuối trang";
var pager_prev_text = "Trang trước";
var pager_next_text = "Trang kế";
<script type='text/javascript'>
//<![CDATA[
var pager_max_results = 20;
if(location.href.match("max-results=")){
 pager_max_results = parseInt(location.href.substring(location.href.indexOf("max-results=")+12).split("&")[0]);
} else if(!location.href.match("/search/label/")){
 pager_max_results = pager_max_main;
}
var per_page = pager_max_results ;
if(!location.href.match('/search/label/')) {
 pager_feedx = "http://www.blogger.com/feeds/"+blogID+"/posts/summary";
 pager_pageurl = home_page+"search";
 }
else {
 label = location.href.split("/")[5];
 label = label.split("?")[0];
 label = label.replace(/ /g,"%20");
 pager_feedx = "http://www.blogger.com/feeds/"+blogID+"/posts/summary/-/"+label;
 pager_pageurl = home_page+"search/label/"+label;
}
var pager_opening = 1;
if(location.href.match("popening=")){
 pager_opening = parseInt(location.href.substring(location.href.indexOf("popening=")+9).split("&")[0]);
}
var num_pages = 1;
function createBlogPager(){
 var script = document.createElement('script');
 script.src = pager_feedx+"?start-index=1&max-results=0&alt=json-in-script&callback=countnumpost";
 script.type = "text/javascript";
 document.getElementsByTagName('head')[0].appendChild(script)
}
function countnumpost(json) {
 var posts  = json.feed.openSearch$totalResults.$t;
 num_pages = (posts%per_page == 0) ? posts/per_page : Math.floor(posts/per_page)+1;
 //////////////////////////////
 var a1 = document.createElement("a");
  a1.className = "blogpager";
  a1.title = "Jump to page: (1)";
  a1.href = "javascript:page(1)";
  a1.innerHTML = pager_first_text;
  document.getElementById("vwg-pager-first").appendChild(a1);
 var a4 = document.createElement("a");
  a4.className = "blogpager";
  a4.title = "Jump to page: ("+num_pages+")";
  a4.href = "javascript:page("+num_pages+")";
  a4.innerHTML = pager_last_text;
  document.getElementById("vwg-pager-last").appendChild(a4);

 var prev = (pager_opening!=1) ? pager_opening-1 : 1;
 var a2 = document.createElement("a");
  a2.className = "blogpager";
  a2.title = "Jump to page: ("+prev+")";
  a2.href = "javascript:page("+prev+")";
  a2.innerHTML = pager_prev_text;
  document.getElementById("vwg-pager-prev").appendChild(a2);

 var next = (pager_opening!=num_pages) ? pager_opening+1 : num_pages;
 var a3 = document.createElement("a");
  a3.className = "blogpager";
  a3.title = "Jump to page: ("+next+")";
  a3.href = "javascript:page("+next+")";
  a3.innerHTML = pager_next_text;
  document.getElementById("vwg-pager-next").appendChild(a3);

 document.pager20.showingpage.value = pager_opening;
 document.pager20.pagestotal.value = num_pages;
}
function checkpager(){
 var uinput = parseInt(document.pager20.showingpage.value);
 if((uinput <= num_pages)&&(uinput >= 1)) {
  page(uinput);
 }
 else {
  alert("Invalid page number. Please try by another!");
  document.pager20.showingpage.focus() ;
  document.pager20.showingpage.select();
 }
}
function getDateAndGo(json){
 var date2 = json.feed.entry[0].published.$t;
 ss = parseFloat(date2.substring(17,19));
 if(ss<59) ss++;
 if(ss<10) { ss = "0"+ ss; }
 date4  = encodeURIComponent(date2.substring(0,17)+ss+date2.substring(23,date2.length));
 location.href = pager_pageurl+'?updated-max='+date4+'&max-results=' + per_page + '&popening=' + pager_opening;
}
function page(startindex) {
 pager_opening = startindex;
 var i = per_page*(startindex-1)+1;
 var script2 = document.createElement("script");
 script2.src =  pager_feedx+"?start-index="+i+"&max-results=1&alt=json-in-script&callback=getDateAndGo";
 document.getElementsByTagName('head')[0].appendChild(script2)
}
createBlogPager();
//]]>
</script>
   </b:if>

Những chữ tô đỏ: Có thể tùy chỉnh lại theo ý của bạn.

Các phần cần phải sữa lại:

-2273867814436170597: Thay thành số ID của blog bạn.
- http://chiase-vanthuc.blogspot.com: Thay thành địa chỉ blog của bạn. 
- var pager_max_main = 10: Thay số bài đăng bằng với số bài đăng hiện trên trang chủ mà bạn chỉnh cho blog. 


Bước 2: Save template. (Lưu mẫu)

Nguồn: http://kenhdaihoc.com/forum/forumdisplay.php?f=251

Tạo phân trang Paper script 2.0


 Giới thiệu: Mỗi kiểu phân trang đều có ưu điểm và vẻ đẹp riêng của nó. Mỗi blogger đều có sở thích riêng và tất nhiên sẽ lựa chọn kiểu phân trang riêng để cài đặt cho blog của mình. Đây là kiểu phân trang đơn giản cả về giao diện và thủ thuật.


CÁCH THỰC HIỆN 

1. Đăng nhập Blogger Dashboard (Bảng điều khiển) 
2. Chọn: Design (Thiết kế) > Edit HTML (Chỉnh sữa HTML)
3. Đánh dấu chọn ô: Expand Widget Templates (Mở rộng mẫu tiện ích)
4. Chèn script 

Bước 1: Tìm dòng <b:include name='nextprev'/>

- Thay thế nó bằng đoạn code sau:

 <!-- Tạo phân trang Paper script 2.0 -->
  <b:if cond='data:blog.pageType == &quot;index&quot;'>
<style type='text/css'>
.blogpager {
font-size:12px;
color: #060;
font-weight:bold;
padding:0px 2px;
}
</style>
<div align='center' style='margin:5px;'>
<form action='#' name='pager20'>
<span id='vwg-pager-first'/> <span id='vwg-pager-prev'/> <input name='showingpage' onfocus='this.select()' size='4' title='Gõ vào số trang mà bạn muốn đến'; type='text' value='init...'/>/<input disabled='disabled' name='pagestotal' size='4' type='text' value='init...'/> <input onclick='checkpager()' type='button' value='Go'/> <span id='vwg-pager-next'/> <span id='vwg-pager-last'/>
</form>
</div>
<script type='text/javascript'>
var blogID = "
2273867814436170597"; // ID blog bạn
var home_page = "http://chiase-vanthuc.blogspot.com"; // Địa chỉ blog bạn
var pager_max_main = 10;  // Số bài hiện trên trang chủ
var pager_first_text = "Đầu trang";
var pager_last_text = "Cuối trang";
var pager_prev_text = "Trang trước";
var pager_next_text = "Trang kế";
<script type='text/javascript'>
//<![CDATA[
var pager_max_results = 20;
if(location.href.match("max-results=")){
 pager_max_results = parseInt(location.href.substring(location.href.indexOf("max-results=")+12).split("&")[0]);
} else if(!location.href.match("/search/label/")){
 pager_max_results = pager_max_main;
}
var per_page = pager_max_results ;
if(!location.href.match('/search/label/')) {
 pager_feedx = "http://www.blogger.com/feeds/"+blogID+"/posts/summary";
 pager_pageurl = home_page+"search";
 }
else {
 label = location.href.split("/")[5];
 label = label.split("?")[0];
 label = label.replace(/ /g,"%20");
 pager_feedx = "http://www.blogger.com/feeds/"+blogID+"/posts/summary/-/"+label;
 pager_pageurl = home_page+"search/label/"+label;
}
var pager_opening = 1;
if(location.href.match("popening=")){
 pager_opening = parseInt(location.href.substring(location.href.indexOf("popening=")+9).split("&")[0]);
}
var num_pages = 1;
function createBlogPager(){
 var script = document.createElement('script');
 script.src = pager_feedx+"?start-index=1&max-results=0&alt=json-in-script&callback=countnumpost";
 script.type = "text/javascript";
 document.getElementsByTagName('head')[0].appendChild(script)
}
function countnumpost(json) {
 var posts  = json.feed.openSearch$totalResults.$t;
 num_pages = (posts%per_page == 0) ? posts/per_page : Math.floor(posts/per_page)+1;
 //////////////////////////////
 var a1 = document.createElement("a");
  a1.className = "blogpager";
  a1.title = "Jump to page: (1)";
  a1.href = "javascript:page(1)";
  a1.innerHTML = pager_first_text;
  document.getElementById("vwg-pager-first").appendChild(a1);
 var a4 = document.createElement("a");
  a4.className = "blogpager";
  a4.title = "Jump to page: ("+num_pages+")";
  a4.href = "javascript:page("+num_pages+")";
  a4.innerHTML = pager_last_text;
  document.getElementById("vwg-pager-last").appendChild(a4);

 var prev = (pager_opening!=1) ? pager_opening-1 : 1;
 var a2 = document.createElement("a");
  a2.className = "blogpager";
  a2.title = "Jump to page: ("+prev+")";
  a2.href = "javascript:page("+prev+")";
  a2.innerHTML = pager_prev_text;
  document.getElementById("vwg-pager-prev").appendChild(a2);

 var next = (pager_opening!=num_pages) ? pager_opening+1 : num_pages;
 var a3 = document.createElement("a");
  a3.className = "blogpager";
  a3.title = "Jump to page: ("+next+")";
  a3.href = "javascript:page("+next+")";
  a3.innerHTML = pager_next_text;
  document.getElementById("vwg-pager-next").appendChild(a3);

 document.pager20.showingpage.value = pager_opening;
 document.pager20.pagestotal.value = num_pages;
}
function checkpager(){
 var uinput = parseInt(document.pager20.showingpage.value);
 if((uinput <= num_pages)&&(uinput >= 1)) {
  page(uinput);
 }
 else {
  alert("Invalid page number. Please try by another!");
  document.pager20.showingpage.focus() ;
  document.pager20.showingpage.select();
 }
}
function getDateAndGo(json){
 var date2 = json.feed.entry[0].published.$t;
 ss = parseFloat(date2.substring(17,19));
 if(ss<59) ss++;
 if(ss<10) { ss = "0"+ ss; }
 date4  = encodeURIComponent(date2.substring(0,17)+ss+date2.substring(23,date2.length));
 location.href = pager_pageurl+'?updated-max='+date4+'&max-results=' + per_page + '&popening=' + pager_opening;
}
function page(startindex) {
 pager_opening = startindex;
 var i = per_page*(startindex-1)+1;
 var script2 = document.createElement("script");
 script2.src =  pager_feedx+"?start-index="+i+"&max-results=1&alt=json-in-script&callback=getDateAndGo";
 document.getElementsByTagName('head')[0].appendChild(script2)
}
createBlogPager();
//]]>
</script>
   </b:if>

Những chữ tô đỏ: Có thể tùy chỉnh lại theo ý của bạn.

Các phần cần phải sữa lại:

-2273867814436170597: Thay thành số ID của blog bạn.
- http://chiase-vanthuc.blogspot.com: Thay thành địa chỉ blog của bạn. 
- var pager_max_main = 10: Thay số bài đăng bằng với số bài đăng hiện trên trang chủ mà bạn chỉnh cho blog. 


Bước 2: Save template. (Lưu mẫu)

Nguồn: http://kenhdaihoc.com/forum/forumdisplay.php?f=251

Tạo Read More (Đọc tiếp) một cách tự động V4





Giới thiệu: Với thủ thuật này bài viết sẽ không hiện đầy đủ nguyên bài ở các trang nhãn, trang chính trang lưu trữ,… (nghĩa là chỉ hiển thị một phần) và khi muốn xem đầy đủ ta phải lick vào nút “Đọc tiếp” để xem.

Tuy đã tự động Readmore cho blog nhưng blog vẫn sẽ tải toàn bộ nội dung của các bài viết. Để giảm thời gian tải của blog, bạn nên kết hợp thêm chức năng “Read more” có sẵn của Blogspot. Thực hiện việc này cũng có nghĩa là sẽ ngăn chặn được việc hay mất bài viết trên blog. 


CÁCH THỰC HIỆN 

1. Đăng nhập Blogger Dashboard (Bảng điều khiển)
2. Chọn: Design (Thiết kế) > Edit HTML (Chỉnh sữa HTML)
3. Đánh dấu chọn ô: Expand Widget Templates (Mở rộng mẫu tiện ích)

4. Chèn script

Bước 1: Tìm dòng <data:post.body/>

- Thay thế nó bằng đoạn code sau:

- Thay thế nó bằng đoạn code sau:

<!-- Tạo Read More (Đọc tiếp) một cách tự động V4 (1) -->
<b:if cond='data:blog.pageType != "item"'>
<div expr:id='"summary" + data:post.id' style='display:none;'><data:post.body/></div>
<script type='text/javascript'>createSummaryAndThumb("summary<data:post.id/>");</script>
<div style="clear:both" align='right' class='rmlink'><a expr:href='data:post.url'>
 ĐỌC TIẾP »
</a></div>
</b:if>
<b:if cond='data:blog.pageType == "item"'><data:post.body/></b:if>

Thay chữ ĐỌC TIẾP » thành chữ khác nếu bạn muốn. Hoặc nếu muốn dùng hình ảnh thì bạn thay chữ ĐỌC TIẾP » trên bằng dòng code sau:

<img src="Link_ảnh"/>


Bước 2: Tìm thẻ đóng </head>

- Thêm vào trước nó đoạn code sau:

<!-- Tạo Read More (Đọc tiếp) một cách tự động V4 (2) -->
<style type='text/css'>
.thumbnailimg IMG {
   max-width:186px;
   width: expression(this.width &gt; 186 ? 186: true);
   max-height:120px;
   height: expression(this.height &gt; 120 ? 120: true);
}
.thumbnailimg {
nofloat: left;
padding:0px 10px 5px 0px;
}
</style>
<script type='text/javascript'>
var thumbnail_mode = &quot;no-float&quot; ;
var classicMode = true; // Dùng kiểu mới chọn flase, true là kiểu cũ
var summary_noimg = 60; // Số từ tối đa khi bài viết không có ảnh nào
var summary_img = 60; // Số từ tối đa khi bài viết có ảnh
var indent = 3; // Số kí tự thụt vô đầu dòng
</script>
<script type='text/javascript'>
//<![CDATA[
function stripHtmlTags(s,max){return s.replace(/<.*?>/ig, '').split(/s+/).slice(0,max-1).join(' ')}
function getSummaryLikeWP(id) {
        return document.getElementById(id).innerHTML.split(/<!--s*mores*-->/)[0];
}
function getSummaryImproved(post,max){
   var re = /<.*?>/gi
   var re2 = /<br.*?>/gi
   var re3 = /(</{1}p>)|(</{1}div>)/gi
   var re4 = /(<style.*?/{1}style>)|(<script.*?/{1}script>)|(<table.*?/{1}table>)|(<form.*?/{1}form>)|(<code.*?/{1}code>)|(<pre.*?/{1}pre>)/gi
   post = post.replace(re4,'')
   post = post.replace(re3,'<br /> ').split(re2)
   for(var i=0; i<post.length; i++){
    post[i] = post[i].replace(re,'');
   }
var post2 = new Array();
for(var i in post) {
  //if(post[i]!='' && post[i]!=' ' && post[i] != 'n') post2.push(post[i]);
  if(/[a-zA-Z0-9]/.test(post[i])) post2.push(post[i]) ;
}
var s = "";
var indentBlank = "";
for(var i=0;i<indent;i++){
  indentBlank += " ";
}
if(post2.join('<br/>').split(' ').length < max-1 ){
   s = post2.join(indentBlank +' <br/>');
} else {
  var i = 0;
  while(s.split(' ').length < max){
   s += indentBlank + ' ' + post2[i]+'<br/>';
   i++;
  }
}
return s;
}
function createSummaryAndThumb(pID){
var div = document.getElementById(pID);
var content = div.innerHTML;
if (/<!--s*mores*-->/.test(content)) {
  div.innerHTML = getSummaryLikeWP(pID);
  div.style.display = "block";
}
else {
var imgtag = "";
var img = div.getElementsByTagName("img");
var summ = summary_noimg;
if(img.length>=1) {
  if(thumbnail_mode == "float") {
   imgtag = '<span class="thumbnailimg"><img src="'+img[0].src+'" /></span>';
   summ = summary_img;
  } else {
   imgtag = '<div class="thumbnailimg" align="left"><img src="'+img[0].src+'" /></div>';
   summ = summary_img;
  }
}
var summary = (classicMode) ? imgtag + '<div>' + stripHtmlTags(content,summ) + ' ... </div>' : imgtag + '<div>' + getSummaryImproved(content,summ) + '</div>';
div.innerHTML = summary;
div.style.display = "block";
}
}
//]]>
</script>

Trong đoạn code trên sẽ có những chỗ bạn cần thay đổi như sau: 

- 186 và 120 lần lượt là chiều rộng và chiều cao của ảnh thumbnail. Nếu thay, bạn nhớ thay cho đúng, mỗi cái xuất hiện tới 3 lần. Dùng max- phía trước là để giữ nguyên tỷ lệ ảnh khi thumbnail. Nếu muốn đồng nhất như nhau thì bạn bỏ chữ max- phía trước đi. 

- no-float là chế độ hiển thị ảnh theo kiểu Gallery (ảnh nằm trên, chữ nằm phía dưới). 

Bạn có thể đổi no-float thành float để cho ảnh của bạn hiện dồn về trái (hoặc phải), và chữ nằm ở phần ngược lại. 


Bước 3: Save template. (Lưu mẫu)


Một số mẫu button Readmore


   
   
   
   


THE END.
Nguồn: http://kenhdaihoc.com/forum/forumdisplay.php?f=251

Tạo Read More (Đọc tiếp) một cách tự động V4





Giới thiệu: Với thủ thuật này bài viết sẽ không hiện đầy đủ nguyên bài ở các trang nhãn, trang chính trang lưu trữ,… (nghĩa là chỉ hiển thị một phần) và khi muốn xem đầy đủ ta phải lick vào nút “Đọc tiếp” để xem.

Tuy đã tự động Readmore cho blog nhưng blog vẫn sẽ tải toàn bộ nội dung của các bài viết. Để giảm thời gian tải của blog, bạn nên kết hợp thêm chức năng “Read more” có sẵn của Blogspot. Thực hiện việc này cũng có nghĩa là sẽ ngăn chặn được việc hay mất bài viết trên blog. 


CÁCH THỰC HIỆN 

1. Đăng nhập Blogger Dashboard (Bảng điều khiển)
2. Chọn: Design (Thiết kế) > Edit HTML (Chỉnh sữa HTML)
3. Đánh dấu chọn ô: Expand Widget Templates (Mở rộng mẫu tiện ích)

4. Chèn script

Bước 1: Tìm dòng <data:post.body/>

- Thay thế nó bằng đoạn code sau:

- Thay thế nó bằng đoạn code sau:

<!-- Tạo Read More (Đọc tiếp) một cách tự động V4 (1) -->
<b:if cond='data:blog.pageType != "item"'>
<div expr:id='"summary" + data:post.id' style='display:none;'><data:post.body/></div>
<script type='text/javascript'>createSummaryAndThumb("summary<data:post.id/>");</script>
<div style="clear:both" align='right' class='rmlink'><a expr:href='data:post.url'>
 ĐỌC TIẾP »
</a></div>
</b:if>
<b:if cond='data:blog.pageType == "item"'><data:post.body/></b:if>

Thay chữ ĐỌC TIẾP » thành chữ khác nếu bạn muốn. Hoặc nếu muốn dùng hình ảnh thì bạn thay chữ ĐỌC TIẾP » trên bằng dòng code sau:

<img src="Link_ảnh"/>


Bước 2: Tìm thẻ đóng </head>

- Thêm vào trước nó đoạn code sau:

<!-- Tạo Read More (Đọc tiếp) một cách tự động V4 (2) -->
<style type='text/css'>
.thumbnailimg IMG {
   max-width:186px;
   width: expression(this.width &gt; 186 ? 186: true);
   max-height:120px;
   height: expression(this.height &gt; 120 ? 120: true);
}
.thumbnailimg {
nofloat: left;
padding:0px 10px 5px 0px;
}
</style>
<script type='text/javascript'>
var thumbnail_mode = &quot;no-float&quot; ;
var classicMode = true; // Dùng kiểu mới chọn flase, true là kiểu cũ
var summary_noimg = 60; // Số từ tối đa khi bài viết không có ảnh nào
var summary_img = 60; // Số từ tối đa khi bài viết có ảnh
var indent = 3; // Số kí tự thụt vô đầu dòng
</script>
<script type='text/javascript'>
//<![CDATA[
function stripHtmlTags(s,max){return s.replace(/<.*?>/ig, '').split(/s+/).slice(0,max-1).join(' ')}
function getSummaryLikeWP(id) {
        return document.getElementById(id).innerHTML.split(/<!--s*mores*-->/)[0];
}
function getSummaryImproved(post,max){
   var re = /<.*?>/gi
   var re2 = /<br.*?>/gi
   var re3 = /(</{1}p>)|(</{1}div>)/gi
   var re4 = /(<style.*?/{1}style>)|(<script.*?/{1}script>)|(<table.*?/{1}table>)|(<form.*?/{1}form>)|(<code.*?/{1}code>)|(<pre.*?/{1}pre>)/gi
   post = post.replace(re4,'')
   post = post.replace(re3,'<br /> ').split(re2)
   for(var i=0; i<post.length; i++){
    post[i] = post[i].replace(re,'');
   }
var post2 = new Array();
for(var i in post) {
  //if(post[i]!='' && post[i]!=' ' && post[i] != 'n') post2.push(post[i]);
  if(/[a-zA-Z0-9]/.test(post[i])) post2.push(post[i]) ;
}
var s = "";
var indentBlank = "";
for(var i=0;i<indent;i++){
  indentBlank += " ";
}
if(post2.join('<br/>').split(' ').length < max-1 ){
   s = post2.join(indentBlank +' <br/>');
} else {
  var i = 0;
  while(s.split(' ').length < max){
   s += indentBlank + ' ' + post2[i]+'<br/>';
   i++;
  }
}
return s;
}
function createSummaryAndThumb(pID){
var div = document.getElementById(pID);
var content = div.innerHTML;
if (/<!--s*mores*-->/.test(content)) {
  div.innerHTML = getSummaryLikeWP(pID);
  div.style.display = "block";
}
else {
var imgtag = "";
var img = div.getElementsByTagName("img");
var summ = summary_noimg;
if(img.length>=1) {
  if(thumbnail_mode == "float") {
   imgtag = '<span class="thumbnailimg"><img src="'+img[0].src+'" /></span>';
   summ = summary_img;
  } else {
   imgtag = '<div class="thumbnailimg" align="left"><img src="'+img[0].src+'" /></div>';
   summ = summary_img;
  }
}
var summary = (classicMode) ? imgtag + '<div>' + stripHtmlTags(content,summ) + ' ... </div>' : imgtag + '<div>' + getSummaryImproved(content,summ) + '</div>';
div.innerHTML = summary;
div.style.display = "block";
}
}
//]]>
</script>

Trong đoạn code trên sẽ có những chỗ bạn cần thay đổi như sau: 

- 186 và 120 lần lượt là chiều rộng và chiều cao của ảnh thumbnail. Nếu thay, bạn nhớ thay cho đúng, mỗi cái xuất hiện tới 3 lần. Dùng max- phía trước là để giữ nguyên tỷ lệ ảnh khi thumbnail. Nếu muốn đồng nhất như nhau thì bạn bỏ chữ max- phía trước đi. 

- no-float là chế độ hiển thị ảnh theo kiểu Gallery (ảnh nằm trên, chữ nằm phía dưới). 

Bạn có thể đổi no-float thành float để cho ảnh của bạn hiện dồn về trái (hoặc phải), và chữ nằm ở phần ngược lại. 


Bước 3: Save template. (Lưu mẫu)


Một số mẫu button Readmore


   
   
   
   


THE END.
Nguồn: http://kenhdaihoc.com/forum/forumdisplay.php?f=251

Sữa lỗi không hiện Avatar comment




Giới thiệu: Với những template cũ, có thể không hiện avatar comment. Để khắc phục việc này, ta phải sữa lại code trong template. Sau khi thực hiện xong thủ thuật này, chắc chắn blog bạn sẽ hiện avatar comment.


CÁCH THỰC HIỆN 

1. Đăng nhập Blogger Dashboard (Bảng điều khiển)
2. Chọn: Design (Thiết kế) > Edit HTML (Chỉnh sữa HTML)
3. Đánh dấu chọn ô: Expand Widget Templates (Mở rộng mẫu tiện ích)

4. Chèn script

Bước 1: Tìm khối đoạn code có dạng như sau:


Bước 1: Tìm khối đoạn code có dạng như sau:


<dl id='comments-block'>
...
<b:loop values='data:post.comments' var='comment'>
......   ......
</dl>


- Đôi khi có code lại có dạng:


<ol class='commentlist'>  <b:loop values='data:post.comments' var='comment'>.......   .......</ol>


Bước 2: Sau khi tìm được khối code đó thì thay thế toàn bộ bằng đoạn code sau:


<dl expr:class='data:post.avatarIndentClass' id='comments-block'>        <b:loop values='data:post.comments' var='comment'>          <dt expr:class='&quot;comment-author &quot; + data:comment.authorClass' expr:id='data:comment.anchorName'>            <b:if cond='data:comment.favicon'><img expr:src='data:comment.favicon' height='16px' style='margin-bottom:-2px;' width='16px'/></b:if><a expr:name='data:comment.anchorName'/><b:if cond='data:blog.enabledCommentProfileImages'><div expr:class='data:comment.avatarContainerClass'><data:comment.authorAvatarImage/></div></b:if>            <b:if cond='data:comment.authorUrl'>              <a expr:href='data:comment.authorUrl' rel='nofollow'><data:comment.author/></a> vào <data:comment.timestamp/>            <b:else/>              <data:comment.author/>            </b:if>            <data:commentPostedByMsg/>          </dt>

          <dd class='comment-body'>            <b:if cond='data:comment.isDeleted'>              <span class='deleted-comment'><data:comment.body/></span>            <b:else/>              <p><data:comment.body/></p>            </b:if>          </dd>

          <dd class='comment-footer'><span class='comment-timestamp'>  
              <b:include data='comment' name='commentDeleteIcon'/>            </span>          </dd>        </b:loop>      </dl>



Bước 3: Save template. (Lưu mẫu)

THE END.
Nguồn:  http://kenhdaihoc.com/forum/showthread.php?t=2032

Sữa lỗi không hiện Avatar comment




Giới thiệu: Với những template cũ, có thể không hiện avatar comment. Để khắc phục việc này, ta phải sữa lại code trong template. Sau khi thực hiện xong thủ thuật này, chắc chắn blog bạn sẽ hiện avatar comment.


CÁCH THỰC HIỆN 

1. Đăng nhập Blogger Dashboard (Bảng điều khiển)
2. Chọn: Design (Thiết kế) > Edit HTML (Chỉnh sữa HTML)
3. Đánh dấu chọn ô: Expand Widget Templates (Mở rộng mẫu tiện ích)

4. Chèn script

Bước 1: Tìm khối đoạn code có dạng như sau:


Bước 1: Tìm khối đoạn code có dạng như sau:


<dl id='comments-block'>
...
<b:loop values='data:post.comments' var='comment'>
......   ......
</dl>


- Đôi khi có code lại có dạng:


<ol class='commentlist'>  <b:loop values='data:post.comments' var='comment'>.......   .......</ol>


Bước 2: Sau khi tìm được khối code đó thì thay thế toàn bộ bằng đoạn code sau:


<dl expr:class='data:post.avatarIndentClass' id='comments-block'>        <b:loop values='data:post.comments' var='comment'>          <dt expr:class='&quot;comment-author &quot; + data:comment.authorClass' expr:id='data:comment.anchorName'>            <b:if cond='data:comment.favicon'><img expr:src='data:comment.favicon' height='16px' style='margin-bottom:-2px;' width='16px'/></b:if><a expr:name='data:comment.anchorName'/><b:if cond='data:blog.enabledCommentProfileImages'><div expr:class='data:comment.avatarContainerClass'><data:comment.authorAvatarImage/></div></b:if>            <b:if cond='data:comment.authorUrl'>              <a expr:href='data:comment.authorUrl' rel='nofollow'><data:comment.author/></a> vào <data:comment.timestamp/>            <b:else/>              <data:comment.author/>            </b:if>            <data:commentPostedByMsg/>          </dt>

          <dd class='comment-body'>            <b:if cond='data:comment.isDeleted'>              <span class='deleted-comment'><data:comment.body/></span>            <b:else/>              <p><data:comment.body/></p>            </b:if>          </dd>

          <dd class='comment-footer'><span class='comment-timestamp'>  
              <b:include data='comment' name='commentDeleteIcon'/>            </span>          </dd>        </b:loop>      </dl>



Bước 3: Save template. (Lưu mẫu)

THE END.
Nguồn:  http://kenhdaihoc.com/forum/showthread.php?t=2032

Thứ Hai, 20 tháng 6, 2011

Cảnh báo không vào mạng xã hội bằng trình duyệt IE


Theo Reuters, một chuyên gia nghiên cứu bảo mật Internet có trụ sở tại Italy, Rosario Valotta cho biết đã phát hiện một lỗ hổng nghiêm trọng có trong trình duyệt Internet Explorer (IE) của Microsoft.
Qua đó, tin tặc dễ dàng có thể đánh cắp nhận dạng khi truy cập vào các trang mạng xã hội như FaceBook, Twitter và một số website khác.
Phát hiện một lỗ hổng nghiêm trọng có trong trình duyệt Internet Explorerp
Chuyên gia nghiên cứu bảo mật khuyên: tạm thời người dùng không nên truy cập vào mạng
xã hội bằng trình duyệt IE của Microsoft. Hiện nay, có rất nhiều người truy cập vào mạng
xã hội để chơi game trực tuyến. (Ảnh: T. Hoàng).
Valotta gọi đó là công nghệ “cookiejacking” – tấn công bằng cookie có trong trình duyệt. Cookie có chức năng lưu giữ toàn bộ thông tin, chẳng hạn như tên và mật khẩu đăng nhập của một tài khoản web. Một khi tin tặc có được cookie đó, chúng có thể truy cập vào những website mà người dùng đã sử dụng.
Được biết, lỗ hổng này được phát hiện trên tất cả các phiên bản của trình duyệt Internet Explorer, bao gồm IE8  IE9, dành cho các phiên bản của hệ điều hành Windows.
Để khai thác lỗ hổng này, tin tặc phải dụ nạn nhân kéo hoặc thả một đối tượng trên màn hình máy tính trước khi cookie bị tấn công. Mặc dù, nghe có vẻ như là nhiệm vụ khó khăn đối với tin tặc, nhưng Valotta cho biết đã thực hiện việc này khá dễ dàng. Ông đã xây dựng một trò chơi tích hợp trên Facebook nhằm dụ người sử dụng tham gia bằng cách thách thức “cởi áo” một tấm hình phụ nữ hấp dẫn có trong trò chơi.
Khi trò chơi này có mặt trên FaceBook, chỉ trong vòng 3 ngày đã có hơn 80 cookies được gửi đến máy chủ của Valotta và có 150 người đã tham gia vào trò chơi này.
Theo Đất Việt