My studying notebook

2008/08/27

Tip: How To Get Exception Stack in MOSS

8/27/2008 08:38:00 PM Posted by Unknown , 1 comment
Sometime we might get error message when we run moss pages or webparts of we add.
How could we to get more debug messages. We can modify config setting to enable this feature.





Step
  1. Open the Web Application Web.config file
    C:\Inetpub\wwwroot\wss\VirtualDirectories\{Web:Port}
  2. Find the SafeMode section and modify CallStack="ture"
  3. Find the customErrors section and modify mode="Off"
  4. IISReset
We can get Exception Stack when moss page occur error next time.

2008/08/22

Add Star Ratings to your Blogger Blog

8/22/2008 10:15:00 PM Posted by Unknown 1 comment
Blogger in draft support new Star Ratings feature, blog readers can hit rate easily of your post. To enable star ratings, login to
http://draft.blogger.com/ dashboard and go to blog layout page. Click "Edit" botton at Page Elements and selected the "Show Star Ratings".

Modify Blog Template

After enable new Star Rating feature, we must add few code to show star rating where you want.

1.decide a place to show star ratings. For example, to show star ratings in every post footer. Choice one of three paragraph
<div class='post-footer'>
<p class='post-footer-line post-footer-line-1'></p>
<p class='post-footer-line post-footer-line-2'></p>
<p class='post-footer-line post-footer-line-3'></p>
</div>

2.Add following section of codes
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<!-- Add above code, show star rating at single post view, if you don't.
delete it and don't forget </b> tag -->
<span class='star-ratings'>
<b:if cond='data:top.showStars'>
<div expr:g:background-color='data:backgroundColor' expr:g:text-color='data:textColor'
expr:g:url='data:post.absoluteUrl' g:height='42' g:type='RatingPanel' g:width='180'
/>
</b:if>
</span>
</b>

3.Find this line in your template and add following section of code just after this line
<b:include name='nextprev' />
<b:if cond='data:top.showStars'>
<script src='http://www.google.com/jsapi' type='text/javascript' />
<script type='text/javascript'>
google.load("annotations", "1");
function initialize() {
google.annotations.createAll();
google.annotations.fetch();
}
google.setOnLoadCallback(initialize);
</script>
</b:if>


4.you done! Now, after save template and try it.

2008/08/18

ASP.NET 2.0 Content page add Css

8/18/2008 09:51:00 PM Posted by Unknown 1 comment
One of .NET framework 2.0 new important features. Master page, it allow you to create a consistent layout for the pages in your application. You can include Cascading Style Sheets link in master page for you all pages to use the same Cascading Style Sheets easily. But sometimes, you don't want content page to use Cascading Style Sheets inclued of Master page or you want add Cascading Style Sheets to a special page. How can we to do?

We can't add link Cascading Style Sheets syntax in ContentPlaceHolder of content page. So, we can use Htmllink control to add new attribuate.

protected void DynamicAddCss(string csspath) {
// Define an HtmlLink control.
HtmlLink myHtmlLink = new HtmlLink();
myHtmlLink.Href = csspath;
myHtmlLink.Attributes.Add("rel", "stylesheet");
myHtmlLink.Attributes.Add("type", "text/css");

// Add the HtmlLink to the Head section of the page.
Page.Header.Controls.Add(myHtmlLink);
}

// add Cascading Styles Sheet
DynamicAddCss("http://jquery.com/files/social/jquery.tabs-ie.css")

2008/08/15

Your HTML either contains unsafe tags

8/15/2008 10:18:00 PM Posted by Unknown , 2 comments
上一篇文章提到Google即將停止Page Create的服務。而以Google Sites來取代其功能。

因此想說就試一下Google Sites有沒有比較彈性的功能。在頁面編輯的時候加了一最簡單的Javascript語法,如果成功的話,就可以在Google Sites中試一些Google API來玩玩。

document.alert('alert popup message');


不過卻得到以下的訊息


又回去把Google announce的文章看一篇. !!!! 居然沒有看到..

I'm not sure if Google Sites is a good replacement for Page Creator, since the interface is more complicated and there are many limitations: you can't add JavaScript code, embedded objects or iframes, it's more difficult to upload files and to setup a simple site.

URI: Google Page Creator to Be Closed(Google).

Google Page Creator to Be Closed

8/15/2008 09:57:00 PM Posted by Unknown 1 comment
2008/8/9

在Google Reader中收到一個新的消息。繼Browser Sync, Hello, Send to SMS and Send to Phone extension之後,又有一個Google 所提供的服務要停止了→ Page Create

真是一個壞消息啊 ~~~ Bad Bad Bad.
因為在我擁有的2個Blogger中,尚有些Javascript的程式碼是放在上面。真不知道要把上面的Javascript搬到那去比較好。

具說明的理由是另一個Google提供的服務Google Sites中的功能已可包含Page Create中的功能,因為就會Page Create不再提供服務。喜愛Google服務的我當然在Google Sites一推出的時候就馬上先註冊一下自己的網域了,今天又上去東點點西點點,試試有沒有什麼新的功能。

看來是時候該把Google Sites摸熟一點了!!

2008/08/05

惱人的Google Map Api

8/05/2008 10:39:00 PM Posted by Unknown 1 comment
有使用過Google Map Api的人都知道,想在自己的網頁中嵌入Google Map必須先申請Google Map API Key,在申請的過程中除了要有Google帳號之外,還得輸入欲使用Google Map的網址。完成之後會產出是一組長達86個字元的Key。

上一篇文章(Google AJAX Feed API - AJAX Slide Show Rolling)提及利用Picasa Web Albums Data API 與 jQurey JSON的操作,即可完成Picasa Web Albums的輪播;其它有做用jQuery中 $.getJSON() 的函數來存取逺端的Picasa Web Albums Data。後來又修改了一下程式碼,直接使用javascript中 script.setAttribute 中的方法來指定url及callback function,並加入Google Map來表示地理位置,如下圖。



無奈不知道什麼時候使用過同樣的Google Map API Key,導至出現API已使用的訊息!!


真害!!!
想不出來在那用過了~~~~~~~~殘念!!

ps.此篇純屬mermer,等問題待解決之後,會把作法說明一下!!!
ps.第一個版本請見竹誌picasa Feed區塊