summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--albums.php1
-rw-r--r--lib/class/browse.class.php311
-rw-r--r--server/browse.ajax.php22
-rw-r--r--templates/show_album.inc.php6
-rw-r--r--templates/show_songs.inc.php2
-rw-r--r--templates/show_users.inc.php12
-rw-r--r--templates/sidebar_home.inc.php10
7 files changed, 194 insertions, 170 deletions
diff --git a/albums.php b/albums.php
index be973765..6fcccb00 100644
--- a/albums.php
+++ b/albums.php
@@ -168,7 +168,6 @@ switch ($_REQUEST['action']) {
// Browse by Album
default:
case 'show':
-
$album = new Album($_REQUEST['album']);
$album->format();
Browse::reset_filters();
diff --git a/lib/class/browse.class.php b/lib/class/browse.class.php
index a1edca80..14026fa4 100644
--- a/lib/class/browse.class.php
+++ b/lib/class/browse.class.php
@@ -130,7 +130,7 @@ class Browse {
*/
public static function reset_supplemental_objects() {
- $_SESSION['browse']['supplemental'] = array();
+ $_SESSION['browse'][self::$type]['supplemental'] = array();
} // reset_supplemental_objects
@@ -152,6 +152,22 @@ class Browse {
*/
public static function get_total($objects=false) {
+ // If they pass something then just return that
+ if (is_array($objects)) {
+ return count($objects);
+ }
+
+ // See if we can find it in the cache
+ if (isset($_SESSION['browse']['total'][self::$type])) {
+ return $_SESSION['browse']['total'][self::$type];
+ }
+
+ $db_results = Dba::query(self::get_base_sql() . self::get_filter_sql() . self::get_sort_sql());
+ $num_rows = Dba::num_rows($db_results);
+
+ $_SESSION['browse']['total'][self::$type] = $num_rows;
+
+ return $num_rows;
} // get_total
@@ -162,7 +178,7 @@ class Browse {
*/
public static function get_allowed_filters() {
- switch ($_SESSION['browse']['type']) {
+ switch (self::$type) {
case 'album':
$valid_array = array('show_art','starts_with','alpha_match');
break;
@@ -211,15 +227,6 @@ class Browse {
// Set it
self::$type = $type;
self::load_start();
-
- // Save it in the session
- $_SESSION['browse']['type'] = $type;
-
-
- // Resets the simple browse
- self::set_simple_browse(0);
- self::set_static_content(0);
- self::reset_supplemental_objects();
break;
default:
// Rien a faire
@@ -243,8 +250,7 @@ class Browse {
*/
public static function set_sort($sort,$order='') {
-
- switch ($_SESSION['browse']['type']) {
+ switch (self::get_type()) {
case 'playlist_song':
case 'song':
$valid_array = array('title','year','track','time');
@@ -279,18 +285,18 @@ class Browse {
if ($order) {
$order = ($order == 'DESC') ? 'DESC' : 'ASC';
- $_SESSION['browse']['sort'] = array();
- $_SESSION['browse']['sort'][$sort] = $order;
+ $_SESSION['browse']['sort'][self::$type] = array();
+ $_SESSION['browse']['sort'][self::$type][$sort] = $order;
}
- elseif ($_SESSION['browse']['sort'][$sort] == 'DESC') {
+ elseif ($_SESSION['browse']['sort'][self::$type][$sort] == 'DESC') {
// Reset it till I can figure out how to interface the hotness
- $_SESSION['browse']['sort'] = array();
- $_SESSION['browse']['sort'][$sort] = 'ASC';
+ $_SESSION['browse']['sort'][self::$type] = array();
+ $_SESSION['browse']['sort'][self::$type][$sort] = 'ASC';
}
else {
// Reset it till I can figure out how to interface the hotness
- $_SESSION['browse']['sort'] = array();
- $_SESSION['browse']['sort'][$sort] = 'DESC';
+ $_SESSION['browse']['sort'][self::$type] = array();
+ $_SESSION['browse']['sort'][self::$type][$sort] = 'DESC';
}
self::resort_objects();
@@ -298,6 +304,16 @@ class Browse {
} // set_sort
/**
+ * set_join
+ * This sets the joins for the current browse object
+ */
+ public static function set_join($type,$table,$source,$dest) {
+
+ $_SESSION['browse']['join'][self::$type] = strtoupper($type) . ' JOIN ' . $table . ' ON ' . $source . '=' . $dest;
+
+ } // set_join
+
+ /**
* 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
@@ -320,8 +336,6 @@ class Browse {
public static function set_simple_browse($value) {
$value = make_bool($value);
- self::$simple_browse = $value;
-
$_SESSION['browse'][self::$type]['simple'] = $value;
} // set_simple_browse
@@ -342,7 +356,7 @@ class Browse {
self::set_start('0');
}
- $_SESSION['browse']['static'] = $value;
+ $_SESSION['browse'][self::$type]['static'] = $value;
} // set_static_content
@@ -378,15 +392,20 @@ class Browse {
return self::$_cache['browse'][self::$type];
}
- // If not then we're going to need to read from the database :(
- $sid = session_id() . '::' . self::$type;
+ if (!self::is_simple_browse()) {
+ // If not then we're going to need to read from the database :(
+ $sid = session_id() . '::' . self::$type;
- $sql = "SELECT `data` FROM `tmp_browse` WHERE `sid`='$sid'";
- $db_results = Dba::read($sql);
+ $sql = "SELECT `data` FROM `tmp_browse` WHERE `sid`='$sid'";
+ $db_results = Dba::read($sql);
- $row = Dba::fetch_assoc($db_results);
+ $row = Dba::fetch_assoc($db_results);
- $objects = unserialize($row['data']);
+ $objects = unserialize($row['data']);
+ }
+ else {
+ $objects = self::get_objects();
+ }
return $objects;
@@ -433,7 +452,7 @@ class Browse {
*/
public static function get_supplemental_objects() {
- $objects = $_SESSION['browse']['supplemental'];
+ $objects = $_SESSION['browse']['supplemental'][self::$type];
if (!is_array($objects)) { $objects = array(); }
@@ -447,7 +466,7 @@ class Browse {
*/
public static function add_supplemental_object($class,$uid) {
- $_SESSION['browse']['supplemental'][$class] = intval($uid);
+ $_SESSION['browse']['supplemental'][self::$type][$class] = intval($uid);
return true;
@@ -459,53 +478,35 @@ class Browse {
*/
private static function get_base_sql() {
- // Get our base SQL must always return ID
- $includetags = (is_array($_SESSION['browse']['filter']['tag'])
- && sizeof($_SESSION['browse']['filter']['tag']));
- $megajoin = '';
- if ($includetags)
- $megajoin = ', tags.id as tagid';
- $megajoin .= ' FROM song, artist, album ';
- if ($includetags)
- $megajoin.= ', tags, tag_map ';
- $megajoin .= 'WHERE song.album = album.id AND
- song.artist = artist.id AND ';
- if ($includetags)
- $megajoin .= ' tag_map.tag_id = tags.id AND ';
- $w = " WHERE 1=1 AND ";
-
- switch ($_SESSION['browse']['type']) {
+ switch (self::$type) {
case 'album':
- $sql = "SELECT DISTINCT `album`.`id` "
- .$megajoin;
+ $sql = "SELECT DISTINCT `album`.`id` FROM `album` ";
break;
case 'artist':
- $sql = "SELECT DISTINCT `artist`.`id` "
- .$megajoin;
+ $sql = "SELECT DISTINCT `artist`.`id` FROM `artist` ";
break;
case 'genre':
- $sql = "SELECT `genre`.`id` FROM `genre` ".$w;
+ $sql = "SELECT `genre`.`id` FROM `genre` ";
break;
case 'user':
- $sql = "SELECT `user`.`id` FROM `user` ".$w;
+ $sql = "SELECT `user`.`id` FROM `user` ";
break;
case 'live_stream':
- $sql = "SELECT `live_stream`.`id` FROM `live_stream` ".$w;
+ $sql = "SELECT `live_stream`.`id` FROM `live_stream` ";
break;
case 'playlist':
- $sql = "SELECT `playlist`.`id` FROM `playlist` ".$w;
+ $sql = "SELECT `playlist`.`id` FROM `playlist` ";
break;
case 'flagged':
- $sql = "SELECT `flagged`.`id` FROM `flagged` "
- .$w;
+ $sql = "SELECT `flagged`.`id` FROM `flagged` ";
break;
case 'shoutbox':
- $sql = "SELECT `user_shout`.`id` FROM `user_shout` ".$w;
+ $sql = "SELECT `user_shout`.`id` FROM `user_shout` ";
break;
case 'playlist_song':
case 'song':
default:
- $sql = "SELECT DISTINCT `song`.`id` ".$megajoin;
+ $sql = "SELECT DISTINCT `song`.`id` FROM `song` ";
break;
} // end base sql
@@ -514,6 +515,83 @@ class Browse {
} // get_base_sql
/**
+ * get_filter_sql
+ * This returns the filter part of the sql statement
+ */
+ private static function get_filter_sql() {
+
+ if (!is_array($_SESSION['browse']['filter'][self::$type])) {
+ return '';
+ }
+
+ $sql = "WHERE 1=1 AND ";
+
+ foreach ($_SESSION['browse']['filter'][self::$type] as $key=>$value) {
+ $sql .= self::sql_filter($key,$value);
+ }
+
+ $sql = rtrim($sql,'AND ') . ' ';
+
+ return $sql;
+
+ } // get_filter_sql
+
+ /**
+ * get_sort_sql
+ * Returns the sort sql part
+ */
+ private static function get_sort_sql() {
+
+ if (!is_array($_SESSION['browse']['sort'][self::$type])) { return ''; }
+
+ $sql = 'ORDER BY ';
+
+ foreach ($_SESSION['browse']['sort'][self::$type] as $key=>$value) {
+ $sql .= self::sql_sort($key,$value);
+ }
+
+ $sql = rtrim($sql,'ORDER BY ');
+ $sql = rtrim($sql,',');
+
+ return $sql;
+
+ } // get_sort_sql
+
+ /**
+ * get_limit_sql
+ * This returns the limit part of the sql statement
+ */
+ private static function get_limit_sql() {
+
+ if (!self::is_simple_browse()) { return ''; }
+
+ $sql = ' LIMIT ' . intval(self::$start) . ',' . intval(self::$offset);
+
+ return $sql;
+
+ } // get_limit_sql
+
+ /**
+ * get_join_sql
+ * This returns the joins that this browse may need to work correctly
+ */
+ private static function get_join_sql() {
+
+ if (!is_array($_SESSION['browse']['join'][self::$type])) {
+ return '';
+ }
+
+ $sql = '';
+
+ foreach ($_SESSION['browse']['join'][self::$type] AS $join) {
+ $sql .= $join . ' ';
+ }
+
+ return $sql;
+
+ } // get_join_sql
+
+ /**
* get_sql
* This returns the sql statement we are going to use this has to be run
* every time we get the objects because it depends on the filters and the
@@ -523,44 +601,17 @@ class Browse {
$sql = self::get_base_sql();
- // No sense to go further if we don't have filters
- if (is_array($_SESSION['browse']['filter'][self::$type])) {
-
- // Foreach the filters and see if any of them can be applied
- // as part of a where statement in this sql (type dependent)
- $where_sql = "";
-
- foreach ($_SESSION['browse']['filter'][self::$type] as $key=>$value) {
- $where_sql .= self::sql_filter($key,$value);
- } // end foreach
- $sql .= $where_sql;
- } // if filters
-
// No matter what we have to check the catalog based filters... maybe I'm not sure about this
- $where_sql .= self::sql_filter('catalog','');
-
- $sql = rtrim($sql,'AND ');
- // Now Add the Order
- $order_sql = " ORDER BY ";
+ //$where_sql .= self::sql_filter('catalog','');
- // If we don't have a sort, then go ahead and return it now
- if (!is_array($_SESSION['browse']['sort'])) { return $sql; }
-
- foreach ($_SESSION['browse']['sort'] as $key=>$value) {
- $order_sql .= self::sql_sort($key,$value);
- }
- // Clean her up
- $order_sql = rtrim($order_sql,"ORDER BY ");
- $order_sql = rtrim($order_sql,",");
+ $filter_sql = self::get_filter_sql();
+ $join_sql = self::get_join_sql();
+ $order_sql = self::get_sort_sql();
+ $limit_sql = self::get_limit_sql();
- if (self::is_simple_browse()) {
- // When doing a simple browse we need to get the total otherwise paging won't work
- // so let's quickly do that before we add the limit
- $order_sql .= ' LIMIT ' . intval(self::$start) . ',' . intval(self::$offset);
- }
+ $final_sql = $sql . $join_sql . $filter_sql . $order_sql . $limit_sql;
- $sql = $sql . $order_sql;
- return $sql;
+ return $final_sql;
} // get_sql
@@ -603,28 +654,6 @@ class Browse {
private static function sql_filter($filter,$value) {
$filter_sql = '';
- //tag
- if ($filter == 'tag' && (
- $_SESSION['browse']['type'] == 'song'
- || $_SESSION['browse']['type'] == 'artist'
- || $_SESSION['browse']['type'] == 'album'
- )) {
- if (is_array($value) && sizeof($value))
- $vals = '(' . implode(',',$value) . ')';
- else if (is_integer($value))
- $vals = '('.$value.')';
- else return '';
- $or_sql = '';
- $object_type = $_SESSION['browse']['type'];
- if ($object_type == 'artist' || $object_type == 'album')
- $or_sql=" or (tag_map.object_id = song.id AND
- tag_map.object_type='song' )";
- if ($object_type == 'artist')
- $or_sql.= " or (tag_map.object_id = album.id AND
- tag_map.object_type='album' )";
- $filter_sql = " `tags`.`id` in $vals AND
- (($object_type.id = `tag_map`.`object_id` AND tag_map.object_type='$object_type') $or_sql) AND ";
- }
if (self::$type == 'song') {
switch($filter) {
@@ -638,10 +667,10 @@ class Browse {
$filter_sql = " `song`.`played`='0' AND ";
break;
case 'album':
- $filter_sql = " `album`.`id` = '". Dba::escape($value) . "' AND ";
+ $filter_sql = " `song`.`album` = '". Dba::escape($value) . "' AND ";
break;
case 'artist':
- $filter_sql = " `artist`.`id` = '". Dba::escape($value) . "' AND ";
+ $filter_sql = " `song`.`artist` = '". Dba::escape($value) . "' AND ";
break;
case 'catalog':
$catalogs = $GLOBALS['user']->get_catalogs();
@@ -761,6 +790,10 @@ class Browse {
case 'track':
$sql = "`song`.`track`";
break;
+ case 'album':
+ $sql = '`album`.`name`';
+ self::set_join('left','`album`','`album`.`id`','`song`.`id`');
+ break;
default:
// Rien a faire
break;
@@ -849,10 +882,10 @@ class Browse {
* and requires the correct template based on the
* type that we are currently browsing
*/
- public static function show_objects($object_ids=false, $ajax=false) {
+ public static function show_objects($object_ids=false) {
if (self::is_simple_browse()) {
- $object_ids = self::get_objects();
+ $object_ids = self::get_saved();
}
else {
$object_ids = $object_ids ? $object_ids : self::get_saved();
@@ -965,13 +998,17 @@ class Browse {
// table
self::$_cache['browse'][self::$type] = $object_ids;
- $sid = session_id() . '::' . self::$type;
- $data = Dba::escape(serialize($object_ids));
+ // Only do this if it's a not a simple browse
+ if (!self::is_simple_browse()) {
+ $sid = session_id() . '::' . self::$type;
+ $data = Dba::escape(serialize($object_ids));
+
+ $sql = "REPLACE INTO `tmp_browse` SET `data`='$data', `sid`='$sid'";
+ $db_results = Dba::write($sql);
- $sql = "REPLACE INTO `tmp_browse` SET `data`='$data', `sid`='$sid'";
- $db_results = Dba::write($sql);
+ self::$total_objects = count($object_ids);
+ } // save it
- self::$total_objects = count($object_ids);
return true;
} // save_objects
@@ -987,8 +1024,8 @@ class Browse {
// There are two ways to do this.. the easy way...
// and the vollmer way, hopefully we don't have to
// do it the vollmer way
- if (self::$simple_browse) {
- $sql = self::get_base_sql();
+ if (self::is_simple_browse()) {
+ $sql = self::get_sql();
}
else {
// First pull the objects
@@ -996,7 +1033,7 @@ class Browse {
// If there's nothing there don't do anything
if (!count($objects)) { return false; }
- $type = $_SESSION['browse']['type'];
+ $type = self::$type;
$where_sql .= "`$type`.`id` IN (";
foreach ($objects as $object_id) {
@@ -1009,18 +1046,17 @@ class Browse {
$sql = self::get_base_sql();
$sql .= $where_sql;
- }
+ $order_sql = " ORDER BY ";
- $order_sql = "ORDER BY ";
-
- foreach ($_SESSION['browse']['sort'] as $key=>$value) {
- $order_sql .= self::sql_sort($key,$value);
- }
- // Clean her up
- $order_sql = rtrim($order_sql,"ORDER BY ");
- $order_sql = rtrim($order_sql,",");
- $sql = $sql . $order_sql;
+ foreach ($_SESSION['browse']['sort'][self::$type] as $key=>$value) {
+ $order_sql .= self::sql_sort($key,$value);
+ }
+ // Clean her up
+ $order_sql = rtrim($order_sql,"ORDER BY ");
+ $order_sql = rtrim($order_sql,",");
+ $sql = $sql . $order_sql;
+ } // if not simple
$db_results = Dba::query($sql);
@@ -1043,7 +1079,6 @@ class Browse {
self::$offset = Config::get('offset_limit') ? Config::get('offset_limit') : '25';
-
} // _auto_init
public static function set_filter_from_request($r)
diff --git a/server/browse.ajax.php b/server/browse.ajax.php
index 3b553448..abc2e46b 100644
--- a/server/browse.ajax.php
+++ b/server/browse.ajax.php
@@ -29,7 +29,7 @@ switch ($_REQUEST['action']) {
$object_ids = array();
- Brosse::set_type($_REQUEST['type']);
+ Browse::set_type($_REQUEST['type']);
// Check 'value' with isset because it can null
//(user type a "start with" word and deletes it)
@@ -43,15 +43,9 @@ switch ($_REQUEST['action']) {
Browse::set_sort($_REQUEST['sort']);
}
- // Refresh the browse div with our new filter options if we're not static
- if (!Browse::$static_content) {
- $object_ids = Browse::get_objects();
- }
-
ob_start();
- Browse::show_objects($object_ids);
- $results['browse_content'] = ob_get_contents();
- ob_end_clean();
+ Browse::show_objects(false);
+ $results['browse_content'] = ob_get_clean();
break;
case 'set_sort':
@@ -61,13 +55,9 @@ switch ($_REQUEST['action']) {
Browse::set_sort($_REQUEST['sort']);
}
- // Refresh the browse div with our new hotness
- $object_ids = Browse::get_saved();
-
ob_start();
- Browse::show_objects($object_ids, true);
- $results['browse_content'] = ob_get_contents();
- ob_end_clean();
+ Browse::show_objects(false);
+ $results['browse_content'] = ob_get_clean();
break;
case 'delete_object':
switch ($_REQUEST['type']) {
@@ -99,7 +89,7 @@ switch ($_REQUEST['action']) {
Browse::set_start($_REQUEST['start']);
ob_start();
- Browse::show_objects(false,true);
+ Browse::show_objects(false);
$results['browse_content'] = ob_get_clean();
break;
diff --git a/templates/show_album.inc.php b/templates/show_album.inc.php
index 59ebe83a..e2f2e069 100644
--- a/templates/show_album.inc.php
+++ b/templates/show_album.inc.php
@@ -23,9 +23,8 @@ $web_path = Config::get('web_path');
$ajax_url = Config::get('ajax_url');
// Title for this album
-if ($album->disk)
-{
- $disk = "<span class=\"discnb disc" .$album->disk. "\">, " . _('Disk') . " " . $album->disk . "</span>";
+if ($album->disk) {
+ $disk = "<span class=\"discnb disc" .$album->disk. "\">, " . _('Disk') . " " . $album->disk . "</span>";
}
$title = scrub_out($album->name) . '&nbsp;(' . $album->year . ')' . $disk .'&nbsp;-&nbsp;' . $album->f_artist_link;
?>
@@ -86,6 +85,7 @@ $title = scrub_out($album->name) . '&nbsp;(' . $album->year . ')' . $disk .'&nb
</div>
<?php
Browse::set_type('song');
+ Browse::set_simple_browse(1);
Browse::set_filter('album', $album->id);
Browse::set_sort('track','ASC');
Browse::get_objects();
diff --git a/templates/show_songs.inc.php b/templates/show_songs.inc.php
index c868a306..9fc4e932 100644
--- a/templates/show_songs.inc.php
+++ b/templates/show_songs.inc.php
@@ -39,7 +39,7 @@ $ajax_url = Config::get('ajax_url');
<th class="cel_add"><?php echo _('Add'); ?></th>
<th class="cel_song"><?php echo Ajax::text('?page=browse&action=set_sort&type=song&sort=title',_('Song Title'),'sort_song_title'); ?></th>
<th class="cel_artist"><?php echo _('Artist'); ?></th>
- <th class="cel_album"><?php echo _('Album'); ?></th>
+ <th class="cel_album"><?php echo Ajax::text('?page=browse&action=set_sort&type=song&sort=album',_('Album'),'sort_song_album'); ?></th>
<th class="cel_tags"><?php echo _('Tags'); ?></th>
<th class="cel_track"><?php echo Ajax::text('?page=browse&action=set_sort&type=song&sort=track',_('Track'),'sort_song_track'); ?></th>
<th class="cel_time"><?php echo Ajax::text('?page=browse&action=set_sort&type=song&sort=time',_('Time'),'sort_song_time'); ?></th>
diff --git a/templates/show_users.inc.php b/templates/show_users.inc.php
index 92f78804..3cf4ad5a 100644
--- a/templates/show_users.inc.php
+++ b/templates/show_users.inc.php
@@ -36,9 +36,9 @@ $web_path = Config::get('web_path');
<col id="col_online" />
</colgroup>
<tr class="th-top">
- <th class="cel_username"><?php echo Ajax::text('?page=browse&action=set_sort&sort=fullname',_('Fullname'),'users_sort_fullname'); ?>( <?php echo Ajax::text('?page=browse&action=set_sort&sort=username',_('Username'),'users_sort_username');?>)</th>
- <th class="cel_lastseen"><?php echo Ajax::text('?page=browse&action=set_sort&sort=last_seen',_('Last Seen'),'users_sort_lastseen'); ?></th>
- <th class="cel_registrationdate"><?php echo Ajax::text('?page=browse&action=set_sort&sort=create_date',_('Registration Date'),'users_sort_createdate'); ?></th>
+ <th class="cel_username"><?php echo Ajax::text('?page=browse&action=set_sort&type=user&sort=fullname',_('Fullname'),'users_sort_fullname'); ?>( <?php echo Ajax::text('?page=browse&action=set_sort&type=user&sort=username',_('Username'),'users_sort_username');?>)</th>
+ <th class="cel_lastseen"><?php echo Ajax::text('?page=browse&action=set_sort&type=user&sort=last_seen',_('Last Seen'),'users_sort_lastseen'); ?></th>
+ <th class="cel_registrationdate"><?php echo Ajax::text('?page=browse&action=set_sort&type=user&sort=create_date',_('Registration Date'),'users_sort_createdate'); ?></th>
<th class="cel_activity"><?php echo _('Activity'); ?></th>
<?php if (Config::get('track_user_ip')) { ?>
<th class="cel_lastip"><?php echo _('Last Ip'); ?></th>
@@ -101,9 +101,9 @@ foreach ($object_ids as $user_id) {
</tr>
<?php } //end foreach users ?>
<tr class="th-bottom">
- <th class="cel_username"><?php echo Ajax::text('?page=browse&action=set_sort&sort=fullname',_('Fullname'),'users_sort_fullname1'); ?>( <?php echo Ajax::text('?page=browse&action=set_sort&sort=username',_('Username'),'users_sort_username1');?>)</th>
- <th class="cel_lastseen"><?php echo Ajax::text('?page=browse&action=set_sort&sort=last_seen',_('Last Seen'),'users_sort_lastseen1'); ?></th>
- <th class="cel_registrationdate"><?php echo Ajax::text('?page=browse&action=set_sort&sort=create_date',_('Registration Date'),'users_sort_createdate1'); ?></th>
+ <th class="cel_username"><?php echo Ajax::text('?page=browse&action=set_sort&type=user&sort=fullname',_('Fullname'),'users_sort_fullname1'); ?>( <?php echo Ajax::text('?page=browse&action=set_sort&type=user&sort=username',_('Username'),'users_sort_username1');?>)</th>
+ <th class="cel_lastseen"><?php echo Ajax::text('?page=browse&action=set_sort&type=user&sort=last_seen',_('Last Seen'),'users_sort_lastseen1'); ?></th>
+ <th class="cel_registrationdate"><?php echo Ajax::text('?page=browse&action=set_sort&type=user&sort=create_date',_('Registration Date'),'users_sort_createdate1'); ?></th>
<th class="cel_activity"><?php echo _('Activity'); ?></th>
<?php if (Config::get('track_user_ip')) { ?>
<th class="cel_lastip"><?php echo _('Last Ip'); ?></th>
diff --git a/templates/sidebar_home.inc.php b/templates/sidebar_home.inc.php
index 4c483575..114cb256 100644
--- a/templates/sidebar_home.inc.php
+++ b/templates/sidebar_home.inc.php
@@ -43,15 +43,15 @@ $ajax_info = Config::get('ajax_url'); $web_path = Config::get('web_path');
<?php if (in_array('starts_with',$allowed_filters)) { ?>
<form id="multi_alpha_filter_form" method="post" action="javascript:void(0);">
<label id="multi_alpha_filterLabel" for="multi_alpha_filter"><?php echo _('Starts With'); ?></label>
- <input type="textbox" id="multi_alpha_filter" name="multi_alpha_filter" value="<?php echo scrub_out(Browse::get_filter('starts_with')); ?>" onKeyUp="DelayRun(this,'400','ajaxState','<?php echo Config::get('ajax_url'); ?>?page=browse&action=browse&key=starts_with','multi_alpha_filter');">
+ <input type="textbox" id="multi_alpha_filter" name="multi_alpha_filter" value="<?php echo scrub_out(Browse::get_filter('starts_with')); ?>" onKeyUp="DelayRun(this,'400','ajaxState','<?php echo Config::get('ajax_url'); ?>?page=browse&action=browse&type=<?php echo Browse::get_type(); ?>&key=starts_with','multi_alpha_filter');">
</form>
<?php } // end if alpha_match ?>
<?php if (in_array('minimum_count',$allowed_filters)) { ?>
- <input id="mincountCB" type="checkbox" onclick="ajaxPut('<?php echo $ajax_info; ?>?action=browse&amp;key=min_count&amp;value=1');return true;" value="1" />
+ <input id="mincountCB" type="checkbox" onclick="ajaxPut('<?php echo $ajax_info; ?>?action=browse&amp;key=min_count&amp;type=<?php echo Browse::get_type(); ?>&amp;value=1');return true;" value="1" />
<label id="mincountLabel" for="mincountCB"><?php echo _('Minimum Count'); ?></label><br />
<?php } ?>
<?php if (in_array('rated',$allowed_filters)) { ?>
- <input id="ratedCB" type="checkbox" onclick="ajaxPut('<?php echo $ajax_info; ?>?action=browse&amp;key=rated&amp;value=1');return true;" value="1" />
+ <input id="ratedCB" type="checkbox" onclick="ajaxPut('<?php echo $ajax_info; ?>?action=browse&amp;type=<?php echo Browse::get_type(); ?>&amp;key=rated&amp;value=1');return true;" value="1" />
<label id="ratedLabel" for="ratedCB"><?php echo _('Rated'); ?></label><br />
<?php } ?>
<?php if (in_array('unplayed',$allowed_filters)) { ?>
@@ -61,12 +61,12 @@ $ajax_info = Config::get('ajax_url'); $web_path = Config::get('web_path');
<?php if (in_array('show_art',$allowed_filters)) { ?>
<input id="show_artCB" type="checkbox" <?php echo $string = Browse::get_filter('show_art') ? 'checked="checked"' : ''; ?>/>
<label id="show_artLabel" for="show_artCB"><?php echo _('Show Art'); ?></label><br />
- <?php echo Ajax::observe('show_artCB','click',Ajax::action('?page=browse&action=browse&key=show_art&value=1','')); ?>
+ <?php echo Ajax::observe('show_artCB','click',Ajax::action('?page=browse&action=browse&type=' . Browse::get_type() . '&key=show_art&value=1','')); ?>
<?php } // if show_art ?>
<?php if (in_array('playlist_type',$allowed_filters)) { ?>
<input id="show_allplCB" type="checkbox" <?php echo $string = Browse::get_filter('playlist_type') ? 'checked="checked"' : ''; ?>/>
<label id="show_allplLabel" for="showallplCB"><?php echo _('All Playlists'); ?></label><br />
- <?php echo Ajax::observe('show_allplCB','click',Ajax::action('?page=browse&action=browse&key=playlist_type&value=1','')); ?>
+ <?php echo Ajax::observe('show_allplCB','click',Ajax::action('?page=browse&action=browse&type=' . Browse::get_type() . '&key=playlist_type&value=1','')); ?>
<?php } // if playlist_type ?>
</div>
</li>