Selena 菲. Powered by Blogger.

how to do the label clouds widget (xhtml)

>> Sunday, September 12, 2010

take note : this tutorial is for people who is using xhtml, the new version, not html.


the first thing that you must do is, just go to your blogger Design > Page Elements page. click Add a gadget on a Add a Page Element Option on that page. then add the Labels Widget there.


image

 
After Adding the Label Widget Go to Layout > Edit Html (warning : do not expand the widget templates)
You will find some code similar to

<b:widget id='Label1' locked='false' title='Labels' type='Label'/>


Now Replace that with



<b:widget id='Label1' locked='false' title='Labels' type='Label'>
<b:includable id='main'>
<b:if cond='data:title'>
<h2><data:title/></h2>

</b:if>
<div expr:class='&quot;widget-content &quot; + data:display + &quot;-label-widget-content&quot;'>
<b:if cond='data:display == &quot;list&quot;'>
<ul>
<b:loop values='data:labels' var='label'>
<li>

<b:if cond='data:blog.url == data:label.url'>
<span expr:dir='data:blog.languageDirection'><data:label.name/></span>
<b:else/>
<a expr:dir='data:blog.languageDirection' expr:href='data:label.url'><data:label.name/></a>
</b:if>
<b:if cond='data:showFreqNumbers'>
<span dir='ltr'>(<data:label.count/>)</span>

</b:if>
</li>
</b:loop>
</ul>
<b:else/>
<div id='labelCloud'/>
<p align='center'>
<script type='text/javascript'>
var cloudMin = 1;
var maxFontSize = 30;
var maxColor = [35,130,196];
var minFontSize = 13;
var minColor = [35,130,195];

<b:if cond='data:showFreqNumbers'>
var lcShowCount = true;
<b:else/>
var lcShowCount = false;
</b:if>

// Don’t change anything past this point -----------------
// Cloud function s() ripped from del.icio.us
function s(a,b,i,x){
if(a&gt;b){
var m=(a-b)/Math.log(x),v=a-Math.floor(Math.log(i)*m)
}
else{
var m=(b-a)/Math.log(x),v=Math.floor(Math.log(i)*m+a)
}
return v
}
var c=[];
var labelCount = new Array();
var ts = new Object;
<b:loop values='data:labels' var='label'>
var theName = &quot;<data:label.name/>&quot;;
ts[theName] = <data:label.count/>;

