設定標籤雲

將標籤改為標籤雲,
作法來至 將Blogger Beta的Label作成Label Cloud

英文原文
Setup and configuration for New Blogger Tag Cloud / Label Cloud




首先先加入這一段CSS


/* Label Cloud Styles
----------------------------------------------- */
#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:"" !important}



在]]></b:skin>與</head>中間加入

YOURBLOG 改為你blog的網址

<script type='text/javascript'>
// Label Cloud User Variables
var lcBlogURL = 'http://YOURBLOG.blogspot.com';
var maxFontSize = 20;
var maxColor = [0,0,255];
var minFontSize = 10;
var minColor = [0,0,0];
var lcShowCount = false;
</script>



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

用下面這一段取代

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

<div class='widget-content'>
<div id='labelCloud'/>
<script type='text/javascript'>

// Don't change anything past this point -----------------
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 ta=0
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])
}
}
tz = labelCount.length-1;
lc2 = document.getElementById('labelCloud');
ul = document.createElement('ul');
ul.className = 'label-cloud';
for(var t in ts){
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('li');
li.style.fontSize = fs+'px';
li.style.lineHeight = '1';
a = document.createElement('a');
a.title = ts[t]+' Posts in '+t;
a.style.color = 'rgb('+c[0]+','+c[1]+','+c[2]+')';
a.href = lcBlogURL+'/search/label/'+encodeURIComponent(t);
if (lcShowCount){
span = document.createElement('span');
span.innerHTML = '('+ts[t]+') ';
span.className = 'label-count';
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(' ');
ul.appendChild(abnk);
}
lc2.appendChild(ul);
</script>

<noscript>
<ul>
<b:loop values='data:labels' var='label'>
<li>
<b:if cond='data:blog.url == data:label.url'>
<data:label.name/>
<b:else/>
<a expr:href='data:label.url'><data:label.name/></a>
</b:if>
(<data:label.count/>)
</li>
</b:loop>
</ul>
</noscript>
<b:include name='quickedit'/>
</div>

</b:includable>
</b:widget>






繼續閱讀...
HEMiDEMi Technorati Del.icio.us MyShare個人書籤 Yahoo

張貼者:Paddy 於 中午12:03 0 意見  

技術課程、研討會@Taiwan

我在Google Calendar 建立了一個
技術課程、研討會@Taiwan



大部分都是免費的研討會,
偏資訊技術方面,有興趣的可以點下面的網址訂閱



也可以幫我宣傳喔,在Blog貼上下面這個網址,就會出現上方的那個訂閱圖示。


<a href="http://www.google.com/calendar/render?cid=b8johedh9jpd9hi9var863klok@group.calendar.google.com"><img src="http://www.google.com/calendar/images/ext/gc_button1_zh-TW.gif" /></a>



下面這個也可以(縮網址版)。


<a href="http://0rz.tw/153YT"><img src="http://www.google.com/calendar/images/ext/gc_button1_zh-TW.gif" /></a>




繼續閱讀...
HEMiDEMi Technorati Del.icio.us MyShare個人書籤 Yahoo

張貼者:Paddy 於 晚上10:27 0 意見  

設定ASP.NET檔案上傳的大小

在ASP.NET網頁使用上傳元件時,常常因為上傳的檔案太大(預設為4MB),
會發生找不到網頁的錯誤,該如何加大上傳大小呢?


MSDN的這篇 httpRuntime 項目 (ASP.NET 設定結構描述)
可以參考一下。





maxRequestLength選擇性 Int32 屬性。
指定輸入資料流緩衝臨界值的限制,以 KB 為單位。這個限制可以用來防止服務拒絕攻擊,例如由使用者將大型檔案回傳至伺服器所引起的攻擊。
預設值為 4096 (4 MB)


所以要加大上傳大小,需要修改Web.Config ,
譬如若要增加大小至10MB,就必須設為10240 (1024 * 10 = 10240 )
若為8MB,就設定為8192 (1024 * 8 = 8192 )

<System.Web>
<httpRuntime maxRequestLength="10240" />
</System.Web>



ASP.NET 上傳檔案的限制
ASP.NET 檔案上傳處理—檔案大小超過限制之處理




繼續閱讀...
HEMiDEMi Technorati Del.icio.us MyShare個人書籤 Yahoo

張貼者:Paddy 於 上午9:29 1 意見  

Container.DataItem

在FromView裡面我們常常會用Bind("欄位名稱") 這樣來顯示資料,
但若要加上分行符號,該怎麼辦呢?


在aspx 頁面上

<asp:Label ID="MyId" runat="server" Text='<%# Pro2e.Utility.FormatingString(Container.DataItem,"InfoContent") %>'></asp:Label>



PClass 這樣寫

Class PClass
{
public static string FormatingString(object dataItem, string TargetName)
{
string ret = "";
object obj = System.Web.UI.DataBinder.Eval(dataItem, TargetName);
if (obj != null)
{
string strTargetString = obj.ToString();
ret = strTargetString.Replace("\r", "<br />");

}
return ret;
}
}


順便參考一下這個:

ASP.NET 資料繫結概觀



繼續閱讀...
HEMiDEMi Technorati Del.icio.us MyShare個人書籤 Yahoo

張貼者:Paddy 於 下午6:12 0 意見  

最新回應的作法

最新回應的作法,是從Josh's Note
讓comments也能顯示文章標題修改來的




原本的排版我不喜歡,所以改了一下。
並傳到Google Page Creator

在Blogger後台的版面配置,開一個HTML/Javascript的 element,並插入下列語法

紅色部分為Blog的位址

<script>g_szBlogDomain='xxxxx.blogspot.com'; </script>
<script src="http://twpaddy.googlepages.com/rc.js"></script>

直接把上面那一段的語法貼上即可。

js檔的程式如下,需要的可以自己拿去改:

var g_szBlogDomain;
if (g_szBlogDomain==undefined) g_szBlogDomain='http://paddyfeel.blogspot.com';
document.write('<div id="divrc">下載中...</div>');
var g_szAuthorsLink=new Array();
var g_szTitle= new Array();
var g_szOrgLink = new Array();
var g_iIndex=0;
var g_iShowCount=5;
function a_comprc(a,b)
{
order= Date.parse(a.published.$t.replace(/^(\d{4})-(\d{2})-(\d{2})T([0-9:]*)([.0-9]*)(.)(.*)$/, '$1/$2/$3 $4 GMT')) - Date.parse(b.published.$t.replace(/^(\d{4})-(\d{2})-(\d{2})T([0-9:]*)([.0-9]*)(.)(.*)$/, '$1/$2/$3 $4 GMT'));
return 0-order;
}
function a_rc(json)
{
g_szComments = json.feed.entry.sort(a_comprc);
}
function a_FindTitle(posts,orgLink)
{
var ret= orgLink;
for (var ii=0,post; post= posts.feed.entry[ii]; ii++)
{
if (post.link[0].href == orgLink)
{
ret= post.title.$t;
break;
}
}
return ret;
}
function a_FindIndex(posts,orgLink)
{
var ij=0;
for (ij=0; ij < g_iIndex; ij++)
{
if (orgLink==g_szOrgLink[ij])
return ij;
}
g_szOrgLink[ij]=orgLink;
g_szTitle[ij]= a_FindTitle(posts,orgLink);
g_szAuthorsLink[ij]='◎';
g_iIndex ++;
return ij;
}
function b_rc(posts)
{
var temp = "";
for (var i=0,comment; comment = g_szComments[i]; i++)
{

var content = comment.title.$t;
var link = comment.link[0].href;
var orgLink= link;
var link2 = link;
var iFind = link.indexOf('?');
if (iFind<0)
iFind = link.indexOf('#');
if (iFind>0)
orgLink = link.substring(0,iFind);
var index = a_FindIndex(posts,orgLink);
if (index>= g_iShowCount)
{
g_iIndex--;
break;
}
var auther= comment.author[0].name.$t;
var timestamp=comment.published.$t.substr(0,10) + ' ' +comment.published.$t.substr(11,5);


temp += '<div style="text-align:left;">' + auther + ':<a href="' + link2 + '" title="' + content + '">' + content.substring(0,12) + '</a></div>';
temp += '<div style="text-align:right;padding: 0px 0px 5px 0px;">Re: <a href="' + g_szOrgLink[index] + '">' + g_szTitle[index].substring(0,10) + '</a> </div>';
}
document.getElementById("divrc").innerHTML = temp;
}
document.write('<script src="http://' + g_szBlogDomain + '/feeds/comments/summary?alt=json-in-script&callback=a_rc"></script><script src="http://' + g_szBlogDomain + '/feeds/posts/summary?alt=json-in-script&callback=b_rc&max-results=99"></script>');


繼續閱讀...
HEMiDEMi Technorati Del.icio.us MyShare個人書籤 Yahoo

張貼者:Paddy 於 下午2:10 0 意見