nicer pager browser for new caches and logpics; todo: search results

This commit is contained in:
following
2013-03-21 13:58:36 +01:00
parent 933504ee0d
commit bf129049d4
18 changed files with 56 additions and 45 deletions

View File

@@ -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) . "'>&lt;</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='&lt;&lt;'></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='&lt;'></a> ";
}
else
$pl .= "&lt; ";
*/
{
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='&lt;&lt;'></a> ";
$pl .= "<img src='resource2/" . $opt['template']['style'] . "/images/navigation/16x16-browse-prev-inactive.png' width='16px' height='16px' alt='&lt;'> ";
}
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) . "'>&gt;</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='&gt;'></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='&gt;&gt;'></a> ";
}
else
$pl .= " &gt;";
*/
{
$pl .= " <img src='resource2/" . $opt['template']['style'] . "/images/navigation/16x16-browse-next-inactive.png' width='16px' height='16px' alt='&gt;'>";
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='&gt;&gt;'></a> ";
}
$tpl->assign('pagelinks', $pl);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 416 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 715 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 715 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 641 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 646 B

View File

Before

Width:  |  Height:  |  Size: 740 B

After

Width:  |  Height:  |  Size: 740 B

View File

Before

Width:  |  Height:  |  Size: 550 B

After

Width:  |  Height:  |  Size: 550 B

View File

Before

Width:  |  Height:  |  Size: 268 B

After

Width:  |  Height:  |  Size: 268 B

View File

Before

Width:  |  Height:  |  Size: 336 B

After

Width:  |  Height:  |  Size: 336 B

View File

@@ -2142,7 +2142,7 @@ function toggle_attribselection(bSaveCookies)
{* popup box for permalink *}
<div id="permalink_box" class="mappermalink mapboxframe mapboxshadow" style="display:none">
<table>
<tr><td><img src="resource2/ocstyle/images/viewcache/link.png" alt="" height="16" width="16" /> {t}Link to this map view{/t}:</td><td align="right"><a href="javascript:permalinkbox_hide()"><img src="resource2/ocstyle/images/misc/close-medium.png" style="opacity:0.7" ></a></td></tr>
<tr><td><img src="resource2/ocstyle/images/viewcache/link.png" alt="" height="16" width="16" /> {t}Link to this map view{/t}:</td><td align="right"><a href="javascript:permalinkbox_hide()"><img src="resource2/ocstyle/images/navigation/close-medium.png" style="opacity:0.7" ></a></td></tr>
<tr><td><input id="permalink_text" type="text" value="" size="55"/></td></tr>
<tr id="permalink_addFavorites"><td align="right"><input type="button" value="{t}Add to favorites...{/t}" onclick="addFavorites_click()" /></td></tr>
</table>
@@ -2172,7 +2172,7 @@ function toggle_attribselection(bSaveCookies)
<form action="map2.php?mode={if $bFullscreen}full{else}normal{/if}screen" method="post" style="display:inline;">
<input type="hidden" name="submit" value="1" />
<table>
<tr><td><span style="font-size:1.2em; font-weight:bold">{t}Settings{/t}</strong></td><td style="text-align:right"><a href="javascript:toggle_settings()"><img src="resource2/ocstyle/images/misc/close-medium.png" style="opacity:0.7" /></a></tr>
<tr><td><span style="font-size:1.2em; font-weight:bold">{t}Settings{/t}</strong></td><td style="text-align:right"><a href="javascript:toggle_settings()"><img src="resource2/ocstyle/images/navigation/close-medium.png" style="opacity:0.7" /></a></tr>
<tr><td>{t}Menu option 'Map' shows{/t}:</td><td><select name="opt_menumap"><option id="opt_menumap0" value="0">{t}small map{/t}</option><option id="opt_menumap1" value="1">{t}fullscreen map{/t}</option></select></td></tr>
<tr><td>{t}Show overview map{/t}:</td><td><input type="checkbox" id="opt_overview" name="opt_overview" value="1" /></td></tr>
<tr><td>{t 1=$min_maxrecords 2=$max_maxrecords}Maximum caches on map<br />(%1-%2, 0=automatic){/t}:</td><td><input type="text" id="opt_maxcaches" name="opt_maxcaches" size="6" /></td></tr>
@@ -2191,7 +2191,7 @@ function toggle_attribselection(bSaveCookies)
<div id="cachepicbox" class="default mapboxframe mapboxshadow" style="position:absolute; {if $bFullscreen}left:4px; top:7px;{else}left:0; top:0;{/if} background:#fdfdfd; display:none; z-index:60">
<div style="position:absolute; right:-19px; top:2px; opacity:0.7">
<img src="resource2/ocstyle/images/misc/close-smaller.png" onclick="hide_picture()" style="cursor:pointer"/>
<img src="resource2/ocstyle/images/navigation/close-smaller.png" onclick="hide_picture()" style="cursor:pointer"/>
</div>
<div>
<a id="cachepiccontainer" class="nooutline"><img id="cachepic"/></a>

