--- /dev/null
+title = beg
+date = Oct 16 2011, 15:34:03; IST
+--
+
+
+
+<img src="photos/P1010976.jpg">
+
+Tapping on the windows, the begger kids have perfected their methods. They move their mouths into a sad frown, they use their eyes, they tap on the windows.
\ No newline at end of file
--- /dev/null
+title = dushera
+date = Sun, Oct 06 2011, 06:00:16 PM; IST
+draft = true
+--
+<img src="photos/IMG_1256.jpg" />
+
+dushera
\ No newline at end of file
--- /dev/null
+title = sun
+date = Sun, Oct 23 2011, 06:06:33 PM; IST
+--
+
+<img src="photos/P1020004.jpg" />
--- /dev/null
+title = water_is_life
+date = Sun, Oct 23 2011, 06:04:38 PM; IST
+draft = true
+--
+
+<img src="photos/P1020037.jpg">
+
+delapitated truck left near the Quotar Minar in Dadabari. Painting on the front bumper reads "Water is Life" in Hindi.
\ No newline at end of file
a {
color:rgb(198, 28, 111);
+ text-decoration:none;
}
a img {
border:0;
padding:50px;
background:#fff;
}
+#nextprev {
+ padding:0 50px 10px 50px;
+}
#nav {
padding:30px 50px;
border-top:1px dotted #aaa;
--- /dev/null
+// javascript
+
+var init = ( function () {
+
+ var LEFT = 37, RIGHT = 39;
+
+ document.onkeypress = function(e) {
+ switch (e.keyCode) {
+ case LEFT : nextEntry(); break;
+ case RIGHT : prevEntry(); break;
+ }
+ }
+
+ function prevEntry() {
+ if (typeof(PREV_ENTRY) != "undefined") {
+ window.location = PREV_ENTRY;
+ }
+ }
+
+ function nextEntry() {
+ if (typeof(NEXT_ENTRY) != "undefined") {
+ window.location = NEXT_ENTRY;
+ }
+ }
+
+})();
}
}
+
switch ($order_by)
{
default :
array_multisort( $time, $order, $entries );
}
+
+ // assign next/prev for each entry
+ $num_entries = count($entries);
+ for ($i = $num_entries-1; $i>=0; $i--) {
+ $entries[$i]['prev_entry'] = isset($entries[$i+1]) ? $entries[$i+1] : null;
+ $entries[$i]['next_entry'] = isset($entries[$i-1]) ? $entries[$i-1] : null;
+ }
+
return $entries;
}
return $dirs;
}
+
/**
* get all pages
*/
$cat = clean_slashes(str_replace(LOCAL_ROOT . CONTENT_DIR, "", $fileInfo->getPath()));
$clean_path = str_replace(LOCAL_ROOT . CONTENT_DIR, "", clean_slashes($fileInfo->getPath()));
-
$f['cat'] = $page ? null : array('name' => $clean_path, 'url' => $clean_path );
$f['path'] = $fileInfo->getRealPath();
$f['url'] = ($page ? '' : $f['cat']['url'] . '/') . $fileInfo->getFilename();
}
-function get_entry ( $relative_entry_path )
+function get_entry ( $relative_path )
{
- return parse_entry(new SplFileInfo(join(array(LOCAL_ROOT, CONTENT_DIR, $relative_entry_path), DIRECTORY_SEPARATOR)));
+ return parse_entry(new SplFileInfo(join(array(LOCAL_ROOT, CONTENT_DIR, $relative_path), DIRECTORY_SEPARATOR)));
}
-function get_page ( $relative_page_path )
+function get_page ( $relative_path )
{
- return parse_entry(new SplFileInfo(join(array(LOCAL_ROOT, PAGE_DIR, $relative_page_path), DIRECTORY_SEPARATOR)), 1);
+ return parse_entry(new SplFileInfo(join(array(LOCAL_ROOT, PAGE_DIR, $relative_path), DIRECTORY_SEPARATOR)), 1);
}
function parse_config ( $relative_path )
{
return parse_entry(new SplFileInfo(join(array(LOCAL_ROOT, CONTENT_DIR, $relative_path, CONFIG_FILE), DIRECTORY_SEPARATOR)));
-}
\ No newline at end of file
+}
require_once 'output.php';
require_once 'markdown.php';
require_once 'model.php';
-require_once 'view.php';
+require_once 'view.php';
\ No newline at end of file
function parse_request( $request )
{
-
$this->content_request = join(array($this->request['dirname'], $this->request['filename']), DIRECTORY_SEPARATOR );
$this->page_request = $this->request['filename'];
-
# if entries (dir in CONTENT dir)
if ($this->is_multiple()) {
# check if config file exists in dir
else if ($this->is_single())
{
$this->entry = get_entry( $this->content_request );
+
+ // heavy handed prev/next
+ $entries = get_entries();
+ for($i = count($entries)-1; $i>=0; $i--) {
+ if ($this->entry['url'] == $entries[$i]['url']) {
+ $this->entry['prev_entry'] = $entries[$i]['prev_entry'];
+ $this->entry['next_entry'] = $entries[$i]['next_entry'];
+ break;
+ }
+ }
+
$this->template = 'single.' . $this->response_format . '.tpl';
}
'page.' . $this->response_format . '.tpl';
}
-
# not found
else {
$this->template = '404.html.tpl';
</head>
<body>
- <? $this->include_template('nav.html.tpl') ?>
<div id="content">
</div>
<? $this->include_template('footer.html.tpl') ?>
+ <? $this->include_template('nav.html.tpl') ?>
</body>
</html>
<!-- footer -->
+
+<script src="<?=get_base_dir();?>/js/js.js"></script>
<link rel="alternate" type="application/rss+xml" title="RSS" href="<?=get_base_dir();?>/.rss" />
<link rel="stylesheet" href="<?=get_base_dir();?>/css/style.css" type="text/css">
+
--- /dev/null
+
+<? if (isset($entry['prev_entry'])) : ?>
+ <a href="<?=$entry['prev_entry']['url']?>">prev</a>
+ <script>var PREV_ENTRY = '<?=$entry['prev_entry']['url']?>'</script>
+<? endif; ?>
+
+<? if (isset($entry['next_entry'])) : ?>
+ <a href="<?=$entry['next_entry']['url']?>">next</a>
+ <script>var NEXT_ENTRY = '<?=$entry['next_entry']['url']?>'</script>
+<? endif; ?>
</head>
<body>
-
<div id="content">
- <? $this->include_template('entry.html.tpl'); ?>
+ <? $this->include_template('entry.html.tpl'); ?>
</div>
- <? $this->include_template('nav.html.tpl') ?>
+ <div id="nextprev">
+ <? $this->include_template('nextprev.html.tpl'); ?>
+ </div>
+ <? $this->include_template('nav.html.tpl') ?>
<? $this->include_template('footer.html.tpl') ?>
</body>