From dfd7157cd2fa68c5843de923f308d724f8d06fcb Mon Sep 17 00:00:00 2001 From: DrudexSoftware Date: Sat, 23 Feb 2013 08:00:59 +0100 Subject: [PATCH] arrow key navigation through images allows visitors to use left-right keyboard keys to navigate to different images using post/next/(id) and post/prev/(id) --- ext/arrowkey_navigation/main.php | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 ext/arrowkey_navigation/main.php diff --git a/ext/arrowkey_navigation/main.php b/ext/arrowkey_navigation/main.php new file mode 100644 index 00000000..15136dfa --- /dev/null +++ b/ext/arrowkey_navigation/main.php @@ -0,0 +1,35 @@ + + * Link: http://drudexsoftware.com + * License: GPLv2 + * Description: Allows viewers no navigate between images using the left & right arrow keys. + * Documentation: + * Simply enable this extention in the extention manager to enable arrow key navigation. + */ +class arrowkey_navigation extends Extension { + public function onDisplayingImage(DisplayingImageEvent $event) { + global $page; + + $prev_url = "http://".$_SERVER['HTTP_HOST']."/post/prev/".$event->image->id; + $next_url = "http://".$_SERVER['HTTP_HOST']."/post/next/".$event->image->id; + + $page->add_html_header(""); + } +} +?>