This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php foreach($pages as $page) { ?> | |
<div id="<?php echo $page['slug']; ?>" <?php echo $user->uid && $_GET['t'] == $page['slug'] ? "class='current setcurrent'" : ""; ?>> | |
<div class="toolbar"> | |
<h1><?php echo $page['section']; ?></h1> | |
<?php if(isset($page['parent'])) { ?> | |
<a href="?t=<?php echo $page['parent']; ?>" class="parent">Back</a> | |
<?php } else { ?> | |
<a id="logout" href="/logout" class="button">Logout</a> | |
<?php } ?> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//if animations crash due to excessive tapping, refresh the page | |
var crashchecker = setInterval(function(){ | |
if ($(".current").length == 0) { | |
window.location="/"; | |
clearInterval(crashchecker); | |
} | |
}, 500); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//How can we make this one work with classes and tags? | |
function $(id){ | |
return document.getElementById(id); | |
} | |
function html(id, html){ $(id).innerHTML = html; } | |
function css(id, style){ $(id).style.cssText += ';'+style; } | |
//iPhone/iPad/iPod browser animations |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var jQT = new $.jQTouch({ | |
'icon': '/presentation/libraries/jqtouch/themes/mytheme/img/icon.png', | |
addGlossToIcon: true, | |
startupScreen: '/presentation/libraries/jqtouch/themes/mytheme/img/startup.png', | |
statusBar: 'black', | |
preloadImage: [ | |
//... | |
], | |
useFastTouch: false //allows us to do $().submit() on forms | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (strpos(strtolower($_SERVER['HTTP_USER_AGENT']), "iphone") !== FALSE | |
|| strpos(strtolower($_SERVER['HTTP_USER_AGENT']), "ipod") !== FALSE | |
|| strpos(strtolower($_SERVER['HTTP_USER_AGENT']), "android") !== FALSE | |
|| strpos(strtolower($_SERVER['HTTP_USER_AGENT']), "blackberry") !== FALSE ) { | |
include 'mobile.php'; | |
} else { | |
?><!DOCTYPE ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!isset($_GET['src'])) { | |
//for testing, navigate to thumbnail.php?img=page/to/yourimage.jpg | |
echo "<img src='/thumbnail.php?src={$_GET['img']}' />"; | |
} else { | |
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); | |
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); | |
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 | |
header ("Pragma: no-cache"); // HTTP/1.0 | |
header("Content-type: image/pjpeg"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<select name=”gender”> | |
<option value=”1”>Male</option> | |
<option value=”2”>Female</option> | |
</select> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul class='pager'> | |
<?php | |
//The goal is to have a pager showing (if available) 5 numbers, | |
//with the current page number in the middle, if available. | |
// <<First and <Previous are shown if you can't see page 1, | |
// and Next> and Last>> are shown if you can't see the last page. | |
$start = $currentpage <= 2 ? 1 : $currentpage - 2; | |
$end = $currentpage > ($totalpages - 2) ? $totalpages : $currentpage + 2; | |
if ($end == $totalpages && $start > 2) { | |
$diff = $totalpages - $currentpage; |
NewerOlder