summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpb1dft <pb1dft@ampache>2007-02-27 18:12:42 +0000
committerpb1dft <pb1dft@ampache>2007-02-27 18:12:42 +0000
commit055195b302f0a2521a8b3a7f57e385a2aa03fdc2 (patch)
tree84077ad5b5912c597b7ff8dd263a9ca8c7629e4d
parent28adccb76ae99f07cb8ca9e39355ab916b2b2f83 (diff)
downloadampache-055195b302f0a2521a8b3a7f57e385a2aa03fdc2.tar.gz
ampache-055195b302f0a2521a8b3a7f57e385a2aa03fdc2.tar.bz2
ampache-055195b302f0a2521a8b3a7f57e385a2aa03fdc2.zip
Updated all offset_limit refs to ->pref['offset_limit']
-rw-r--r--admin/users.php4
-rw-r--r--albums.php2
-rw-r--r--artists.php2
-rw-r--r--browse.php6
-rw-r--r--lib/artist.lib.php2
-rw-r--r--lib/class/user.class.php14
-rw-r--r--preferences.php2
-rw-r--r--templates/show_user.inc.php6
8 files changed, 9 insertions, 29 deletions
diff --git a/admin/users.php b/admin/users.php
index 8096001d..75a280cf 100644
--- a/admin/users.php
+++ b/admin/users.php
@@ -193,7 +193,7 @@ switch ($action) {
$sql = "SELECT `id`,`last_seen` FROM `user` where last_seen <= $inactive";
$db_results = mysql_query($sql,dbh());
$total_items = mysql_num_rows($db_results);
- $view = new View($sql,'admin/users.php','fullname',$total_items,$_SESSION['userdata']['offset_limit']);
+ $view = new View($sql,'admin/users.php','fullname',$total_items,$user->prefs['offset_limit']);
}
$users = get_users($view->sql);
@@ -213,7 +213,7 @@ switch ($action) {
$sql = "SELECT `id` FROM `user`";
$db_results = mysql_query($sql,dbh());
$total_items = mysql_num_rows($db_results);
- $view = new View($sql,'admin/users.php','fullname',$total_items,$_SESSION['userdata']['offset_limit']);
+ $view = new View($sql,'admin/users.php','fullname',$total_items,$user->prefs['offset_limit']);
}
$users = get_users($view->sql);
diff --git a/albums.php b/albums.php
index a2237875..4fc1f31c 100644
--- a/albums.php
+++ b/albums.php
@@ -267,7 +267,7 @@ switch ($action) {
if (!$sort_order) { $sort_order = 'name'; }
$db_results = mysql_query($sql, dbh());
$total_items = mysql_num_rows($db_results);
- if ($match != "Show_all") { $offset_limit = $_SESSION['userdata']['offset_limit']; }
+ if ($match != "Show_all") { $offset_limit = $user->prefs['offset_limit']; }
$view = new View($sql, 'albums.php',$sort_order,$total_items,$offset_limit);
}
diff --git a/artists.php b/artists.php
index 03420e58..8e3241e8 100644
--- a/artists.php
+++ b/artists.php
@@ -234,7 +234,7 @@ switch($action) {
show_artists();
}
elseif ($match === "Show_all") {
- $_SESSION['view_offset_limit'] = 999999;
+ $offset_limit = 999999;
show_artists();
}
else {
diff --git a/browse.php b/browse.php
index 61981358..dea6bf02 100644
--- a/browse.php
+++ b/browse.php
@@ -62,7 +62,7 @@ switch($action) {
elseif ($sql) {
$db_results = mysql_query($sql, dbh());
$total_items = mysql_num_rows($db_results);
- if ($match != "Show_all") { $offset_limit = $_SESSION['userdata']['offset_limit']; }
+ if ($match != "Show_all") { $offset_limit = $user->prefs['offset_limit']; }
$view = new View($sql, 'albums.php','name',$total_items,$offset_limit);
}
@@ -95,7 +95,7 @@ switch($action) {
$db_results = mysql_query($sql, dbh());
$total_items = mysql_num_rows($db_results);
$offset_limit = 999999;
- if ($match != 'Show_All') { $offset_limit = $_SESSION['userdata']['offset_limit']; }
+ if ($match != 'Show_All') { $offset_limit = $user->prefs['offset_limit']; }
$view = new View($sql, 'browse.php?action=genre','name',$total_items,$offset_limit);
}
@@ -133,7 +133,7 @@ switch($action) {
$db_results = mysql_query($sql, dbh());
$total_items = mysql_num_rows($db_results);
$offset_limit = 999999;
- if ($match != 'Show All') { $offset_limit = $_SESSION['userdata']['offset_limit']; }
+ if ($match != 'Show All') { $offset_limit = $user->prefs['offset_limit']; }
$view = new View($sql, 'browse.php?action=song_title','title',$total_items,$offset_limit);
}
diff --git a/lib/artist.lib.php b/lib/artist.lib.php
index e3acd57d..6d83a442 100644
--- a/lib/artist.lib.php
+++ b/lib/artist.lib.php
@@ -99,7 +99,7 @@ function show_artists ($match = '') {
$offset_limit = 999999;
}
else {
- $offset_limit = $_SESSION['userdata']['offset_limit'];
+ $offset_limit = $user->prefs['offset_limit'];
}
$view = new View($query,'artists.php','name',$total_items,$offset_limit);
diff --git a/lib/class/user.class.php b/lib/class/user.class.php
index 9ff68a15..804a5819 100644
--- a/lib/class/user.class.php
+++ b/lib/class/user.class.php
@@ -33,7 +33,6 @@ class User {
var $fullname;
var $access;
var $disabled;
- var $offset_limit=25;
var $email;
var $last_seen;
var $create_date;
@@ -61,7 +60,6 @@ class User {
$this->fullname = $info->fullname;
$this->access = $info->access;
$this->disabled = $info->disabled;
- $this->offset_limit = $info->offset_limit;
$this->email = $info->email;
$this->last_seen = $info->last_seen;
$this->create_date = $info->create_date;
@@ -413,18 +411,6 @@ class User {
} // update_email
- /*!
- @function update_offset
- @discussion this updates the users offset_limit
- */
- function update_offset($new_offset) {
-
- $new_offset = sql_escape($new_offset);
- $sql = "UPDATE user SET offset_limit='$new_offset' WHERE `id`='$this->id'";
- $db_results = mysql_query($sql, dbh());
-
- } // update_offset
-
/**
* disable
* This disables the current user
diff --git a/preferences.php b/preferences.php
index ff92f4a8..b5b92c0e 100644
--- a/preferences.php
+++ b/preferences.php
@@ -46,7 +46,7 @@ switch(scrub_in($_REQUEST['action'])) {
$this_user = new User($user_id);
$this_user->update_fullname($_REQUEST['fullname']);
$this_user->update_email($_REQUEST['email']);
- $this_user->update_offset($_REQUEST['offset_limit']);
+
/* Check for password change */
if ($_REQUEST['password1'] !== $_REQUEST['password2'] && !empty($_REQUEST['password1'])) {
diff --git a/templates/show_user.inc.php b/templates/show_user.inc.php
index 634a8d19..82b965ae 100644
--- a/templates/show_user.inc.php
+++ b/templates/show_user.inc.php
@@ -33,12 +33,6 @@
</td>
</tr>
<tr>
- <td><?php echo _('Results Per Page'); ?>:</td>
- <td>
- <input type="text" name="offset_limit" size="3" value="<?php echo scrub_out($this_user->offset_limit); ?>" />
- </td>
-</tr>
-<tr>
<td><?php echo _('New Password'); ?>:</td>
<td>
<?php $GLOBALS['error']->print_error('password'); ?>