Notes

1. I don't do tutorials anymore.

2. I rarely update my blog due to my health condition.

Thanks for your concern :)

Wednesday, July 7, 2010

tutorial memasang auto read more.

As usual, shag requesting this, so I'll make one. Thanks Shag sebab banyak request. Adsa jugak la benda I nak update dalam sehari he he he :P


So how to make auto read more on each entry?


1. As usual, Dashboard > Design > Edit HTML. And click pada Expand Widget Templates.


2. Tekan ctrl dan F serentak. Copy code di bawah ini dan paste kan ke ruangan find
</head>
3. Dah jumpa? Kemudian, copy code di bawah ini dan letak kan sebelum/ di atas code di langkah 2.


<script type='text/javascript'>
var thumbnail_mode = "float" ;
summary_noimg = 350;
summary_img = 450;
img_thumb_height = 140;
img_thumb_width = 140;
</script>
<script type='text/javascript'>
//<![CDATA[
/*
*/


function removeHtmlTag(strx,chop){
if(strx.indexOf("<")!=-1)
{
var s = strx.split("<");
for(var i=0;i<s.length;i++){
if(s[i].indexOf(">")!=-1){
s[i] = s[i].substring(s[i].indexOf(">")+1,s[i].length);
}
}
strx = s.join("");
}
chop = (chop < strx.length-1) ? chop : strx.length-2;
while(strx.charAt(chop-1)!=' ' && strx.indexOf(' ',chop)!=-1) chop++;
strx = strx.substring(0,chop-1);
return strx+'...';
}
function createSummaryAndThumb(pID){
var div = document.getElementById(pID);
var imgtag = "";
var img = div.getElementsByTagName("img");
var summ = summary_noimg;
if(img.length>=1) {
imgtag = '<span style="float:left; padding:0px 10px 5px 0px;"><img src="'+img[0].src+'" width="'+img_thumb_width+'px" height="'+img_thumb_height+'px"/></span>';
summ = summary_img;
}
var summary = imgtag + '<div>' + removeHtmlTag(div.innerHTML,summ) + '</div>';
div.innerHTML = summary;
}
//]]>
</script>
4. Seterusnya, copy code di bawah ini dan paste di kotak find.
 <data:post.body/>
5. Copy code di bawah dan gantikan pada code di langkah 4.
<b:if cond='data:blog.pageType != "item"'>
<div expr:id='"summary" + data:post.id'><data:post.body/></div>
<script type='text/javascript'>createSummaryAndThumb("summary<data:post.id/>");</script>
<span class='rmlink' style='float:right'><a expr:href='data:post.url'><img src='http://img709.imageshack.us/img709/7056/readmorez.png'/></a></span>
</b:if>
<b:if cond='data:blog.pageType == "item"'><data:post.body/></b:if>
6. Click preview and if no error, just save.


Credit to ; BUDAK NAKAL

2 orang rasa saya gemuk tapi hot. aww:

♥ Roshazzy Shag ♥ said... REPLY

heyy huda. thanks a lot huh. haha. penat gila dok cube ikot steps yg d google. asek error je tak pun tak jmp ape yg dorg suh click tu >.< anything ill ask for ur favor lah ;))

NURUL AIN said... REPLY

hai. i da follow tutorial ni.n da save.mule2 preview mcm comel tapi da save then tgk byk2 kali mcm pelik.i nk remove balik.da 1st part copy tuh i jumpe.da delete pon.the second part tuh i xjumpe.tolong i fix to normal balik bole?

Post a Comment

Next Previous Home