Add Page Number (with First and Last Page) Navigation Link for Blogger (Blogspot) with Gadget Element and Manual Hack添加頁碼(同第一頁和最後一頁)導航鏈接的Blogger (博客)與小元和手動砍

Blogger free blog publishing platform uses a pretty limited navigation features that only display “Older Posts” or “Newer Posts” link to let readers navigate and browse to other pages on homepage (index), archive, category and label pages. Blogger是免費的博客發布平台採用了相當有限的導航功能,只顯示“較舊的文章”或“較新的文章”鏈接,讓讀者瀏覽和瀏覽其他網頁的主頁(索引) ,存檔,類別和標籤的網頁。 Unlike WordPress blog that supports plugin to customize the page navigation link to numbered pages listing to make it more user friendly, Blogger, whether hosted on blogspot.com or custom domain does not have such flexibility.與WordPress的博客,支持插件定制網頁導航鏈接到的網頁數列,使其更加用戶友好的Blogger ,無論是託管在blogspot.com或自定義域沒有這種靈活性。

However, it’s still possible to change and replace the typical classic “Older Posts” and “Newer Posts” navigation link on Blogger blog to numbered pages navigation, as illustrated in figure below by using a CSS and JavaScript hack wrote by Mohamed Rias.但是,它仍然可能改變,代之以典型的經典之作“較舊的文章”和“較新的文章”導航鏈接Blogger博客以網頁瀏覽人數所示,在圖所示用CSS和JavaScript寫的黑客穆罕默德里亞斯。

Numbered Page Navigation for Blogger

As shown in image above, a navigation link consists of page numbers, first page, last page, next page and previous page (when applicable) is display on Blogger blog instead of the usual “Older Items” and “Newer Items” text links.如上圖中,導航鏈接包括頁碼,第一頁,最後一頁,下一頁和前一頁(適用時)是顯示在Blogger博客而不是通常的“舊項目”和“較新的物品”文字鏈接。

