Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 2 commits
  • 10 files changed
  • 0 commit comments
  • 1 contributor
View
5 www/css/main.css
@@ -81,6 +81,11 @@ p.message {
background-color: #9f9;
}
+#pag_bookends {
+ margin-left:auto;
+ margin-right:auto;
+ text-align:center;
+}
/*pagination*/
#pagination{
View
2  www/css/mobile.css
@@ -56,7 +56,7 @@ input[type=submit] {
text-align:right !important;
}
-.pag_middle {
+#pag_middle {
display:none;
}
View
35 www/include/lib_privatesquare_checkins.php
@@ -480,4 +480,39 @@ function privatesquare_checkins_delete(&$checkin){
}
#################################################################
+
+ function privatesquare_checkins_bookends_for_date(&$user, $ymd){
+
+ $bookends = array(
+ 'before' => null,
+ 'after' => null,
+ );
+
+ $fmt = "Y-m-d";
+
+ $cluster_id = $user['cluster_id'];
+
+ $start = strtotime("{$ymd} 00:00:00");
+ $stop = strtotime("{$ymd} 23:59:59");
+
+ $enc_user = AddSlashes($user['id']);
+ $enc_start = AddSlashes($start);
+ $enc_stop = AddSlashes($stop);
+
+ $sql = "SELECT * FROM PrivatesquareCheckins WHERE user_id='{$enc_user}' AND created < {$enc_start} ORDER BY created DESC LIMIT 1";
+
+ if ($row = db_single(db_fetch_users($cluster_id, $sql))){
+ $bookends['before'] = date($fmt, $row['created']);
+ }
+
+ $sql = "SELECT * FROM PrivatesquareCheckins WHERE user_id='{$enc_user}' AND created > {$enc_stop}";
+
+ if ($row = db_single(db_fetch_users($cluster_id, $sql))){
+ $bookends['after'] = date($fmt, $row['created']);
+ }
+
+ return $bookends;
+ }
+
+ #################################################################
?>
View
10 www/javascript/jquery.touchwipe.min.js
@@ -0,0 +1,10 @@
+/**
+ * jQuery Plugin to obtain touch gestures from iPhone, iPod Touch and iPad, should also work with Android mobile phones (not tested yet!)
+ * Common usage: wipe images (left and right to show the previous or next image)
+ *
+ * @author Andreas Waltl, netCU Internetagentur (http://www.netcu.de)
+ * @version 1.1.1 (9th December 2010) - fix bug (older IE's had problems)
+ * @version 1.1 (1st September 2010) - support wipe up and wipe down
+ * @version 1.0 (15th July 2010)
+ */
+(function($){$.fn.touchwipe=function(settings){var config={min_move_x:20,min_move_y:20,wipeLeft:function(){},wipeRight:function(){},wipeUp:function(){},wipeDown:function(){},preventDefaultEvents:true};if(settings)$.extend(config,settings);this.each(function(){var startX;var startY;var isMoving=false;function cancelTouch(){this.removeEventListener('touchmove',onTouchMove);startX=null;isMoving=false}function onTouchMove(e){if(config.preventDefaultEvents){e.preventDefault()}if(isMoving){var x=e.touches[0].pageX;var y=e.touches[0].pageY;var dx=startX-x;var dy=startY-y;if(Math.abs(dx)>=config.min_move_x){cancelTouch();if(dx>0){config.wipeLeft()}else{config.wipeRight()}}else if(Math.abs(dy)>=config.min_move_y){cancelTouch();if(dy>0){config.wipeDown()}else{config.wipeUp()}}}}function onTouchStart(e){if(e.touches.length==1){startX=e.touches[0].pageX;startY=e.touches[0].pageY;isMoving=true;this.addEventListener('touchmove',onTouchMove,false)}}if('ontouchstart'in document.documentElement){this.addEventListener('touchstart',onTouchStart,false)}});return this}})(jQuery);
View
64 www/templates/inc_pagination.txt
@@ -13,67 +13,9 @@
{capture assign="next_page"}{if $pagination.page < $pagination.page_count}{if $pagination_page_as_queryarg}{$pagination_url}&page={$pagination.page+1}{else}{$pagination_url}page{$pagination.page+1}{/if}{/if}{/capture}
{if $cfg.pagination_keyboard_shortcuts}
-
-<script type="text/javascript">
-
-var prev = {if $pagination.page_count > 1 and $pagination.page > 1}'{$prev_page}'{else}null{/if};
-var next = {if $pagination.page_count > 1 and $pagination.page < $pagination.page_count}'{$next_page}'{else}null{/if};
-
-{literal}
-
-$(document).ready(function(){
-
- var goto_next = function(){
- if (next){
- location.href = next;
- }
- };
-
- var goto_previous = function(){
- if (prev){
- location.href = prev;
- }
- };
-
- $(document).keypress(function(e){
-
- if (e.keyCode == 37){
- goto_previous();
- }
-
- else if (e.keyCode == 39){
- goto_next();
- }
-
- else {}
- });
-
-{/literal}
-
-{if $cfg.pagination_touch_shortcuts}
-{literal}
- // http://www.netcu.de/jquery-touchwipe-iphone-ipad-library
-
- $(document).touchwipe({
- wipeLeft: goto_next,
- wipeRight: goto_previous,
- wipeUp: function(){},
- wipeDown: function(){},
- min_move_x: 100,
- min_move_y: 100,
- preventDefaultEvents: false,
- allowPageScroll: 'vertical'
- });
-{/literal}
-{/if}
-
-{literal}
-});
-
-{/literal}
-
-</script>
-
+{capture assign="paginate_previous"}{if $pagination.page_count > 1 and $pagination.page > 1}{$prev_page}{else}{/if}{/capture}
+{capture assign="paginate_next"}{if $pagination.page_count > 1 and $pagination.page < $pagination.page_count}{$next_page}{else}{/if}{/capture}
+{include file="inc_pagination_shortcuts.txt"}
{/if}
{/if}
View
18 www/templates/inc_pagination_bookends.txt
@@ -0,0 +1,18 @@
+<div id="pag_bookends">
+ <span id="pag_prev">
+ {if $paginate_previous}
+ <a href="{$paginate_previous}" class="ds_pag">Previous</a>
+ {else}
+ <span class="pag_inactive">Previous</span>
+ {/if}
+ </span>
+
+ <span id="pag_next">
+ {if $paginate_next}
+ <a href="{$paginate_next}" class="ds_pag">Next</a>
+ {else}
+ <span class="pag_inactive">Next</span>
+ {/if}
+ </span>
+
+</div>
View
18 www/templates/inc_pagination_pretty.txt
@@ -1,5 +1,7 @@
<p class="pag_head">Page {$pagination.page} of {$pagination.page_count}</p>
{if $pagination.page_count > 1}
+
+ <span id="pag_prev">
{* previous button *}
{if $pagination.page > 1}
{if $pagination_page_as_queryarg}
@@ -10,11 +12,13 @@
{else}
<span class="pag_inactive">Previous page</span>
{/if}
-
- <span class="pag_middle">
+ </span>
+
{* middle *}
+ <span id="pag_middle">
+
{if $pagination.page_count > 10}
{assign var=range_mid value=7}
{assign var=rfloor value=$range_mid/2|@floor}
@@ -59,7 +63,7 @@
{/if}
{/section}
-
+
{else}
{section name=paglp start=1 loop=$pagination.page_count+1}
@@ -79,8 +83,10 @@
{/if}
- </span>
-
+ </span>
+
+ <span id="pag_next">
+
{* next button *}
{if $pagination.page < $pagination.page_count}
{if $pagination_page_as_queryarg}
@@ -92,7 +98,7 @@
<span class="pag_inactive">Next page</span>
{/if}
-
+ </span>
View
59 www/templates/inc_pagination_shortcuts.txt
@@ -0,0 +1,59 @@
+<script type="text/javascript">
+
+var prev = {if $paginate_previous}'{$paginate_previous}'{else}null{/if};
+var next = {if $paginate_next}'{$paginate_next}'{else}null{/if};
+
+{literal}
+
+$(document).ready(function(){
+
+ var goto_next = function(){
+ if (next){
+ location.href = next;
+ }
+ };
+
+ var goto_previous = function(){
+ if (prev){
+ location.href = prev;
+ }
+ };
+
+ $(document).keypress(function(e){
+
+ if (e.keyCode == 37){
+ goto_previous();
+ }
+
+ else if (e.keyCode == 39){
+ goto_next();
+ }
+
+ else {}
+ });
+
+{/literal}
+
+{if $cfg.pagination_touch_shortcuts}
+{literal}
+ // http://www.netcu.de/jquery-touchwipe-iphone-ipad-library
+
+ $(document).touchwipe({
+ wipeLeft: goto_next,
+ wipeRight: goto_previous,
+ wipeUp: function(){},
+ wipeDown: function(){},
+ min_move_x: 100,
+ min_move_y: 100,
+ preventDefaultEvents: false,
+ allowPageScroll: 'vertical'
+ });
+{/literal}
+{/if}
+
+{literal}
+});
+
+{/literal}
+
+</script>
View
8 www/templates/page_user_history.txt
@@ -62,7 +62,15 @@ Okee dookee, your checkin has been deleted.
{/foreach}
+{if $bookends}
+{if $bookends.before}{assign var="paginate_previous" value=$bookends.before}{/if}
+{if $bookends.after}{assign var="paginate_next" value=$bookends.after}{/if}
+
+{include file="inc_pagination_bookends.txt"}
+{include file="inc_pagination_shortcuts.txt"}
+{else}
{include file="inc_pagination.txt"}
+{/if}
{include file="inc_export_links.txt"}
View
3  www/user_history.php
@@ -82,6 +82,9 @@
$GLOBALS['smarty']->assign("when", $when);
$GLOBALS['smarty']->assign("start", $start);
$GLOBALS['smarty']->assign("stop", $stop);
+
+ $bookends = privatesquare_checkins_bookends_for_date($owner, $when);
+ $GLOBALS['smarty']->assign("bookends", $bookends);
}
$status_map = privatesquare_checkins_status_map();

No commit comments for this range

Something went wrong with that request. Please try again.