Code hiển thị trang label khi, đây là bộ code chuẩn dành riêng cho dân thiết kế Template Blogspot chuyên nghiệp.
<div class='thanhdieuhuong'> <div class='breadcrumbs'> <a expr:href='data:blog.homepageUrl'>Trang chủ</a> <a expr:href='data:blog.pageName.url'><data:blog.pageName/></a> </div> </div> <div class='labelthaiaiti'> <script type='text/javascript'> homepageurl="https://www.zubi.cloud/"; sumpost = 50; numposts = 10; sumtitlep = 43; </script> <script type='text/javascript'> //<![CDATA[ String.prototype.GetValue = function (h) { h = RegExp("(^|&)" + h + "=([^&]*)(&|$)"); h = this.substr(this.indexOf("?") + 1) .match(h); return null != h ? unescape(h[2]) : null }; var str = location.href, page = str.GetValue("page"), view = str.GetValue("v"), urllength = homepageurl.length; void 0 == page && (page = "1"); void 0 == view && (view = "full"); if (-1 != str.indexOf("search/label")) { if (-1 != str.indexOf("?")) var str1 = str.split("?")[0], label = str1.substring(urllength + 13, str1.length); else label = str.substring(urllength + 13, str.length); var textlabel = "/-/" + label, textpage = "" + label } else textpage = textlabel = ""; function stripHtmlTags(h, k) { h = h.replace(/<br.*?>/ig, " "); return h.replace(/<.*?>/ig, "") .split(/\s+/) .slice(0, k - 1) .join(" ") } function showrecentposts(h) { img = []; for (var k = 0; k < numposts; k++) { var g = h.feed.entry[k], f = g.title.$t, l; if (k == h.feed.entry.length) break; for (var e = 0; e < g.link.length; e++) if ("alternate" == g.link[e].rel) { l = g.link[e].href; break } for (e = 0; e < g.link.length; e++) if ("replies" == g.link[e].rel && "text/html" == g.link[e].type) { g.link[e].title.split(" "); break } if (g.category) for (e = 0; e < g.category.length; e++); var e = g.published.$t, m = e.split("-")[2].substring(0, 2), n = e.split("-")[1], e = e.split("-")[0]; postDay = m + "/" + n +"/" +e; s = g = "content" in g ? g.content.$t : "summary" in g ? g.summary.$t : ""; giaban = s.substring(s.indexOf("[giaban]") + 8, s.indexOf("[/giaban]")); giacu = s.substring(s.indexOf("[giacu]") + 7, s.indexOf("[/giacu]")); tintuc = s.substring(s.indexOf("[tintuc]") + 8, s.indexOf("[/tintuc]")); a = s.indexOf("<img"); b = s.indexOf('src="', a); c = s.indexOf('"', b + 5); d = s.substr(b + 5, c - b - 5); img[k] = -1 != a && -1 != b && -1 != c && "" != d ? d : "https://lh3.googleusercontent.com/-RCsfTYCQ9lI/XG6MTo9f5vI/AAAAAAAACYw/ZRLye16EGXkJ4sSBEjb-ZJdjWOkt8mrjwCLcBGAs/s0/no-image-slide.png"; f = -1 != s.indexOf("[giaban]") ? '<li class="sp"><h3><a href="' + l + '" title="'+f+'">'+f+'</a></h3><span class="price-h">'+giacu+'</span><span class="price">'+giaban+'</span><span class="dv">đ</span><a href="' + l + '" title="'+f+'"><img src="' + img[k] + '" alt="'+f+'" title="'+f+'"/></a></li>' : '<div class="home-navi"><div class="labelimg"><a href="' + l + '" title="' + f + '"><span class="xemthemthaiaitiplay"></span><img src="' + img[k] + '" class="img-responsive wp-post-image" alt="' + f + '"></a></div><div class="col-sm-8"><h2 class="entry-title" itemprop="headline"><a href="' + l + '">' + f + '</a></h2><p class="entry-summary entry-content hidden-xs">'+stripHtmlTags(s,40)+'...</p></div></div>'; document.write(f) } document.write('<div class="clear"></div>') } function numberOfPosts(h) { document.write('<script style="text/javascript">var totalPosts= ' + h.feed.openSearch$totalResults.$t + " ;<\/script>") } document.write('<script src="/feeds/posts/default' + textlabel + '?alt=json-in-script&callback=numberOfPosts"><\/script>'); //]]></script> <script type='text/javascript'>/* <![CDATA[ */ if (-1 != str.indexOf("archive.html")) document.write(""); else { var rcpage = [], numpage = totalPosts / numposts, lastnum = totalPosts % numposts; 0 == lastnum && (numpage += 1); for (var m = 1; m < numpage; m++) { var start = numposts * (m - 1) + 1; rcpage[m] = '<script src="/feeds/posts/default' + textlabel + "?start-index=" + start + "&max-results=" + numposts + '&orderby=published&alt=json-in-script&callback=showrecentposts"><\/script>' } if (page > numpage && page < numpage + 1 && 0 < lastnum) { var numposts = lastnum, start = totalPosts - lastnum + 1; document.write('<script src="/feeds/posts/default' + textlabel + "?start-index=" + start + "&max-results=" + numposts + '&orderby=published&alt=json-in-script&callback=showrecentposts"><\/script>') } else page > numpage || page > numpage - 1 && 0 == lastnum ? document.write("") : document.write(rcpage[page]) }; </script> <script type='text/javascript'> var pagelist = 0 == lastnum ? totalPosts / numposts : numpage + 1, pagelist1 = parseInt(pagelist), npage = parseFloat(page); if (page <= parseInt(pagelist)) { if (2 <= pagelist && 6 > pagelist1) { document.write("<div id=\"page-rc-tooltip\">"); for (var n = 1; n < pagelist1 + 1; n++) { var navpage = n == npage ? ' <span class="currentpage" >' + n + "</span>" : ' <a class=\"pagelink\" href="?v=' + view + "&page=" + n + '">' + n + "</a>"; document.write(navpage) } document.write("</div>") } if (6 <= pagelist && 4 > page) { document.write('<div id="page-rc-tooltip">Page (' + page + "/" + parseInt(pagelist) + ") : "); for (n = 1; 6 > n; n++) navpage = n == npage ? ' <span class="currentpage" >' + n + "</span>" : ' <a class=\"pagelink\" href="?v=' + view + "&page=" + n + '">' + n + "</a>", document.write(navpage); 5 < parseInt(pagelist) ? document.write(' ... <a class=\"pagelink\" href="?v=' + view + "&page=" + parseInt(pagelist) + '">Last</a></div>') : document.write("</div>") } else if (6 <= pagelist && 3 < page && page < parseInt(pagelist) - 2) { var first = page - 2, last = first + 5; document.write('<div id="page-rc-tooltip">Page (' + page + "/" + parseInt(pagelist) + ') : <a class=\"pagelink\" href="?v=' + view + '&page=1">First</a> ...'); for (n = first; n < last; n++) navpage = n == npage ? ' <span class="currentpage" >' + n + "</span>" : ' <a class=\"pagelink\" href="?v=' + view + "&page=" + n + '">' + n + "</a>", document.write(navpage); document.write(' ... <a class=\"pagelink\" href="?v=' + view + "&page=" + parseInt(pagelist) + '">Last</a></div>') } else if (6 <= pagelist && 3 < page && page > parseInt(pagelist) - 3) { first = parseInt(pagelist) - 4; last = parseInt(pagelist) + 1; document.write('<div id="page-rc-tooltip">Page (' + page + "/" + parseInt(pagelist) + ') : <a class=\"pagelink\" href="?v=' + view + '&page=1">First</a> ...'); for (n = first; n < last; n++) navpage = n == npage ? ' <span class="currentpage" >' + n + "</span>" : ' <a class=\"pagelink\" href="?v=' + view + "&page=" + n + '">' + n + "</a>", document.write(navpage); document.write("</div>") } }; /* ]]> */ </script> </div>