summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-04-09 05:43:57 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-04-09 05:43:57 +0000
commit880601fee3929b86bdb60cc403268fda1532594e (patch)
treea6b6b5f7c304d2c6d013a80fc057ff3382d792c4
parent7ec6cdb3393b3cdb0dcbe7b4e8b6f82d5aa9c351 (diff)
downloadampache-880601fee3929b86bdb60cc403268fda1532594e.tar.gz
ampache-880601fee3929b86bdb60cc403268fda1532594e.tar.bz2
ampache-880601fee3929b86bdb60cc403268fda1532594e.zip
first little bit of fixing the page remembering mojo for back, still not perfect
-rw-r--r--browse.php5
-rw-r--r--lib/class/browse.class.php46
-rw-r--r--lib/init.php2
-rw-r--r--templates/footer.inc.php2
4 files changed, 40 insertions, 15 deletions
diff --git a/browse.php b/browse.php
index e11946ac..5f7ee805 100644
--- a/browse.php
+++ b/browse.php
@@ -1,7 +1,7 @@
<?php
/*
- Copyright (c) 2001 - 2007 Ampache.org
+ Copyright (c) Ampache.org
All Rights Reserved
This program is free software; you can redistribute it and/or
@@ -25,9 +25,6 @@
* This page shows the browse menu, which allows you to browse by many different
* fields including genre, artist, album, catalog, ???
* this page also handles the actuall browse action
- * @package Web Interface
- * @catagory Browse
- * @author Karl Vollmer 06/24/05
*
*/
diff --git a/lib/class/browse.class.php b/lib/class/browse.class.php
index c5fff159..d6d8e24f 100644
--- a/lib/class/browse.class.php
+++ b/lib/class/browse.class.php
@@ -1,7 +1,7 @@
<?php
/*
- Copyright (c) 2001 - 2007 Ampache.org
+ Copyright (c) Ampache.org
All rights reserved.
This program is free software; you can redistribute it and/or
@@ -30,8 +30,9 @@ class Browse {
// Public static vars that are cached
public static $sql;
- public static $start = '0';
+ public static $start;
public static $total_objects;
+ public static $type;
// Boolean if this is a simple browse method (use different paging code)
public static $simple_browse;
@@ -40,6 +41,7 @@ class Browse {
// apply any filters that would change the result set.
public static $static_content = false;
+
/**
* constructor
* This should never be called
@@ -59,18 +61,19 @@ class Browse {
* a single point for whitelist tweaks etc
*/
public static function set_filter($key,$value) {
+
switch ($key) {
- case 'show_art':
+ case 'show_art':
if ($_SESSION['browse']['filter'][$key]) {
unset($_SESSION['browse']['filter'][$key]);
}
else {
- $_SESSION['browse']['filter'][$key] = 1;
+ $_SESSION['browse']['filter'][$key] = 1;
}
- break;
- case 'min_count':
- case 'unplayed':
- case 'rated':
+ break;
+ case 'min_count':
+ case 'unplayed':
+ case 'rated':
break;
case 'alpha_match':
@@ -180,7 +183,17 @@ class Browse {
case 'genre':
case 'shoutbox':
case 'live_stream':
+ // Reset the start if they go to a different type
+ if ($type != $_SESSION['browse']['type']) {
+ self::set_start('0');
+ }
+ else {
+ self::load_start();
+ }
+
$_SESSION['browse']['type'] = $type;
+
+
// Resets the simple browse
self::set_simple_browse(0);
self::set_static_content(0);
@@ -256,10 +269,13 @@ class Browse {
/**
* set_start
* This sets the start point for our show functions
+ * We need to store this in the session so that it can be pulled
+ * back, if they hit the back button
*/
public static function set_start($start) {
- self::$start = intval($start);
+ $_SESSION['browse'][self::$type]['start'] = intval($start);
+ self::$start = $_SESSION['browse'][self::$type]['start'];
} // set_start
@@ -293,6 +309,16 @@ class Browse {
} // set_static_content
/**
+ * load_start
+ * This returns a stored start point for the browse mojo
+ */
+ public static function load_start() {
+
+ self::$start = intval($_SESSION['browse'][self::$type]['start']);
+
+ } // end load_start
+
+ /**
* get_saved
* This looks in the session for the saved
* stuff and returns what it finds
@@ -837,6 +863,8 @@ class Browse {
self::$simple_browse = make_bool($_SESSION['browse']['simple']);
self::$static_content = make_bool($_SESSION['browse']['static']);
+ self::$type = $_SESSION['browse']['type'];
+ self::$start = intval($_SESISON['browse'][self::$type]['start']);
} // _auto_init
diff --git a/lib/init.php b/lib/init.php
index 58d846db..b91b1d9a 100644
--- a/lib/init.php
+++ b/lib/init.php
@@ -25,7 +25,7 @@
// Use output buffering, this gains us a few things and
// fixes some CSS issues
-ob_start();
+ob_start('ob_gzhandler');
// Do a check for PHP5 because nothing will work without it
if (strcmp('5.0.0',phpversion()) > 0) {
diff --git a/templates/footer.inc.php b/templates/footer.inc.php
index cb3d8965..682c7bc2 100644
--- a/templates/footer.inc.php
+++ b/templates/footer.inc.php
@@ -1,7 +1,7 @@
<?php
/*
- Copyright (c) 2001 - 2006 Ampache.org
+ Copyright (c) Ampache.org
All rights reserved.
This program is free software; you can redistribute it and/or