View File

@@ -12,14 +12,7 @@
<table width="100%" class="table">
<tr>
<td class="header-small">
{if $startat>0}
<a href="newcaches.php?startat=0">&lt;&lt;</a>
<a href="newcaches.php?startat={$startat-$perpage}">&lt;</a>
{else}
&lt;&lt;
&lt;
{/if}
{include file="res_browse_left.tpl" page="newcaches"}
{section name=page start=$firstpage loop=$lastpage+1 step=100}
{if $smarty.section.page.index!=$startat}
@@ -29,14 +22,7 @@
{/if}
{/section}
{if $startat<$maxstart}
<a href="newcaches.php?startat={$startat+$perpage}">&gt;</a>
<a href="newcaches.php?startat={$maxstart}">&gt;&gt;</a>
{else}
&gt;
&gt;&gt;
{/if}
{include file="res_browse_right.tpl" page="newcaches"}
</td>
</tr>
@@ -46,14 +32,7 @@
<tr>
<td class="header-small">
{if $startat>0}
<a href="newcaches.php?startat=0">&lt;&lt;</a>
<a href="newcaches.php?startat={$startat-$perpage}">&lt;</a>
{else}
&lt;&lt;
&lt;
{/if}
{include file="res_browse_left.tpl" page="newcaches"}
{section name=page start=$firstpage loop=$lastpage+1 step=100}
{if $smarty.section.page.index!=$startat}
@@ -63,14 +42,7 @@
{/if}
{/section}
{if $startat<$maxstart}
<a href="newcaches.php?startat={$startat+$perpage}">&gt;</a>
<a href="newcaches.php?startat={$maxstart}">&gt;&gt;</a>
{else}
&gt;
&gt;&gt;
{/if}
{include file="res_browse_right.tpl" page="newcaches"}
</td>
</tr>
</table>

View File

@@ -0,0 +1,13 @@
{***************************************************************************
* You can find the license in the docs directory
*
* Unicode Reminder メモ
***************************************************************************}
{* OCSTYLE *}
{if $startat <= 0}
<img src="resource2/{$opt.template.style}/images/navigation/16x16-browse-first-inactive.png" width="16px" height="16px" alt="&lt;&lt;">
<img src="resource2/{$opt.template.style}/images/navigation/16x16-browse-prev-inactive.png" width="16px" height="16px" alt="&lt;">
{else}
<a href="{$page}.php?startat=0"><img src="resource2/{$opt.template.style}/images/navigation/16x16-browse-first.png" width="16px" height="16px" alt="&lt;&lt;"></a>
<a href="{$page}.php?startat={$startat-$perpage}"><img src="resource2/{$opt.template.style}/images/navigation/16x16-browse-prev.png" width="16px" height="16px" alt="&lt;"></a>
{/if}

View File

@@ -0,0 +1,13 @@
{***************************************************************************
* You can find the license in the docs directory
*
* Unicode Reminder メモ
***************************************************************************}
{* OCSTYLE *}
{if $startat<$maxstart}
<a href="{$page}.php?startat={$startat+$perpage}"><img src="resource2/{$opt.template.style}/images/navigation/16x16-browse-next.png" width="16px" height="16px" alt="&gt;"></a>
<a href="{$page}.php?startat={$maxstart}"><img src="resource2/{$opt.template.style}/images/navigation/16x16-browse-last.png" width="16px" height="16px" alt="&gt;&gt;"></a>
{else}
<img src="resource2/{$opt.template.style}/images/navigation/16x16-browse-next-inactive.png" width="16px" height="16px" alt="&gt;">
<img src="resource2/{$opt.template.style}/images/navigation/16x16-browse-last-inactive.png" width="16px" height="16px" alt="&gt;&gt;">
{/if}

View File

@@ -5,7 +5,7 @@
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td><font size="2">{$subtitle}</font></td>
<td class="picpaging">{t}Page{/t} {$pagelinks}</td>
<td class="picpaging">{$pagelinks}</td>
</tr>
</table>
</div>