</b:loop>
for (t in ts){
if (!labelCount[ts[t]]){
labelCount[ts[t]] = new Array(ts[t])
}
}
var ta=cloudMin-1;
tz = labelCount.length - cloudMin;
lc2 = document.getElementById(&#39;labelCloud&#39;);
ul = document.createElement(&#39;ul&#39;);
ul.className = &#39;label-cloud&#39;;
for(var t in ts){
if(ts[t] &lt; cloudMin){
continue;
}
for (var i=0;3 &gt; i;i++) {
c[i]=s(minColor[i],maxColor[i],ts[t]-ta,tz)
}
var fs = s(minFontSize,maxFontSize,ts[t]-ta,tz);
li = document.createElement(&#39;li&#39;);
li.style.fontSize = fs+&#39;px&#39;;
a = document.createElement(&#39;a&#39;);
a.title = ts[t]+&#39; Posts in &#39;+t;
a.style.color = &#39;rgb(&#39;+c[0]+&#39;,&#39;+c[1]+&#39;,&#39;+c[2]+&#39;)&#39;;
a.href = &#39;/search/label/&#39;+encodeURIComponent(t);
if (lcShowCount){
span = document.createElement(&#39;span&#39;);
span.innerHTML = &#39;(&#39;+ts[t]+&#39;) &#39;;
span.className = &#39;label-count&#39;;
a.appendChild(document.createTextNode(t));
li.appendChild(a);
li.appendChild(span);
}
else {
a.appendChild(document.createTextNode(t));
li.appendChild(a);
}
ul.appendChild(li);
abnk = document.createTextNode(&#39; &#39;);
ul.appendChild(abnk);
}
lc2.appendChild(ul);

</script>
</p>
<noscript>
<b:loop values='data:labels' var='label'>
<span expr:class='&quot;label-size label-size-&quot; + data:label.cssSize'>
<b:if cond='data:blog.url == data:label.url'>
<span expr:dir='data:blog.languageDirection'><data:label.name/></span>

<b:else/>
<a expr:dir='data:blog.languageDirection' expr:href='data:label.url'><data:label.name/></a>
</b:if>
<b:if cond='data:showFreqNumbers'>
<span class='label-count' dir='ltr'>(<data:label.count/>)</span>
</b:if>

</span>
</b:loop>
<br/>Powered By:<small><a href='http://www.bloggerplugins.org'>Blogger Gadgets</a></small>
<br/><small><a href='http://www.bloggerplugins.org/2008/06/label-cloud-widget-for-blogger-blogspot.html'>Label Cloud for Blogger</a></small>

</noscript>
</b:if>
<b:include name='quickedit'/>
</div>
</b:includable>
</b:widget>



Now find


]]></b:skin>
and replace it with



#labelCloud {text-align:center;font-family:arial,sans-serif;}
#labelCloud .label-cloud li{display:inline;background-image:none !important;padding:0 5px;margin:0;vertical-align:baseline !important;border:0 !important;}
#labelCloud ul{list-style-type:none;margin:0 auto;padding:0;}
#labelCloud a img{border:0;display:inline;margin:0 0 0 3px;padding:0}
#labelCloud a{text-decoration:none}
#labelCloud a:hover{text-decoration:underline}
#labelCloud li a{}
#labelCloud .label-cloud {}
#labelCloud .label-count {padding-left:0.2em;font-size:9px;color:#000}
#labelCloud .label-cloud li:before{content:&quot;&quot; !important}
]]></b:skin>





and save your template and tadaa!!! eh eh, wait, still got more.

last step;;

u must configure the Gadget from the Gadget Options. 


image


and tadaaaa!!!

it will looks better when you hv more labels.


p/s : send me a request if you need a tutorial on how to change the colour and customize the clouds to a better level.

Read more...

kalori adalah musuh dan kawan anda

apa itu kalori?

Kalori ialah unit ukuran untuk tenaga. Setiap orang memerlukan tenaga untuk hidup.
Kita mendapat tenaga daripada lemak, protein dan karbohidrat.


mengapa kalori ialah musuh dan kawan kita?
kalori penting dalam membekalkan tenaga untuk badan kita. TETAPI,pengambilan kalori yang berlebihan dari pada jumlah kalori yang diperlukan dalam tubuh akan menyebabkan kegemukan.


cadangan pengambilan kalori


Dewasa
Umur (Tahun)
Tenaga (Kalori)
Lelaki
Aktif
Sederhana
Berat Badan
55 kg


20 - 39
40 - 49
50 - 60
> 60


2,530
2,400
2,280
2,020
Perempuan
Aktif
Sederhana
Berat Badan
50 kg

0 - 39
40 - 49
50 - 60
> 60


2,000
1,900
1,800
1,600



















eat in healthy and low calories way.. how?

  • replace a plate of kueh teaw (600 kalori) with a bowl of mee hoon soup (350 kalori).
  • replace a can of drink (around 150 kalori) with a glass of soya bean (60 kalori)
  • replace a bowl of bubur caca (300 kalori) with a slice of fresh fruit (60 kalori)


i love to eat junk food, so how?

burger keju, 317 kal                                     whooper sandwich, 628 kal
buah-buahan, 60 kal                                    kentang goreng, 227 kal
air atau teh tanpa gula, 0 kal                        coke, 150 kal
salad tanpa dresing, 28 kal

Jumlah : 405 kalori                                     Jumlah : 1005 kalori


credit to mr google.

Read more...

>> Friday, September 3, 2010

i miss my parents how we used to sit together in the bar, with a glass of champagne or cocktail in our hands, taking nonsense, chilling and laughing. and theres other time, my dad pulling me from the chair at the bar, he tooks my hand, holding my waist and there, we're dancing together. my mum will looking at us and laughing much. oh, i miss those memory. ;(

Read more...
Template by www.glam-fabulous.blogspot.com. Powered by Blogger