nicer pager browser for new caches and logpics; todo: search results
This commit is contained in:
@@ -179,7 +179,8 @@ function get_logpics($purpose, $userid=0, $cacheid=0)
|
||||
|
||||
function set_paged_pics($purpose, $userid, $cacheid, $tpl, $url)
|
||||
{
|
||||
global $_REQUEST;
|
||||
global $_REQUEST, $opt;
|
||||
|
||||
$startat = isset($_REQUEST['startat']) ? $_REQUEST['startat']+0 : 0;
|
||||
|
||||
$pictures = get_logpics($purpose, $userid, $cacheid);
|
||||
@@ -193,12 +194,18 @@ function set_paged_pics($purpose, $userid, $cacheid, $tpl, $url)
|
||||
$page = floor($startat/MAX_PICTURES_PER_GALLERY_PAGE) + 1;
|
||||
|
||||
$pl = "";
|
||||
/* paging overhead - does not look nice ...
|
||||
if ($startat > 0)
|
||||
$pl .= "<a href='" . $url . "&startat=" . ($startat - MAX_PICTURES_PER_GALLERY_PAGE) . "'><</a> ";
|
||||
{
|
||||
if ($pages > 2)
|
||||
$pl .= "<a href='" . $url . "&startat=0'><img src='resource2/" . $opt['template']['style'] . "/images/navigation/16x16-browse-first.png' width='16px' height='16px' alt='<<'></a> ";
|
||||
$pl .= "<a href='" . $url . "&startat=" . ($startat - MAX_PICTURES_PER_GALLERY_PAGE) . "'><img src='resource2/" . $opt['template']['style'] . "/images/navigation/16x16-browse-prev.png' width='16px' height='16px' alt='<'></a> ";
|
||||
}
|
||||
else
|
||||
$pl .= "< ";
|
||||
*/
|
||||
{
|
||||
if ($pages > 2)
|
||||
$pl .= "<a href='" . $url . "&startat=0'><img src='resource2/" . $opt['template']['style'] . "/images/navigation/16x16-browse-first-inactive.png' width='16px' height='16px' alt='<<'></a> ";
|
||||
$pl .= "<img src='resource2/" . $opt['template']['style'] . "/images/navigation/16x16-browse-prev-inactive.png' width='16px' height='16px' alt='<'> ";
|
||||
}
|
||||
|
||||
for ($p=1; $p<=$pages; $p++)
|
||||
{
|
||||
@@ -210,12 +217,18 @@ function set_paged_pics($purpose, $userid, $cacheid, $tpl, $url)
|
||||
else $pl .= "</strong>";
|
||||
}
|
||||
|
||||
/*
|
||||
if ($startat + MAX_PICTURES_PER_GALLERY_PAGE < count($pictures))
|
||||
$pl .= " <a href='" . $url . "&startat=" . ($startat + MAX_PICTURES_PER_GALLERY_PAGE) . "'>></a> ";
|
||||
{
|
||||
$pl .= " <a href='" . $url . "&startat=" . ($startat + MAX_PICTURES_PER_GALLERY_PAGE) . "'><img src='resource2/" . $opt['template']['style'] . "/images/navigation/16x16-browse-next.png' width='16px' height='16px' alt='>'></a> ";
|
||||
if ($pages > 2)
|
||||
$pl .= " <a href='" . $url . "&startat=" . ($startat + MAX_PICTURES_PER_GALLERY_PAGE) . "'><img src='resource2/" . $opt['template']['style'] . "/images/navigation/16x16-browse-last.png' width='16px' height='16px' alt='>>'></a> ";
|
||||
}
|
||||
else
|
||||
$pl .= " >";
|
||||
*/
|
||||
{
|
||||
$pl .= " <img src='resource2/" . $opt['template']['style'] . "/images/navigation/16x16-browse-next-inactive.png' width='16px' height='16px' alt='>'>";
|
||||
if ($pages > 2)
|
||||
$pl .= " <a href='" . $url . "&startat=" . ($startat + MAX_PICTURES_PER_GALLERY_PAGE) . "'><img src='resource2/" . $opt['template']['style'] . "/images/navigation/16x16-browse-last-inactive.png' width='16px' height='16px' alt='>>'></a> ";
|
||||
}
|
||||
|
||||
$tpl->assign('pagelinks', $pl);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user