Previous/Next links on event view

If you've made a patch to quick fix a bug or to add a new feature not yet in the main tree then post it here so others can try it out.
Post Reply
unclerichy
Posts: 74
Joined: Wed Feb 25, 2004 5:06 pm

Previous/Next links on event view

Post by unclerichy »

Below is a snippet of PHP which adds 'previous' and 'next' links to the page selector in events view.

For example:

<< 1 2 - 3 - 4 5 7 9 >>

Apply this to zm_html_view_events.php. If you have trouble due to formatting, I've made it available at http://www.hunter13.com/zm_navigation.diff

Code: Select all

*** zm_html_view_events.php	2004-09-12 13:00:43.000000000 +0100
--- /root/software/extract/zm-1.19.3/web/zm_html_view_events.php	2004-04-21 10:20:28.000000000 +0100
***************
*** 193,201 ****
  
  			if ( $page > 1 )
  			{
- ?>
- 				<a href="<?= $PHP_SELF ?>?view=<?= $view ?>&page=<?= $page - 1 ?><?= $filter_query ?><?= $sort_query ?>&limit=<?= $limit ?>"><<</a>
- <?php
  				$new_pages = array();
  				$pages_used = array();
  				$lo_exp = max(2,log($page-1)/log($max_shortcuts));
--- 193,198 ----
***************
*** 218,224 ****
  <a href="<?= $PHP_SELF ?>?view=<?= $view ?>&page=<?= $new_page ?><?= $filter_query ?><?= $sort_query ?>&limit=<?= $limit ?>"><?= $new_page ?></a>&nbsp;
  <?php
  				}
- 
  			}
  ?>
  -&nbsp;<?= $page ?>&nbsp;-
--- 215,220 ----
***************
*** 247,255 ****
  &nbsp;<a href="<?= $PHP_SELF ?>?view=<?= $view ?>&page=<?= $new_page ?><?= $filter_query ?><?= $sort_query ?>&limit=<?= $limit ?>"><?= $new_page ?></a>
  <?php
  				}
- ?>
- 				<a href="<?= $PHP_SELF ?>?view=<?= $view ?>&page=<?= $page + 1 ?><?= $filter_query ?><?= $sort_query ?>&limit=<?= $limit ?>">>></a>
- <?php
  			}
  ?>
  </td>
--- 243,248 ----
User avatar
lazyleopard
Posts: 403
Joined: Tue Mar 02, 2004 6:12 pm
Location: Gloucestershire, UK

Post by lazyleopard »

Needs a -R to apply (at the moment) but it's neat. Thanks. ;)
Rick Hewett
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Thanks for this. I'll try and remember to add it into the next release.

Phil,
Post Reply