Page Navigation Eklentisi

Page Navigation Menu Widget
Şu adresteki blogda yukarıda gördüğünüz gibi blog yazıları sayfalama widgeti anlatılmış.Yalız birinci sayfadan ikinci sayfaya geçince birden fazla yazı değil bir sonraki yazıyı gösteriyor.
Yapmanız gereken aşağıda verilen kodu kopyalıp sayfa öğesi ekle kısmından HTML/JAVASCRİPT’i şeçip oraya yapıştırmak.Ve widgeti blog yazılarının altına yerleştirmek.Kod:

   1:  <style>
   2:  .showpageArea {padding: 0 2px;margin-top:10px;margin-bottom:10px;
   3:  }
   4:  .showpageArea a {border: 1px solid #505050;
   5:  color: #000000;font-weight:normal;
   6:  padding: 3px 6px !important;
   7:  padding: 1px 4px ;margin:0px 4px;
   8:  text-decoration: none;
   9:  }
  10:  .showpageArea a:hover {
  11:  font-size:11px;
  12:  border: 1px solid #333;
  13:  color: #000000;
  14:  background-color: #FFFFFF;
  15:  }
  16:   
  17:  .showpageNum a {border: 1px solid #505050;
  18:  color: #000000;font-weight:normal;
  19:  padding: 3px 6px !important;
  20:  padding: 1px 4px ;margin:0px 4px;
  21:  text-decoration: none;
  22:   
  23:  }
  24:  .showpageNum a:hover {
  25:  font-size:11px;
  26:  border: 1px solid #333;
  27:  color: #000000;
  28:  background-color: #FFFFFF;
  29:   
  30:  }
  31:  .showpagePoint {font-size:11px;
  32:  padding: 2px 4px 2px 4px;
  33:  margin: 2px;
  34:  font-weight: bold;
  35:  border: 1px solid #333;
  36:  color: #fff;
  37:  background-color: #000000;
  38:   
  39:  }
  40:   
  41:  .showpage a:hover {font-size:11px;
  42:  border: 1px solid #333;
  43:  color: #000000;
  44:  background-color: #FFFFFF;
  45:   
  46:  }
  47:  .showpageNum a:link,.showpage a:link {
  48:  font-size:11px;
  49:  padding: 2px 4px 2px 4px;
  50:  margin: 2px;
  51:  text-decoration: none;
  52:  border: 1px solid #0066cc;
  53:  color: #0066cc;
  54:  background-color: #FFFFFF;}
  55:   
  56:  .showpageNum a:hover {font-size:11px;
  57:  border: 1px solid #333;
  58:  color: #000000;
  59:  background-color: #FFFFFF;
  60:  }
  61:  </style>
  62:   
  63:  <script type=”text/javascript>
  64:   
  65:  function showpageCount(json) {
  66:  var thisUrl = location.href;
  67:  var htmlMap = new Array();
  68:  var isFirstPage = thisUrl.substring(thisUrl.length-14,thisUrl.length)==”.blogspot.com/”;
  69:  var isLablePage = thisUrl.indexOf(”/search/label/”)!=-1;
  70:  var isPage = thisUrl.indexOf(”/search?updated”)!=-1;
  71:  var thisLable = isLablePage ? thisUrl.substr(thisUrl.indexOf(”/search/label/”)+14,thisUrl.length) : “”;
  72:  thisLable = thisLable.indexOf(”?”)!=-1 ? thisLable.substr(0,thisLable.indexOf(”?”)) : thisLable;
  73:  var thisNum = 1;
  74:  var postNum=1;
  75:  var itemCount = 0;
  76:  var fFlag = 0;
  77:  var eFlag = 0;
  78:  var html= ”;
  79:  var upPageHtml =”;
  80:  var downPageHtml =”;
  81:   
  82:  var pageCount=5;
  83:  var displayPageNum=3;
  84:  var firstPageWord = ‘First’;
  85:  var endPageWord = ‘Last’;
  86:  var upPageWord =’Previous’;
  87:  var downPageWord =’Next’;
  88:   
  89:  var labelHtml = ‘<span class=”showpageNum”>’;
  90:   
  91:  for(var i=0, post; post = json.feed.entry[i]; i++) {
  92:  var timestamp = post.published.$t.substr(0,10);
  93:  var title = post.title.$t;
  94:  if(isLablePage){
  95:  if(title!=”){
  96:  if(post.category){
  97:  for(var c=0, post_category; post_category = post.category[c]; c++) {
  98:  if(encodeURIComponent(post_category.term)==thisLable){
  99:  if(itemCount==0 (itemCount % pageCount ==(pageCount-1))){
 100:  if(thisUrl.indexOf(timestamp)!=-1 ){
 101:  thisNum = postNum;
 102:  }
 103:   
 104:  postNum++;
 105:  htmlMap[htmlMap.length] = ‘/search/label/’+thisLable+’?updated-max=’+timestamp+’T00%3A00%3A00%2B08%3A00&max-results=’+pageCount;
 106:  }
 107:  }
 108:  }
 109:  }//end if(post.category){
 110:   
 111:  itemCount++;
 112:  }
 113:   
 114:  }else{
 115:  if(title!=”){
 116:  if(itemCount==0 (itemCount % pageCount ==(pageCount-1))){
 117:  if(thisUrl.indexOf(timestamp)!=-1 ){
 118:  thisNum = postNum;
 119:  }
 120:   
 121:  if(title!=”) postNum++;
 122:  htmlMap[htmlMap.length] = ‘/search?updated-max=’+timestamp+’T00%3A00%3A00%2B08%3A00&max-results=’+pageCount;
 123:  }
 124:  }
 125:  itemCount++;
 126:  }
 127:  }
 128:   
 129:  for(var p =0;p< htmlMap.length;p++){
 130:  if(p>=(thisNum-displayPageNum-1) && p<(thisNum+displayPageNum)){
 131:  if(fFlag ==0 && p == thisNum-2){
 132:  if(thisNum==2){
 133:  if(isLablePage){
 134:  upPageHtml = labelHtml + upPageWord +’’;
 135:  }else{
 136:  upPageHtml = ‘<span class=”showpage”>’+ upPageWord +’’;
 137:  }
 138:  }else{
 139:  upPageHtml = ‘<span class=”showpage”>’+ upPageWord +’’;
 140:  }
 141:   
 142:  fFlag++;
 143:  }
 144:   
 145:  if(p==(thisNum-1)){
 146:  html += ‘ <span class=”showpagePoint”>’+thisNum+’’;
 147:  }else{
 148:  if(p==0){
 149:  if(isLablePage){
 150:  html = labelHtml+’1’;
 151:  }else{
 152:  html += ‘<span class=”showpageNum”>1’;
 153:  }
 154:  }else{
 155:  html += ‘<span class=”showpageNum”>’+ (p+1) +’ ’;
 156:  }
 157:  }
 158:   
 159:  if(eFlag ==0 && p == thisNum){
 160:  downPageHtml = ‘<span class=”showpage”> ’+ downPageWord +’’;
 161:  eFlag++;
 162:  }
 163:  }//end if(p>=(thisNum-displayPageNum-1) && p<(thisNum+displayPageNum)){
 164:  }//end for(var p =0;p< htmlMap.length;p++){
 165:   
 166:  if(thisNum>1){
 167:  if(!isLablePage){
 168:  html = ‘<span class=”showpage”>’+ firstPageWord +’ ’+upPageHtml+’ ‘+html +’ ‘;
 169:  }else{
 170:  html = ”+labelHtml + firstPageWord +’ ’+upPageHtml+’ ‘+html +’ ‘;
 171:  }
 172:  }
 173:   
 174:  html = ‘<div class=”showpageArea”><span style=”padding: 2px 4px 2px 4px;margin: 2px 2px 2px 2px;color: #000000;border: 1px solid #333; background-” class=”showpage”>Page ‘+thisNum+’ of ‘+(postNum-1)+’: ’+html;
 175:   
 176:  if(thisNum<(postNum-1)){
 177:  html += downPageHtml;
 178:  html += ‘<span class=”showpage”> ‘+endPageWord+’’;
 179:  }
 180:   
 181:  if(postNum==1) postNum++;
 182:  html += ‘
’;
 183:   
 184:  if(isPage isFirstPage isLablePage){
 185:  var pageArea = document.getElementsByName(”pageArea”);
 186:  var blogPager = document.getElementById(”blog-pager”);
 187:   
 188:  if(postNum <= 2){
 189:  html =”;
 190:  }
 191:   
 192:  for(var p =0;p< pageArea.length;p++){
 193:  pageArea[p].innerHTML = html;
 194:  }
 195:   
 196:  if(pageArea&&pageArea.length>0){
 197:  html =”;
 198:  }
 199:   
 200:  if(blogPager){
 201:  blogPager.innerHTML = html;
 202:  }
 203:  }
 204:   
 205:  }
 206:  </script>
 207:   
 208:  <script src=”/feeds/posts/summary?alt=jso
 209:  n-in-script&callback=showpageCount&max-results=99999″ type=
”text/javascript”></script>
 210:  <div style=”text-align:right;font-size:10px;color:000000;mar
gin-top:15px;display:none;”> <a href=”http://www.techieblogger.com/
2008/07/page-navigation-hack-for-blogger.html>
 211:  Grab this Widget ~ Blogger Accessories
 212:  </a></div>

.csharpcode, .csharpcode pre{font-size: small;color: black;font-family: consolas, “Courier New”, courier, monospace;background-color: #ffffff;/*white-space: pre;*/}.csharpcode pre { margin: 0em; }.csharpcode .rem { color: #008000; }.csharpcode .kwrd { color: #0000ff; }.csharpcode .str { color: #006080; }.csharpcode .op { color: #0000c0; }.csharpcode .preproc { color: #cc6633; }.csharpcode .asp { background-color: #ffff00; }.csharpcode .html { color: #800000; }.csharpcode .attr { color: #ff0000; }.csharpcode .alt {background-color: #f4f4f4;width: 100%;margin: 0em;}.csharpcode .lnum { color: #606060; }

Reklamlar

About Lacivert

HuniliBlog.Com'un tek yazarıyım. Bana hep deli derler ama ben kimseye deli demedim. Sitemi ziyaret ederseniz hakkımda daha çok şey öğrenebilirsiniz
Bu yazı Paylaşmak İstediklerim içinde yayınlandı. Kalıcı bağlantıyı yer imlerinize ekleyin.