کد صفحه بندی اتوماتیک وبلاگ
<style>
#navbar {font-family:Arial; font-size: 12pt;text-align:center;padding: 4px; margin: 4px 0; direction:rtl;line-height: 200%}
#navbar A:{font-family:Arial;font-size: 12pt; font-weight: bold; color: white; text-decoration: none; border: 1px solid #C0C0C0; background-color: #0000B0;padding:2px 4px 2px 4px;}
#navbar A:link{font-family:Arial;font-size: 12pt; font-weight: bold; color: #000080; text-decoration: none; border: 1px solid #C0C0C0; background-color: white;padding:2px 4px 2px 4px;}
#navbar A:visited{font-family:Arial;font-size: 12pt; font-weight: bold; color: #800000; text-decoration: none; border: 1px solid #C0C0C0; background-color: white;padding:2px 4px 2px 4px;}
#navbar A:hover{font-family:Arial;font-size: 12pt; font-weight: bold; color: white; text-decoration: none; border: 1px solid #C0C0C0; background-color: #0000B0;padding:2px 4px 2px 4px;}
#navbar A:active{font-family:Arial;font-size: 12pt; font-weight: bold; color: red; text-decoration: none; border: 1px solid #C0C0C0; background-color: #0000B0;padding:2px 4px 2px 4px;}
#navbar span{font-family:Arial;font-size: 12pt; font-weight: bold; color: gray; text-decoration: none; border: 1px solid #C0C0C0;background-color: #F5F5F5;padding:2px 4px 2px 4px;}
#pages{border: 2px solid #FF0099;width:94%;border-radius: 15px;-moz-border-radius: 15px;-webkit-border-radius: 15px;}
#pages:hover{background:url('http://nabtarinha.fagig.com/tools/rgba/rgba.php/rgba(255,240,250,1)');background:rgba(255,240,250,1);cursor:default}
#pages span2{font-family:Arial;font-size: 12pt; font-weight: bold; color: blue}
#pages:hover span2{color:black}
</style>
<BlogNextAndPreviousBlock>
<div id="navbar" style="width:98%;">
<fieldset id=pages>
<span2> صفحه : </span2>
<BlogNextPageBlock>
<a href="<-BlogNextPageLink->">بعدی</a>
</BlogNextPageBlock>
<span3 id="pagenumber"></span3>
<script>
var Posteachpage=10;
var lost_post=BlogComments[0];
var p_max=Math.ceil(lost_post/Posteachpage);
var urlAdress=window.location.pathname;
var urlhref=window.location.href;
document.getElementById("pagenumber").innerHTML="";
if (urlAdress=="/")
{
for (pagenum=p_max;pagenum>=1;pagenum--) // Finding samepage_contour
{
if (pagenum>1)
{
var samepage="<-BlogUrl->"+urlAdress+"?p="+pagenum;
} else
{
var samepage="<-BlogUrl->"+urlAdress;
var samepage1="<-BlogUrl->"+urlAdress+"?p=1";
}
if (urlhref==samepage || (urlhref==samepage1 && pagenum==1))
{
var samepage_contour=pagenum;
}
}
for (pagenum=p_max;pagenum>=1;pagenum--)
{
if (pagenum>1)
{
var samepage="<-BlogUrl->"+urlAdress+"?p="+pagenum;
} else
{
var samepage="<-BlogUrl->"+urlAdress;
var samepage1="<-BlogUrl->"+urlAdress+"?p=1";
}
if (urlhref==samepage || (urlhref==samepage1 && pagenum==1))
{
document.getElementById("pagenumber").innerHTML += "<span><font color=red>"+pagenum+"</font></span> ";
} else
{
if (pagenum==p_max)
{
document.getElementById("pagenumber").innerHTML += docwrite(pagenum);
} else if (samepage_contour>=p_max-3 && pagenum >=p_max-6)
{
document.getElementById("pagenumber").innerHTML += docwrite(pagenum);
} else if (pagenum==samepage_contour+4 && pagenum!=1)
{
document.getElementById("pagenumber").innerHTML += "<span> ... </span> ";
} else if (pagenum<=samepage_contour+3 && pagenum>=samepage_contour-3)
{
document.getElementById("pagenumber").innerHTML += docwrite(pagenum);
} else if (samepage_contour+3<=p_max && pagenum==samepage_contour-4 && pagenum!=1)
{
document.getElementById("pagenumber").innerHTML += "<span> ... </span> ";
} else if (samepage_contour+2==p_max && pagenum==samepage_contour-5 && pagenum!=1)
{
document.getElementById("pagenumber").innerHTML += "<span> ... </span> ";
} else if (samepage_contour+1==p_max && pagenum==samepage_contour-6 && pagenum!=1)
{
document.getElementById("pagenumber").innerHTML += "<span> ... </span> ";
} else if (samepage_contour==p_max && pagenum==samepage_contour-7 && pagenum!=1)
{
document.getElementById("pagenumber").innerHTML += "<span> ... </span> ";
} else if (samepage_contour<=3 && pagenum <6)
{
document.getElementById("pagenumber").innerHTML += docwrite(pagenum);
} else if (pagenum==1)
{
document.getElementById("pagenumber").innerHTML += docwrite(pagenum);
}
}
}
}
function docwrite(pagenum) {
if (urlAdress=="")
{
resualt="<a href='/?p="+pagenum+"'>"+pagenum+"</a> ";
} else
{
resualt="<a href='"+urlAdress+"?p="+pagenum+"'>"+pagenum+"</a> ";
}
return resualt;
}
</script>
<BlogPreviousPageBlock>
<a href="<-BlogPreviousPageLink->">قبلی</a>
</BlogPreviousPageBlock>
</fieldset>
</div>
<center><a href="vaghfname.blogfa.com/" style="text-decoration:none; font-size:10px;">کد صفحه بندی اتوماتیک بلاگفا توسط ناب ترین ها</a>
</BlogNextAndPreviousBlock>
</div>
<br><br><br>
</div>
</BlogNextAndPreviousBlock>
</div>
</td>
<td width="312" valign="top">