To add the “new” navigation link with page number to Blogger blog, simply add in a new Page Element Gadget in the Blogger.新增的“新”導航鏈接頁面編號, Blogger博客,只需添加一個新的頁面元素工具在Blogger 。 To do so, follow the guide below:為了做到這一點,按照指南如下:

  1. Login to登錄 Blogger的Blogger account Dashboard .控制台。
  2. Click on the Layout link for the blog that you want to modify (if you’re viewing the blog and logged in to Blogger or Google Account, just click on Customize on the Next Blog toolbar.點擊鏈接佈局的博客,您要修改(如果你看的博客和登錄到Blogger或谷歌帳戶,只需按一下定制的下一個Blog工具欄。
  3. Go to Page Element tab (by default). 轉到頁面元素標籤(默認) 。
  4. Click on Add a Gadget anywhere in the layout.點擊添加一個小地方的佈局。
  5. In the Add a Gadget window, select HTML/JavaScript .在添加小工具窗口中,選擇的HTML / JavaScript的
  6. Add the following code into the Content text field.將下面的代碼添加到文本字段的內容 Title field can be left blank, or just type in any description such as “Page Navigation” to differentiate it from the rest of widgets.標題欄位可以留白,或者只是在任何類型的描述,如“頁面導航” ,以區別於其他的小玩意。

    <style>
    .showpageArea { 。 showpageArea (
    padding: 0 2px;margin-top:10px;margin-bottom:10px;填充: 0 2px ;利潤率頂: 10px ;緣底: 10px ;
    }

    .showpageArea a { 。 showpageArea了一個(
    border: 1px solid #505050;邊界: 1px #五十〇萬五千○五十零堅實;
    color: #000000;font-weight:normal;顏色: # 000000 ;字型粗細:正常;
    padding: 3px 6px !important;填充: 3px 6px !重要的;
    padding: 1px 4px ;margin:0px 4px;填充: 1px 4px ;保證金: 0px 4px ;
    text-decoration: none;文字修飾:無;
    }

    .showpageArea a:hover { 。 showpageArea答:懸停(
    font-size:11px;字體大小: 11px ;
    border: 1px solid #333;邊界: 1px固體# 333 ;
    color: #000000;顏色: # 000000 ;
    background-color: #FFFFFF;背景顏色: # FFFFFF ;
    }

    .showpageNum a { 。 showpageNum了一個(
    border: 1px solid #505050;邊界: 1px #五十萬五千零五十堅實;
    color: #000000;font-weight:normal;顏色: # 000000 ;字型粗細:正常;
    padding: 3px 6px !important;填充: 3px 6px !重要的;
    padding: 1px 4px ;margin:0px 4px;填充: 1px 4px ;保證金: 0px 4px ;
    text-decoration: none;文字修飾:無;
    }

    .showpageNum a:hover { 。 showpageNum答:懸停(
    font-size:11px;字體大小: 11px ;
    border: 1px solid #333;邊界: 1px固體# 333 ;
    color: #000000;顏色: # 000000 ;
    background-color: #FFFFFF;背景顏色: # FFFFFF ;

    }
    .showpagePoint { 。 showpagePoint (
    font-size:11px;字體大小: 11px ;
    padding: 2px 4px 2px 4px;填充: 2px 4px 2px 4px ;
    margin: 2px;保證金: 2px ;
    font-weight: bold;字型粗細:大膽;
    border: 1px solid #333;邊界: 1px固體# 333 ;
    color: #fff;顏色: #足協;
    background-color: #000000;背景顏色: # 000000 ;
    }

    .showpage a:hover { 。 showpage答:懸停(
    font-size:11px;字體大小: 11px ;
    border: 1px solid #333;邊界: 1px固體# 333 ;
    color: #000000;顏色: # 000000 ;
    background-color: #FFFFFF;背景顏色: # FFFFFF ;
    }

    .showpageNum a:link,.showpage a:link { 。 showpageNum答:連結, 。 showpage 1 :連結(
    font-size:11px;字體大小: 11px ;
    padding: 2px 4px 2px 4px;填充: 2px 4px 2px 4px ;
    margin: 2px;保證金: 2px ;
    text-decoration: none;文字修飾:無;
    border: 1px solid #0066cc;邊界: 1px # 0066cc堅實;
    color: #0066cc;顏色: # 0066cc ;
    background-color: #FFFFFF;}背景顏色: # FFFFFF ; )

    .showpageNum a:hover { 。 showpageNum答:懸停(
    font-size:11px;字體大小: 11px ;
    border: 1px solid #333;邊界: 1px固體# 333 ;
    color: #000000;顏色: # 000000 ;
    background-color: #FFFFFF;背景顏色: # FFFFFF ;
    }
    </style> “ /樣式”

    <script type=”text/javascript”> <script type="text/javascript">

    function showpageCount(json) {功能showpageCount ( json ) (
    var thisUrl = location.href;葉thisUrl = location.href ;
    var htmlMap = new Array();葉htmlMap =新的Array ( ) ;
    var isFirstPage = thisUrl.substring(thisUrl.length-14,thisUrl.length)==”.blogspot.com/”;葉isFirstPage = thisUrl.substring ( thisUrl.length - 14 , thisUrl.length )==". blogspot.com / “ ;
    var isLablePage = thisUrl.indexOf(”/search/label/”)!=-1;葉isLablePage = thisUrl.indexOf ( “ /搜索/標籤/")!=- 1 ;
    var isPage = thisUrl.indexOf(”/search?updated”)!=-1;葉isPage = thisUrl.indexOf ( “ /搜索?更新")!=- 1 ;
    var thisLable = isLablePage ?葉thisLable = isLablePage ? thisUrl.substr(thisUrl.indexOf(”/search/label/”)+14,thisUrl.length) : “”; thisUrl.substr ( thisUrl.indexOf ( “ /搜索/標籤/ ” ) 14 , thisUrl.length ) : “ ” ;
    thisLable = thisLable.indexOf(”?”)!=-1 ? thisLable = thisLable.indexOf ("?")!=- 1 ? thisLable.substr(0,thisLable.indexOf(”?”)) : thisLable; thisLable.substr ( 0 , thisLable.indexOf ("?")) : thisLable ;
    var thisNum = 1;葉thisNum = 1 ;
    var postNum=1;葉postNum = 1 ;
    var itemCount = 0;葉itemCount = 0 ;
    var fFlag = 0;葉fFlag = 0 ;
    var eFlag = 0;葉eFlag = 0 ;
    var html= ”;無功的HTML = “ ;
    var upPageHtml =”;葉upPageHtml = “ ;
    var downPageHtml =”;葉downPageHtml = “ ;

    var pageCount=5;葉pageCount = 5 ;
    var displayPageNum=3;葉displayPageNum = 3 ;
    var firstPageWord = ‘First’;葉firstPageWord = '第一' ;
    var endPageWord = ‘Last’;葉endPageWord = '最後' ;
    var upPageWord =’Previous’;葉upPageWord = '前' ;
    var downPageWord =’Next’;葉downPageWord = '下一步' ;

    var labelHtml = ‘<span class=”showpageNum”><a href=”/search/label/’+thisLable+’?&max-results=’+pageCount+’”>’;葉labelHtml = ' <span class="showpageNum">的<a href="/search/label/'+thisLable+'?&max-results='+pageCount+'"> ' ;

    for(var i=0, post; post = json.feed.entry[i]; i++) {為(變種字母i = 0 ,員額;後= json.feed.entry [一]我+ + ) (
    var timestamp = post.published.$t.substr(0,10);葉時間戳= post.published 。 t.substr $ ( 0,10 ) ;
    var title = post.title.$t;無功標題= post.title 。 $噸;
    if(isLablePage){如果( isLablePage ) (
    if(title!=”){如果(標題!="){
    if(post.category){如果( post.category ) (
    for(var c=0, post_category; post_category = post.category[c]; c++) {為(變種的C = 0 , post_category ; post_category = post.category [ C ]條;的C + + ) (
    if(encodeURIComponent(post_category.term)==thisLable){如果( encodeURIComponent ( post_category.term ) == thisLable ) (
    if(itemCount==0 || (itemCount % pageCount ==(pageCount-1))){如果( itemCount == 0 | | ( itemCount % pageCount == ( pageCount - 1 ) ) ) (
    if(thisUrl.indexOf(timestamp)!=-1 ){如果( thisUrl.indexOf (時間戳) ! =- 1 ) (
    thisNum = postNum; thisNum = postNum ;
    }

    postNum++; postNum + + ;
    htmlMap[htmlMap.length] = ‘/search/label/’+thisLable+’?updated-max=’+timestamp+’T00%3A00%3A00%2B08%3A00&max-results=’+pageCount; htmlMap [ htmlMap.length ] = ' /搜索/標籤/ ' + thisLable + ' ?更新的最大值= ' +時間+ ' T00 % 3A00 % 3A00 % 2B08 % 3A00 &最大成果= ' + pageCount ;
    }
    }
    }
    }//end if(post.category){ ) / /結束,如果( post.category ) (

    itemCount++; itemCount + + ;
    }

    }else{別人) (
    if(title!=”){如果(標題!="){
    if(itemCount==0 || (itemCount % pageCount ==(pageCount-1))){如果( itemCount == 0 | | ( itemCount % pageCount == ( pageCount - 1 ) ) ) (
    if(thisUrl.indexOf(timestamp)!=-1 ){如果( thisUrl.indexOf (時間戳) ! =- 1 ) (
    thisNum = postNum; thisNum = postNum ;
    }

    if(title!=”) postNum++;如果(標題! = “ ) postNum + + ;
    htmlMap[htmlMap.length] = ‘/search?updated-max=’+timestamp+’T00%3A00%3A00%2B08%3A00&max-results=’+pageCount; htmlMap [ htmlMap.length ] = ' /搜索?更新的最大值= ' +時間+ ' T00 % 3A00 % 3A00 % 2B08 % 3A00 &最大成果= ' + pageCount ;
    }
    }
    itemCount++; itemCount + + ;
    }
    }

    for(var p =0;p< htmlMap.length;p++){為(變種P值0 ; p “ htmlMap.length ; p + + ) (
    if(p>=(thisNum-displayPageNum-1) && p<(thisNum+displayPageNum)){如果( p “ = ( thisNum - displayPageNum - 1 )及標準普爾” ( thisNum + displayPageNum ) ) (
    if(fFlag ==0 && p == thisNum-2){如果( fFlag == 0 &標準普爾thisNum == 2 ) (
    if(thisNum==2){如果( thisNum == 2 ) (
    if(isLablePage){如果( isLablePage ) (
    upPageHtml = labelHtml + upPageWord +’</a></span>’; upPageHtml = labelHtml + upPageWord + “ < / 1 ” “ /跨度> ” ;
    }else{其他) (
    upPageHtml = ‘<span class=”showpage”><a href=”/”>’+ upPageWord +’</a></span>’; upPageHtml = ' <span class="showpage">的<a href="/"> ' + upPageWord + “ < / 1 ” “ /跨度> ” ;
    }
    }else{其他) (
    upPageHtml = ‘<span class=”showpage”><a href=”‘+htmlMap[p]+’”>’+ upPageWord +’</a></span>’; upPageHtml = ' <span class="showpage">的<a href="'+htmlMap[p]+'"> ' + upPageWord + “ < / 1 ” “ /跨度> ” ;
    }

    fFlag++; fFlag + + ;
    }

    if(p==(thisNum-1)){如果( p == ( thisNum - 1 ) ) (
    html += ‘&nbsp;<span class=”showpagePoint”><u>’+thisNum+’</u></span>’;的HTML + = ' <span class="showpagePoint">成效給予評' + thisNum + “ < / U系列” “ /跨度> ” ;
    }else{其他) (
    if(p==0){如果( p == 0 ) (
    if(isLablePage){如果( isLablePage ) (
    html = labelHtml+’1</a></span>’;的HTML = labelHtml + '1 “ / 1 ” “ /跨度> ” ;
    }else{其他) (
    html += ‘<span class=”showpageNum”><a href=”/”>1</a></span>’;的HTML + = ' <span class="showpageNum">的<a href="/">一日“ / 1 ” “ /跨度> ” ;
    }
    }else{其他) (
    html += ‘<span class=”showpageNum”><a href=”‘+htmlMap[p]+’”>’+ (p+1) +’ </a></span>’;的HTML + = ' <span class="showpageNum">的<a href="'+htmlMap[p]+'"> ' + ( p +1 ) + “ < / 1 ” “ /跨度> ” ;
    }
    }

    if(eFlag ==0 && p == thisNum){如果( eFlag == 0 &標準普爾== thisNum ) (
    downPageHtml = ‘<span class=”showpage”> <a href=”‘+htmlMap[p]+’”>’+ downPageWord +’</a></span>’; downPageHtml = ' <span class="showpage">的<a href="'+htmlMap[p]+'"> ' + downPageWord + “ < / 1 ” “ /跨度> ” ;
    eFlag++; eFlag + + ;
    }
    }//end if(p>=(thisNum-displayPageNum-1) && p<(thisNum+displayPageNum)){ ) / /結束,如果( p “ = ( thisNum - displayPageNum - 1 )及標準普爾” ( thisNum + displayPageNum ) ) (
    }//end for(var p =0;p< htmlMap.length;p++){ ) / /結束(變種P值0 ; p “ htmlMap.length ; p + + ) (

    if(thisNum>1){如果( thisNum “ 1 ) (
    if(!isLablePage){如果( ! isLablePage ) (
    html = ‘<span class=”showpage”><a href=”/”>’+ firstPageWord +’ </a></span>’+upPageHtml+’ ‘+html +’ ‘;的HTML = ' <span class="showpage">的<a href="/"> ' + firstPageWord + “ < / 1 ” “ /跨度> ” + upPageHtml + ' ' +的HTML + ' ' ;
    }else{其他) (
    html = ”+labelHtml + firstPageWord +’ </a></span>’+upPageHtml+’ ‘+html +’ ‘;的HTML = “ + labelHtml + firstPageWord + ” < / 1 “ ” /跨度> “ + upPageHtml + ' ' +的HTML + ' ' ;
    }
    }

    html = ‘<div class=”showpageArea”><span style=”font-size:11px;padding: 2px 4px 2px 4px;margin: 2px 2px 2px 2px;color: #000000;border: 1px solid #333; background-color: #FFFFFF;” class=”showpage”>Page ‘+thisNum+’ of ‘+(postNum-1)+’: </span>’+html;的HTML = ' <div class="showpageArea"> “跨度風格= ”字體大小: 11px ;填充: 2px 4px 2px 4px ;保證金: 2px 2px 2px 2px ;顏色: # 000000 ;邊界: 1px固體# 333 ;背景顏色: # FFFFFF ; “階級= ” showpage “ ”頁' + thisNum + '的' + ( postNum - 1 ) + ' : “ /跨度> ” +的HTML ;

    if(thisNum<(postNum-1)){如果( thisNum “ ( postNum - 1 ) ) (
    html += downPageHtml;的HTML + = downPageHtml ;
    html += ‘<span class=”showpage”><a href=”‘+htmlMap[htmlMap.length-1]+’”> ‘+endPageWord+’</a></span>’;的HTML + = ' <span class="showpage">的<a href="'+htmlMap[htmlMap.length-1]+'"> ' + endPageWord + “ < / 1 ” “ /跨度> ” ;
    }

    if(postNum==1) postNum++;如果( postNum == 1 ) postNum + + ;
    html += ‘</div>’;的HTML + = “ < /專區> ” ;

    if(isPage || isFirstPage || isLablePage){如果( isPage | | isFirstPage | | isLablePage ) (
    var pageArea = document.getElementsByName(”pageArea”);葉pageArea = document.getElementsByName ( “ pageArea ” ) ;
    var blogPager = document.getElementById(”blog-pager”);葉blogPager = document.getElementById ( “博客,傳呼機” ) ;

    if(postNum <= 2){如果( postNum “ = 2 ) (
    html =”;的HTML = “ ;
    }

    for(var p =0;p< pageArea.length;p++){為(變種P值0 ; p “ pageArea.length ; p + + ) (
    pageArea[p].innerHTML = html; pageArea [ p ] 。 innerHTML =的HTML ;
    }

    if(pageArea&&pageArea.length>0){如果( pageArea & & pageArea.length “ 0 ) (
    html =”;的HTML = “ ;
    }

    if(blogPager){如果( blogPager ) (
    blogPager.innerHTML = html; blogPager.innerHTML =的HTML ;
    }
    }

    }
    </script> “ /腳本”

    <script src=”/feeds/posts/summary?alt=json-in-script&callback=showpageCount&max-results=99999″ type=”text/javascript”></script> <script src="/feeds/posts/summary?alt=json-in-script&callback=showpageCount&max-results=99999" type="text/javascript"> “ /腳本”

  7. Click Save button.點擊保存按鈕。
  8. Drag and drop the newly added HTML/JavaScript gadget to directly right below the Blog Posts element.拖放新增的HTML / JavaScript的小工具直接權利低於博客帖子內容。 Location of Page Navigation Gadget
  9. Click on Save button to make the change effective.點擊保存按鈕,使更改生效。

For user who don’t want to use the Page Element widget or gadget, it’s possible to manually editing the HTML file, although it’s more difficult to do and should only be tried by blogger with technical expertise.對於用戶誰不想使用的網頁元素部件或小工具,它能夠手動編輯HTML文件,但它更困難的事,並只應受到博客的技術專長。

  1. Login to登錄 Blogger的Blogger account Dashboard .控制台。
  2. Click on the Layout link for the blog that you want to modify (if you’re viewing the blog and logged in to Blogger or Google Account, just click on Customize on the Next Blog toolbar.點擊鏈接佈局的博客,您要修改(如果你看的博客和登錄到Blogger或谷歌帳戶,只需按一下定制的下一個Blog工具欄。
  3. Go to Edit HTML tab (there is no need to expand widget templates).轉到編輯HTML標籤(沒有必要擴大窗口小部件模板) 。
  4. Search for the following line: ]]></b:skin>搜索以下行: ]]></b:skin>
  5. Copy the following CSS code and paste or append the code above the line:複製以下CSS代碼並粘貼或附在上面的代碼行:

    .showpageArea {
    padding: 0 2px;margin-bottom:10px;margin-top:10px;
    }

    .showpageArea a {
    border: 1px solid #505050;
    color: #000000;font-weight:normal;
    padding: 3px 6px !important;
    padding: 1px 4px ;margin:0px 4px;
    text-decoration: none;
    }

    .showpageArea a:hover {
    font-size:11px;
    border: 1px solid #333;
    color: #000000;
    background-color: #FFFFFF;
    }

    .showpageNum a {
    border: 1px solid #505050;
    color: #000000;font-weight:normal;
    padding: 3px 6px !important;
    padding: 1px 4px ;margin:0px 4px;
    text-decoration: none;
    }

    .showpageNum a:hover {
    font-size:11px;
    border: 1px solid #333;
    color: #000000;
    background-color: #FFFFFF;
    }

    .showpagePoint {
    font-size:11px;
    padding: 2px 4px 2px 4px;
    margin: 2px;
    font-weight: bold;
    border: 1px solid #333;
    color: #fff;
    background-color: #000000;
    }

    .showpage a:hover {
    font-size:11px;
    border: 1px solid #333;
    color: #000000;
    background-color: #FFFFFF;
    }

    .showpageNum a:link,.showpage a:link {
    font-size:11px;
    padding: 2px 4px 2px 4px;
    margin: 2px;
    text-decoration: none;
    border: 1px solid #0066cc;
    color: #0066cc;
    background-color: #FFFFFF;
    }

    .showpageNum a:hover {
    font-size:11px;
    border: 1px solid #333;
    color: #000000;
    background-color: #FFFFFF;
    }

  6. Next, search for the following line of code in the template’s HTML code:其次,尋找下面的代碼行中的模板的代碼:

    <b:section class='main' id='main' showaddelement='no'>
    <b:widget id='Blog1' locked='true' title='Blog Posts' type='Blog'/>
    </b:section>

    Note: The ‘no’ after “showaddelement” can be ‘yes’ for some bloggers.注: '不'後, “ showaddelement ”可'是'的一些博客。

  7. Add and append the following JavaScript code right after the </b:section> line:新增及附加以下JavaScript代碼後, “ / B組:一節”行:

    &lt;script type=&quot;text/javascript&quot;&gt; <script type="text/javascript">

    function showpageCount(json) {功能showpageCount ( json ) (
    var thisUrl = location.href;葉thisUrl = location.href ;
    var htmlMap = new Array();葉htmlMap =新的Array ( ) ;
    var isFirstPage = thisUrl.substring(thisUrl.length-14,thisUrl.length)==&quot;.blogspot.com/&quot;;葉isFirstPage = thisUrl.substring ( thisUrl.length - 14 , thisUrl.length )==". blogspot.com / “ ;
    var isLablePage = thisUrl.indexOf(&quot;/search/label/&quot;)!=-1;葉isLablePage = thisUrl.indexOf ( “ /搜索/標籤/")!=- 1 ;
    var isPage = thisUrl.indexOf(&quot;/search?updated&quot;)!=-1;葉isPage = thisUrl.indexOf ( “ /搜索?更新")!=- 1 ;
    var thisLable = isLablePage ?葉thisLable = isLablePage ? thisUrl.substr(thisUrl.indexOf(&quot;/search/label/&quot;)+14,thisUrl.length) : &quot;&quot;; thisUrl.substr ( thisUrl.indexOf ( “ /搜索/標籤/ ” ) 14 , thisUrl.length ) : “ ” ;
    thisLable = thisLable.indexOf(&quot;?&quot;)!=-1 ? thisLable = thisLable.indexOf ("?")!=- 1 ? thisLable.substr(0,thisLable.indexOf(&quot;?&quot;)) : thisLable; thisLable.substr ( 0 , thisLable.indexOf ("?")) : thisLable ;
    var thisNum = 1;葉thisNum = 1 ;
    var postNum=1;葉postNum = 1 ;
    var itemCount = 0;葉itemCount = 0 ;
    var fFlag = 0;葉fFlag = 0 ;
    var eFlag = 0;葉eFlag = 0 ;
    var html= &#39;&#39;;無功的HTML = '' ;
    var upPageHtml =&#39;&#39;;葉upPageHtml = '' ;
    var downPageHtml =&#39;&#39;;葉downPageHtml = '' ;

    var pageCount=5;葉pageCount = 5 ;
    var displayPageNum=3;葉displayPageNum = 3 ;
    var firstPageWord = &#39;First&#39;;葉firstPageWord = '第一' ;
    var endPageWord = &#39;Last&#39;;葉endPageWord = '最後' ;
    var upPageWord =&#39;Previous&#39;;葉upPageWord = '前' ;
    var downPageWord =&#39;Next&#39;;葉downPageWord = '下一步' ;

    var labelHtml = &#39;&lt;span class=&quot;showpageNum&quot;&gt;&lt;a href=&quot;/search/label/&#39;+thisLable+&#39;?&amp;max-results=&#39;+pageCount+&#39;&quot;&gt;&#39;;葉labelHtml = ' <span class="showpageNum"> “一href = ” /搜索/標籤/ ' + thisLable + ' ?和最大的成果= & # 39 ; + pageCount +'">';

    for(var i=0, post; post = json.feed.entry[i]; i++) {為(變種字母i = 0 ,員額;後= json.feed.entry [一]我+ + ) (
    var timestamp = post.published.$t.substr(0,10);葉時間戳= post.published 。 t.substr $ ( 0,10 ) ;
    var title = post.title.$t;無功標題= post.title 。 $噸;
    if(isLablePage){如果( isLablePage ) (
    if(title!=&#39;&#39;){如果(標題!=''){
    if(post.category){如果( post.category ) (
    for(var c=0, post_category; post_category = post.category[c]; c++) {為(變種的C = 0 , post_category ; post_category = post.category [ C ]條;的C + + ) (
    if(encodeURIComponent(post_category.term)==thisLable){如果( encodeURIComponent ( post_category.term ) == thisLable ) (
    if(itemCount==0 || (itemCount % pageCount ==(pageCount-1))){如果( itemCount == 0 | | ( itemCount % pageCount == ( pageCount - 1 ) ) ) (
    if(thisUrl.indexOf(timestamp)!=-1 ){如果( thisUrl.indexOf (時間戳) ! =- 1 ) (
    thisNum = postNum; thisNum = postNum ;
    }

    postNum++; postNum + + ;
    htmlMap[htmlMap.length] = &#39;/search/label/&#39;+thisLable+&#39;?updated-max=&#39;+timestamp+&#39;T00%3A00%3A00%2B08%3A00&amp;max-results=&#39;+pageCount; htmlMap [ htmlMap.length ] = ' /搜索/標籤/ ' + thisLable + ' ?更新的最大值= ' +時間+ ' T00 % 3A00 % 3A00 % 2B08 % 3A00 &最大成果= ' + pageCount ;
    }
    }
    }
    }//end if(post.category){ ) / /結束,如果( post.category ) (

    itemCount++; itemCount + + ;
    }

    }else{其他) (
    if(title!=&#39;&#39;){如果(標題!=''){
    if(itemCount==0 || (itemCount % pageCount ==(pageCount-1))){如果( itemCount == 0 | | ( itemCount % pageCount == ( pageCount - 1 ) ) ) (
    if(thisUrl.indexOf(timestamp)!=-1 ){如果( thisUrl.indexOf (時間戳) ! =- 1 ) (
    thisNum = postNum; thisNum = postNum ;
    }

    if(title!=&#39;&#39;) postNum++;如果(標題!='') postNum + + ;
    htmlMap[htmlMap.length] = &#39;/search?updated-max=&#39;+timestamp+&#39;T00%3A00%3A00%2B08%3A00&amp;max-results=&#39;+pageCount; htmlMap [ htmlMap.length ] = ' /搜索?更新的最大值= ' +時間+ ' T00 % 3A00 % 3A00 % 2B08 % 3A00 &最大成果= ' + pageCount ;
    }
    }
    itemCount++; itemCount + + ;
    }
    }

    for(var p =0;p&lt; htmlMap.length;p++){為(變種P值0 ; p “ htmlMap.length ; p + + ) (
    if(p&gt;=(thisNum-displayPageNum-1) &amp;&amp; p&lt;(thisNum+displayPageNum)){如果( p “ = ( thisNum - displayPageNum - 1 )及標準普爾” ( thisNum + displayPageNum ) ) (
    if(fFlag ==0 &amp;&amp; p == thisNum-2){如果( fFlag == 0 &標準普爾thisNum == 2 ) (
    if(thisNum==2){如果( thisNum == 2 ) (
    if(isLablePage){如果( isLablePage ) (
    upPageHtml = labelHtml + upPageWord +&#39;&lt;/a&gt;&lt;/span&gt;&#39;; upPageHtml = labelHtml + upPageWord + “ < / 1 ” “ /跨度> ” ;
    }else{其他) (
    upPageHtml = &#39;&lt;span class=&quot;showpage&quot;&gt;&lt;a href=&quot;/&quot;&gt;&#39;+ upPageWord +&#39;&lt;/a&gt;&lt;/span&gt;&#39;; upPageHtml = ' <span class="showpage">的<a href="/"> ' + upPageWord + “ < / 1 ” “ /跨度” ' ;
    }
    }else{其他) (
    upPageHtml = &#39;&lt;span class=&quot;showpage&quot;&gt;&lt;a href=&quot;&#39;+htmlMap[p]+&#39;&quot;&gt;&#39;+ upPageWord +&#39;&lt;/a&gt;&lt;/span&gt;&#39;; upPageHtml = ' <span class="showpage">的<a href="'+htmlMap[p]+'"> ' + + & upPageWord # 39 ; “ / 1 ” “ /跨度> ” ;
    }

    fFlag++; fFlag + + ;
    }

    if(p==(thisNum-1)){如果( p == ( thisNum - 1 ) ) (
    html += &#39;&amp;nbsp;&lt;span class=&quot;showpagePoint&quot;&gt;&lt;u&gt;&#39;+thisNum+&#39;&lt;/u&gt;&lt;/span&gt;&#39;;的HTML + = ' <span class="showpagePoint">成效給予評' + thisNum + “ < / U系列” “ /跨度> ” ; ;
    }else{其他) (
    if(p==0){如果( p == 0 ) (
    if(isLablePage){如果( isLablePage ) (
    html = labelHtml+&#39;1&lt;/a&gt;&lt;/span&gt;&#39;;的HTML = labelHtml + '1 “ / 1 ” “ /跨度> ” ;
    }else{其他) (
    html += &#39;&lt;span class=&quot;showpageNum&quot;&gt;&lt;a href=&quot;/&quot;&gt;1&lt;/a&gt;&lt;/span&gt;&#39;;的HTML + = ' <span class="showpageNum">的<a href="/">一日“ / 1 ” “ /跨度> ” ;
    }
    }else{其他) (
    html += &#39;&lt;span class=&quot;showpageNum&quot;&gt;&lt;a href=&quot;&#39;+htmlMap[p]+&#39;&quot;&gt;&#39;+ (p+1) +&#39; &lt;/a&gt;&lt;/span&gt;&#39;;的HTML + = ' <span class="showpageNum">的<a href="'+htmlMap[p]+'"> ' + ( p +1 ) + “ < / 1 ” “ /跨度> ” ;
    }
    }

    if(eFlag ==0 &amp;&amp; p == thisNum){如果( eFlag == 0 &標準普爾== thisNum ) (
    downPageHtml = &#39;&lt;span class=&quot;showpage&quot;&gt; &lt;a href=&quot;&#39;+htmlMap[p]+&#39;&quot;&gt;&#39;+ downPageWord +&#39;&lt;/a&gt;&lt;/span&gt;&#39;; downPageHtml = ' <span class="showpage">的<a href="'+htmlMap[p]+'"> ' + + & downPageWord # 39 ; “ / 1 ” “ /跨度> ” ;
    eFlag++; eFlag + + ;
    }
    }//end if(p&gt;=(thisNum-displayPageNum-1) &amp;&amp; p&lt;(thisNum+displayPageNum)){ ) / /結束,如果( p “ = ( thisNum - displayPageNum - 1 )及標準普爾” ( thisNum + displayPageNum ) ) (
    }//end for(var p =0;p&lt; htmlMap.length;p++){ ) / /結束(變種P值0 ; p “ htmlMap.length ; p + + ) (

    if(thisNum&gt;1){如果( thisNum “ 1 ) (
    if(!isLablePage){如果( ! isLablePage ) (
    html = &#39;&lt;span class=&quot;showpage&quot;&gt;&lt;a href=&quot;/&quot;&gt;&#39;+ firstPageWord +&#39; &lt;/a&gt;&lt;/span&gt;&#39;+upPageHtml+&#39; &#39;+html +&#39; &#39;;的HTML = ' <span class="showpage">的<a href="/"> ' + firstPageWord + “ < / 1 ” “ /跨度” ' + upPageHtml + ' ' +的HTML + ' ' ;
    }else{其他) (
    html = &#39;&#39;+labelHtml + firstPageWord +&#39; &lt;/a&gt;&lt;/span&gt;&#39;+upPageHtml+&#39; &#39;+html +&#39; &#39;;的HTML = '' + labelHtml + firstPageWord + “ < / 1 ” “ /跨度> ” + upPageHtml + ' ' +的HTML + ' ; ' ;
    }
    }

    html = &#39;&lt;div class=&quot;showpageArea&quot;&gt;&lt;span style=&quot;font-size:11px;padding: 2px 4px 2px 4px;margin: 2px 2px 2px 2px;color: #000000;border: 1px solid #333; background-color: #FFFFFF;&quot; class=&quot;showpage&quot;&gt;Page &#39;+thisNum+&#39; of &#39;+(postNum-1)+&#39;: &lt;/span&gt;&#39;+html;的HTML = ' <div class="showpageArea"> “跨度風格= ”字體大小: 11px ;填充: 2px 4px 2px 4px ;保證金: 2px 2px 2px 2px ;顏色: # 000000 ;邊界: 1px固體# 333 ;背景顏色: # FFFFFF ; “階級= ” showpage “ ”頁' + thisNum + '的' + ( postNum - 1 ) + ' ; : “ /跨度> ” +的HTML ;

    if(thisNum&lt;(postNum-1)){如果( thisNum “ ( postNum - 1 ) ) (
    html += downPageHtml;的HTML + = downPageHtml ;
    html += &#39;&lt;span class=&quot;showpage&quot;&gt;&lt;a href=&quot;&#39;+htmlMap[htmlMap.length-1]+&#39;&quot;&gt; &#39;+endPageWord+&#39;&lt;/a&gt;&lt;/span&gt;&#39;;的HTML + = ' <span class="showpage">的<a href="'+htmlMap[htmlMap.length-1]+'"> ' ; + endPageWord + “ < / 1 ” “ /跨度> ” ;
    }

    if(postNum==1) postNum++;如果( postNum == 1 ) postNum + + ;
    html += &#39;&lt;/div&gt;&#39;;的HTML + = “ < /專區> ” ;

    if(isPage || isFirstPage || isLablePage){如果( isPage | | isFirstPage | | isLablePage ) (
    var pageArea = document.getElementsByName(&quot;pageArea&quot;);葉pageArea = document.getElementsByName ( “ pageArea ” ) ;
    var blogPager = document.getElementById(&quot;blog-pager&quot;);葉blogPager = document.getElementById ( “博客,傳呼機” ) ;

    if(postNum &lt;= 2){如果( postNum “ = 2 ) (
    html =&#39;&#39;;的HTML = '' ;
    }

    for(var p =0;p&lt; pageArea.length;p++){為(變種P值0 ; p “ pageArea.length ; p + + ) (
    pageArea[p].innerHTML = html; pageArea [ p ] 。 innerHTML =的HTML ;
    }

    if(pageArea&amp;&amp;pageArea.length&gt;0){如果( pageArea & & pageArea.length “ 0 ) (
    html =&#39;&#39;;的HTML = '' ;
    }

    if(blogPager){如果( blogPager ) (
    blogPager.innerHTML = html; blogPager.innerHTML =的HTML ;
    }
    }

    }
    &lt;/script&gt; “ /腳本”

    &lt;script src=&quot;/feeds/posts/summary?alt=json-in-script&amp;callback=showpageCount&amp;max-results=99999&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt; <script src="/feeds/posts/summary?alt=json-in-script&callback=showpageCount&max-results=99999" type="text/javascript"> “ /腳本”

  8. Click on Preview button to ensure that no code error been found.點擊預覽按鈕 ,以確保沒有代碼錯誤被發現。 No effect on the navigation hack can be seen though.不影響航行黑客可以看出了。
  9. Click on Save Template to save the change.點擊保存模板保存更改。

Customization and Modification 定制和修改

  1. For user who is not using blogspot.com domain (using self-hosted domain name), modify the .blogspot.com and 14 (13 characters of domain name + 1) in the line of var isFirstPage = thisUrl.substring(thisUrl.length-14,thisUrl.length)==&quot;.blogspot.com/&quot;; accordingly.對於用戶誰不是使用blogspot.com域(使用自行主辦的網域名稱) , 修改blogspot.com和第14條( 13個字符的域名+ 1 )中的線葉isFirstPage = thisUrl.substring ( thisUrl.length -14 , thisUrl.length )==". blogspot.com / “ ;相應。
  2. The value in the line of var pageCount =5; determines the number of posts to be shown on each page.在價值線的變種pageCount = 5 ;確定的職位數目顯示在每個網頁上。
  3. The value in the line of var displayPageNum = 3; defines the number of page links in the navigation bar to be displayed (eg 1 - 2 - 3).在價值線的變種displayPageNum = 3 ;界定了一些網頁鏈接在導航欄顯示(如1 -2 - 3) 。
  4. User who knows CSS and Java Script can customize the code to their likings.用戶誰知道CSS和Java腳本可以自定義代碼的色彩。

Source 1來源1 and Source 2來源二

IMPORTANT : This is a machine translated page which is provided "as is" without warranty. 重要說明:這是一台機器翻譯網頁這是“原樣”提供,無保修。 Machine translation may be difficult to understand.機器翻譯可能很難理解。 Please refer to請參閱 original English article英文原文的文章 whenever possible.只要有可能。

Share and contribute or get technical support and help at共享和貢獻或獲得技術支持和幫助 My Digital Life Forums 我的數字生活論壇 .



9 Responses to “Add Page Number (with First and Last Page) Navigation Link for Blogger (Blogspot) with Gadget Element and Manual Hack” 9日響應“添加頁碼(同第一頁和最後一頁)導航鏈接的Blogger (博客)與小元和手動砍”

  1. JK
    October 19th, 2008 10:14二零零八年10月19日10:14
    1

    Everything OK.一切都確定。 But while trying this found some problems.但是,在嘗試這一發現了一些問題。 For example, when I click on ‘next’ page, some times it shows the same page, especially after 6th or 7th page.例如,當我點擊'下一步'頁,有時它顯示相同的網頁,特別是在第六或第七頁。 I think it is because of the script used.我想這是因為用於該腳本。 It is not as smooth as wordpress navigation - Jkwebtalks這是不是順利WordPress的導航-J kwebtalks

  2. zigunawan
    October 23rd, 2008 09:43 2008年10月23號09:43
    2

    my blogs is still in classic blogger, could this treat i used to my blog?我的Blog仍然是在經典的博客,可這個治療我用我的博客?

    And how to showing the page number on wordpress, the page number plugin just only support up to 2.5 version.以及如何顯示頁碼的WordPress的,頁碼的插件只是最多只支持到2.5版本。 is there any idea?是否有任何想法? or just waiting for plugin the new version release?或只是在等待插件新版本發布?

    thanks!謝謝!

  3. moonlightafridi
    November 13th, 2008 18:10二〇 〇八年11月13日18:10
    3

    not working …….沒有工作... ... 。
    coz I did the same as u written above .正版遊戲我沒有相同的如u書面以上。
    but no page numbering could be shown .但沒有編號的頁面可以顯示。

  4. moonlightafridi
    November 13th, 2008 18:37二〇 〇八年11月13日18:37
    4

    I’ve done now ………我現在要做... ... ...
    page’s number are shown in my blog網頁的人數列在我的博客
    but How to arrange pages in my blog ?但如何安排的網頁在我的博客?

  5. zigunawan
    November 15th, 2008 02:52 2008年11月一十五號二點五十二分
    5

    not work on my blogspot!沒有工作,我的BlogSpot ! may I wrong place the code?我錯了地方的代碼?

  6. zigunawan
    November 15th, 2008 06:34 2008年11月一十五號6時34分
    6 6日

    it’s work now on my Free cell phone theme它的工作現在我免費手機主題 !
    but sometime, there,s an error like this 但有時,有氏的錯誤這樣
    “No posts match your query.” “任何職位符合您查詢。 ”
    is there any solution! 是否有任何解決方案!

  7. lasse萊斯哈爾斯特
    November 21st, 2008 04:23 08年十一月21日4時23
    7 7日

    This doesnt work at all for me.這doesn't工作,為我所有。 Nothing changes at all.沒有變化的。

  8. Ravi拉維
    November 22nd, 2008 05:49 2008年十一月22日5點49分
    8 8日

    Its not working for me, I copied the code above and I am using the new blogger.它不工作對我來說,我複製以上代碼和我使用新的Blogger 。 Could yoou please help me on this.可以yoou請救救我這一點。

    Ravi拉維

  9. Ravi拉維
    November 23rd, 2008 19:21 2008年11月23日19:21
    9 9日

    It’sa Leora Ka Bal solution.這是一個平衡Leora卡解決方案。

Leave a Reply留下一個回复

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> 您可以使用這些標籤: href="" title="">的<a <abbr title=""> <acronym title="">的<b> <blockquote cite=""> <cite>的<code> “刪除日期時間= “ ” “的<em> <i> <q cite=""> <strike>的<strong>

Subscribe to comments feature has been disabled. 訂閱評論功能已被禁用。 To receive notification of latest comments posted, subscribe to 收到通知的最新評論張貼,訂閱 My Digital Life Comments RSS feed 我國數字化生活的評論RSS種子 or register to receive 接收登記 new comments in daily email digest. 中新評論的電子郵件,每天消化。
Custom Search

New Articles新文章

Incoming Search Terms for the Article收到的搜索字詞的文章

page navigation numbers blogger 網頁瀏覽人數博客 - -