数字导航 Blogger 标签和搜索未显示
Numeric Navigation Blogger Label and Search Not Showing
我添加了数字导航,它在主页上工作正常,但在搜索/标签和网络搜索上不起作用。
-
这是搜索标签和数字导航不起作用的结果:
https://codeselecteds.blogspot.com/search/label/Python
-
这是下一个prev中包含的代码post :
<b:includable id='nextprev'>
<div class='blog-pager' id='blog-pager'/>
</b:includable>
这是代码 js nextprev :
<script type='text/javascript'> /*<![CDATA[*/
var postperpage=1;
var numshowpage=2;
var upPageWord ='Next';
var downPageWord ='Prev';
var urlactivepage=location.href;
var home_page="/";
/*]]>*/ </script>
<script type='text/javascript'> /*<![CDATA[*/
var nopage;
var jenis;
var nomerhal;
var lblname1;
halamanblogger();
function loophalaman(banyakdata)
{
var html='';
nomerkiri=parseInt(numshowpage/2);
if(nomerkiri==numshowpage-nomerkiri)
{
numshowpage=nomerkiri*2+1
}
mulai=nomerhal-nomerkiri;
if(mulai<1)mulai=1;maksimal=parseInt(banyakdata/postperpage)+1;
if(maksimal-1==banyakdata/postperpage)
maksimal=maksimal-1;
akhir=mulai+numshowpage-1;
if(akhir>maksimal)
akhir=maksimal;
html+="<span class='showpageOf'><a>"+nomerhal+'/'+maksimal+"</a></span>";
var prevnomer=parseInt(nomerhal)-1;
if(nomerhal>1)
{
if(nomerhal==2)
{
if(jenis=="page")
{
html+='<span class="showpage"><a href="'+home_page+'">'+upPageWord+'</a></span>'
}
}
else
{
if(jenis=="page")
{
html+='<span class="showpage"><a href="#" onclick="redirectpage('+prevnomer+');return false">'+upPageWord+'</a></span>'
}
else
{
html+='<span class="showpage"><a href="#" onclick="redirectlabel('+prevnomer+');return false">'+upPageWord+'</a></span>'
}
}
}
if(mulai>1){if(jenis=="page")
{
html+='<span class="showpageNum"><a href="'+home_page+'">1</a></span>'
}
}
if(mulai>2)
{
html+='<span class="showpage"> ... </span>'
}
for(var jj=mulai;jj<=akhir;jj++)
{
if(nomerhal==jj)
{
html+='<span class="showpagePoint"><a>'+jj+'</a></span>'
}
else if(jj==1)
{
if(jenis=="page")
{
html+='<span class="showpageNum"><a href="'+home_page+'">1</a></span>'
}
}
else
{
if(jenis=="page")
{
html+='<span class="showpageNum"><a href="#" onclick="redirectpage('+jj+');return false">'+jj+'</a></span>'
}
else
{
html+='<span class="showpageNum"><a href="#" onclick="redirectlabel('+jj+');return false">'+jj+'</a></span>'
}
}
}
if(akhir<maksimal-1)
{
html+='<span class="showpage"> ... </span>'
}
if(akhir<maksimal)
{
if(jenis=="page")
{
html+='<span class="showpageNum"><a href="#" onclick="redirectpage('+maksimal+');return false">'+maksimal+'</a></span>'
}
else
{
html+='<span class="showpageNum"><a href="#" onclick="redirectlabel('+maksimal+');return false">'+maksimal+'</a></span>'
}
}
var nextnomer=parseInt(nomerhal)+1;
if(nomerhal<maksimal)
{
if(jenis=="page")
{
html+='<span class="showpage"><a href="#" onclick="redirectpage('+nextnomer+');return false">'+downPageWord+'</a></span>'
}
else
{
html+='<span class="showpage"><a href="#" onclick="redirectlabel('+nextnomer+');return false">'+downPageWord+'</a></span>'
}
}
var pageArea=document.getElementsByName("pageArea");
var blogPager=document.getElementById("blog-pager");
for(var p=0;p<pageArea.length;p++)
{
pageArea[p].innerHTML=html
}
if(pageArea&&pageArea.length>0)
{
html=''
}
if(blogPager)
{
blogPager.innerHTML=html
}
}
function hitungtotaldata(root)
{
var feed=root.feed;
var totaldata=parseInt(feed.openSearch$totalResults.$t,10);
loophalaman(totaldata)
}
function halamanblogger()
{
var thisUrl=urlactivepage;
if(thisUrl.indexOf(".html") == -1)
{
if(thisUrl.indexOf("/search/label/")==-1)
{
jenis="page";
if(urlactivepage.indexOf("#PageNo=")!=-1)
{
nomerhal=urlactivepage.substring(urlactivepage.indexOf("#PageNo=")+8,urlactivepage.length)
}
else
{
nomerhal=1
}
if(thisUrl.indexOf("q=") == -1){
document.write("<script src=\""+home_page+"feeds/posts/summary?max-results=1&alt=json-in-script&callback=hitungtotaldata\"><\/script>")
}
else
{
document.write("<script src=\"" + home_page + "feeds/posts/summary?q=" + thisUrl.split("?")[1].split("q=")[1].split("&")[0] + "&alt=json-in-script&callback=totalcountdata\"><\/script>")
}
}
else
{
jenis="label";
if(thisUrl.indexOf("&max-results=")==-1)
{
postperpage=20
}
if(urlactivepage.indexOf("#PageNo=")!=-1)
{
nomerhal=urlactivepage.substring(urlactivepage.indexOf("#PageNo=")+8,urlactivepage.length)
}
else
{
nomerhal=1
}
}
}
}
function redirectpage(numberpage)
{
jsonstart=(numberpage-1)*postperpage;nopage=numberpage;
var nBody=document.getElementsByTagName('head')[0];
var newInclude=document.createElement('script');
newInclude.type='text/javascript';
newInclude.setAttribute("src",home_page+"feeds/posts/summary?start-index="+jsonstart+"&max-results=1&alt=json-in-script&callback=finddatepost");
nBody.appendChild(newInclude)
}
function redirectlabel(numberpage)
{
jsonstart=(numberpage-1)*postperpage;nopage=numberpage;
var nBody=document.getElementsByTagName('head')[0];
var newInclude=document.createElement('script');
newInclude.type='text/javascript';
nBody.appendChild(newInclude)
}
function finddatepost(root)
{
post=root.feed.entry[0];
var timestamp1=post.published.$t.substring(0,19)+post.published.$t.substring(23,29);
var timestamp=encodeURIComponent(timestamp1);
if(jenis=="page")
{
if(urlactivepage.indexOf("?q=") == -1){
var alamat="/search?updated-max="+timestamp+"&max-results="+postperpage+"#PageNo="+nopage
}else {
var pAddress = "/search?updated-max=" + timestamp + "&q="+ urlactivepage.split("?")[1].split("q=")[1].split("&")[0] +"&max-results=" + perPage + "#PageNo=" + noPage
}
}
location.href=alamat
}
/*]]>*/ </script>
可以使用这个:
<div class="nav-nextrep" id="nav-nextrep">
<div style="display: none;">
<span class="showpageOf"><a>1/6</a></span>
</div>
<span class="showpagePoint"><a>1</a></span>
<span class="showpageNum">
<a href="#" onclick="redirectpage(2);return false">2</a>
</span>
<span class="showpageNum">
<a href="#" onclick="redirectpage(3);return false">3</a>
</span>
<span class="showpage">-</span>
<span class="showpageNum"><a href="#" onclick="redirectpage(6);return false">6</a></span>
<span class="showpage"><a href="#" onclick="redirectpage(2);return false">></a></span>
</div>
我添加了数字导航,它在主页上工作正常,但在搜索/标签和网络搜索上不起作用。
这是搜索标签和数字导航不起作用的结果: https://codeselecteds.blogspot.com/search/label/Python
这是下一个prev中包含的代码post :
<b:includable id='nextprev'>
<div class='blog-pager' id='blog-pager'/>
</b:includable>
这是代码 js nextprev :
<script type='text/javascript'> /*<![CDATA[*/
var postperpage=1;
var numshowpage=2;
var upPageWord ='Next';
var downPageWord ='Prev';
var urlactivepage=location.href;
var home_page="/";
/*]]>*/ </script>
<script type='text/javascript'> /*<![CDATA[*/
var nopage;
var jenis;
var nomerhal;
var lblname1;
halamanblogger();
function loophalaman(banyakdata)
{
var html='';
nomerkiri=parseInt(numshowpage/2);
if(nomerkiri==numshowpage-nomerkiri)
{
numshowpage=nomerkiri*2+1
}
mulai=nomerhal-nomerkiri;
if(mulai<1)mulai=1;maksimal=parseInt(banyakdata/postperpage)+1;
if(maksimal-1==banyakdata/postperpage)
maksimal=maksimal-1;
akhir=mulai+numshowpage-1;
if(akhir>maksimal)
akhir=maksimal;
html+="<span class='showpageOf'><a>"+nomerhal+'/'+maksimal+"</a></span>";
var prevnomer=parseInt(nomerhal)-1;
if(nomerhal>1)
{
if(nomerhal==2)
{
if(jenis=="page")
{
html+='<span class="showpage"><a href="'+home_page+'">'+upPageWord+'</a></span>'
}
}
else
{
if(jenis=="page")
{
html+='<span class="showpage"><a href="#" onclick="redirectpage('+prevnomer+');return false">'+upPageWord+'</a></span>'
}
else
{
html+='<span class="showpage"><a href="#" onclick="redirectlabel('+prevnomer+');return false">'+upPageWord+'</a></span>'
}
}
}
if(mulai>1){if(jenis=="page")
{
html+='<span class="showpageNum"><a href="'+home_page+'">1</a></span>'
}
}
if(mulai>2)
{
html+='<span class="showpage"> ... </span>'
}
for(var jj=mulai;jj<=akhir;jj++)
{
if(nomerhal==jj)
{
html+='<span class="showpagePoint"><a>'+jj+'</a></span>'
}
else if(jj==1)
{
if(jenis=="page")
{
html+='<span class="showpageNum"><a href="'+home_page+'">1</a></span>'
}
}
else
{
if(jenis=="page")
{
html+='<span class="showpageNum"><a href="#" onclick="redirectpage('+jj+');return false">'+jj+'</a></span>'
}
else
{
html+='<span class="showpageNum"><a href="#" onclick="redirectlabel('+jj+');return false">'+jj+'</a></span>'
}
}
}
if(akhir<maksimal-1)
{
html+='<span class="showpage"> ... </span>'
}
if(akhir<maksimal)
{
if(jenis=="page")
{
html+='<span class="showpageNum"><a href="#" onclick="redirectpage('+maksimal+');return false">'+maksimal+'</a></span>'
}
else
{
html+='<span class="showpageNum"><a href="#" onclick="redirectlabel('+maksimal+');return false">'+maksimal+'</a></span>'
}
}
var nextnomer=parseInt(nomerhal)+1;
if(nomerhal<maksimal)
{
if(jenis=="page")
{
html+='<span class="showpage"><a href="#" onclick="redirectpage('+nextnomer+');return false">'+downPageWord+'</a></span>'
}
else
{
html+='<span class="showpage"><a href="#" onclick="redirectlabel('+nextnomer+');return false">'+downPageWord+'</a></span>'
}
}
var pageArea=document.getElementsByName("pageArea");
var blogPager=document.getElementById("blog-pager");
for(var p=0;p<pageArea.length;p++)
{
pageArea[p].innerHTML=html
}
if(pageArea&&pageArea.length>0)
{
html=''
}
if(blogPager)
{
blogPager.innerHTML=html
}
}
function hitungtotaldata(root)
{
var feed=root.feed;
var totaldata=parseInt(feed.openSearch$totalResults.$t,10);
loophalaman(totaldata)
}
function halamanblogger()
{
var thisUrl=urlactivepage;
if(thisUrl.indexOf(".html") == -1)
{
if(thisUrl.indexOf("/search/label/")==-1)
{
jenis="page";
if(urlactivepage.indexOf("#PageNo=")!=-1)
{
nomerhal=urlactivepage.substring(urlactivepage.indexOf("#PageNo=")+8,urlactivepage.length)
}
else
{
nomerhal=1
}
if(thisUrl.indexOf("q=") == -1){
document.write("<script src=\""+home_page+"feeds/posts/summary?max-results=1&alt=json-in-script&callback=hitungtotaldata\"><\/script>")
}
else
{
document.write("<script src=\"" + home_page + "feeds/posts/summary?q=" + thisUrl.split("?")[1].split("q=")[1].split("&")[0] + "&alt=json-in-script&callback=totalcountdata\"><\/script>")
}
}
else
{
jenis="label";
if(thisUrl.indexOf("&max-results=")==-1)
{
postperpage=20
}
if(urlactivepage.indexOf("#PageNo=")!=-1)
{
nomerhal=urlactivepage.substring(urlactivepage.indexOf("#PageNo=")+8,urlactivepage.length)
}
else
{
nomerhal=1
}
}
}
}
function redirectpage(numberpage)
{
jsonstart=(numberpage-1)*postperpage;nopage=numberpage;
var nBody=document.getElementsByTagName('head')[0];
var newInclude=document.createElement('script');
newInclude.type='text/javascript';
newInclude.setAttribute("src",home_page+"feeds/posts/summary?start-index="+jsonstart+"&max-results=1&alt=json-in-script&callback=finddatepost");
nBody.appendChild(newInclude)
}
function redirectlabel(numberpage)
{
jsonstart=(numberpage-1)*postperpage;nopage=numberpage;
var nBody=document.getElementsByTagName('head')[0];
var newInclude=document.createElement('script');
newInclude.type='text/javascript';
nBody.appendChild(newInclude)
}
function finddatepost(root)
{
post=root.feed.entry[0];
var timestamp1=post.published.$t.substring(0,19)+post.published.$t.substring(23,29);
var timestamp=encodeURIComponent(timestamp1);
if(jenis=="page")
{
if(urlactivepage.indexOf("?q=") == -1){
var alamat="/search?updated-max="+timestamp+"&max-results="+postperpage+"#PageNo="+nopage
}else {
var pAddress = "/search?updated-max=" + timestamp + "&q="+ urlactivepage.split("?")[1].split("q=")[1].split("&")[0] +"&max-results=" + perPage + "#PageNo=" + noPage
}
}
location.href=alamat
}
/*]]>*/ </script>
可以使用这个:
<div class="nav-nextrep" id="nav-nextrep">
<div style="display: none;">
<span class="showpageOf"><a>1/6</a></span>
</div>
<span class="showpagePoint"><a>1</a></span>
<span class="showpageNum">
<a href="#" onclick="redirectpage(2);return false">2</a>
</span>
<span class="showpageNum">
<a href="#" onclick="redirectpage(3);return false">3</a>
</span>
<span class="showpage">-</span>
<span class="showpageNum"><a href="#" onclick="redirectpage(6);return false">6</a></span>
<span class="showpage"><a href="#" onclick="redirectpage(2);return false">></a></span>
</div>