New pagination style and url_friendly on pagination

master
pecesama 2007-04-05 23:03:40 +00:00
parent eadfd21d97
commit 4b0fc4bf0d
2 changed files with 39 additions and 25 deletions

View File

@ -26,7 +26,19 @@
$id_post = $_GET["post"];
} else {
if (isset($param_url[1]) && $param_url[1]=="post") {
$id_post = (isset($param_url[2])) ? ((is_numeric($param_url[2])) ? $param_url[2] : null) : null;
$id_post = (isset($param_url[2])) ? ((is_numeric($param_url[2])) ? $param_url[2] : NULL) : NULL;
} else {
$id_post = NULL;
}
}
if (isset($_GET["page"])) {
$page_num = $_GET["page"];
} else {
if (isset($param_url[1]) && $param_url[1]=="page") {
$page_num = (isset($param_url[2])) ? ((is_numeric($param_url[2])) ? $param_url[2] : NULL) : NULL;
} else {
$page_num = NULL;
}
}
@ -40,8 +52,8 @@
$limit=$conf->postLimit;
if(isset($_GET['page']) && is_numeric($_GET['page']) && $_GET['page']>0) { // Is defined the page and is numeric?
$from = (($_GET['page']-1) * $limit);
if(isset($page_num) && is_numeric($page_num) && $page_num>0) { // Is defined the page and is numeric?
$from = (($page_num-1) * $limit);
} else {
$from = 0;
}
@ -105,7 +117,8 @@
}
}
echo pagination($tumble->getPostsNumber(), $limit, isset($_GET['page']) ? $_GET['page'] : 1, "index.php", 2); // Shows the pagination
echo pagination($tumble->getPostsNumber(), $limit, isset($page_num) ? $page_num : 1, array($conf->urlGelato."/index.php/page/[...]/","[...]"), 2);
} else {
$template->renderizaEtiqueta("No posts in this tumblelog.", "div","error");

View File

@ -230,6 +230,7 @@ body {
}
div.pagination {
text-align:center;
padding:3px;
margin:3px;
}
@ -240,20 +241,20 @@ div.pagination a {
border: 1px solid #ddd;
text-decoration: none;
color: #88AF3F;
color: #aaa;
}
div.pagination a:hover, div.pagination a:active {
border:1px solid #85BD1E;
color: #638425;
background-color: #F1FFD6;
padding: 2px 5px 2px 5px;
margin-right: 2px;
border: 1px solid #a0a0a0;
}
div.pagination span.current {
padding: 2px 5px 2px 5px;
margin-right: 2px;
border: 1px solid #B2E05D;
border: 1px solid #e0e0e0;
font-weight: bold;
background-color: #B2E05D;
color: #FFF;
background-color: #f0f0f0;
color: #aaa;
}
div.pagination span.disabled {
padding: 2px 5px 2px 5px;