Paul, unless there possibly more to this picture, I do not see the same issue without modification?
When I go to user settings, the Display Max had 50 in the field.
I changed that to 55, clicked Modify, and the www_users table reflected 55.
Then changed again to 60, clicked Modify, and the table column reflected 60.
Is there more to know?
It seems that lines 109-111 (in the existing file) is part of the (initial) handling?
=====
UPDATE:
Never mind, I think I found it. Although the value saves to the table, upon RETURN to the user's settings, then the field Display Max field shows 50 again, instead of the table value, as in my example, should have been 60... is this correct?
I believe that the change may be easier than expected.
I made this minor change, and then 60 appears as expected for me:
Change this:
PHP Code:
If (!isset($_POST['DisplayRecordsMax']) OR $_POST['DisplayRecordsMax']=='') { $_POST['DisplayRecordsMax'] = $_SESSION['DefaultDisplayRecordsMax']; }
...to this:
PHP Code:
If (!isset($_POST['DisplayRecordsMax']) OR $_POST['DisplayRecordsMax']=='') { $_POST['DisplayRecordsMax'] = $_SESSION['DisplayRecordsMax']; // session index change }
POST will never be set when first entering the script, and the 'DefaultDisplayRecordsMax' will always be 50 (or whatever that setting might have).
The 'DisplayRecordsMax' is set at UserLogin (lines 123-127), and in the UserSettings file the same field is updated after Modify at line 94.
Paul T I remember solving this in my code a while back. Unfortunately I am not at my computer right now but if you look back at that file in my github repository you should see the solution.
What your code has is an improvement of existing handling, but we basically have the same change.
The conditional block that I added to post 5 can be eliminated, and use the $_SESSION['DisplayRecordsMax'] directly to set the 'value' as your code has, instead of populating the POST (in the condition) and then use the POST to set the 'value'.
=====
Paul B., so the post 5 change can be ignored, as that entire condition block will be eliminated, but the new handling is:
Change line 123 from this:
PHP Code:
<td><input class="integer" maxlength="3" name="DisplayRecordsMax" required="required" size="3" title="', _('The input must be positive integer'), '" type="text" value="', $_POST['DisplayRecordsMax'], '" /></td>
...to this: (near the end)
PHP Code:
<td><input class="integer" maxlength="3" name="DisplayRecordsMax" required="required" size="3" title="', _('The input must be positive integer'), '" type="text" value="', $_SESSION['DisplayRecordsMax'], '" /></td>
Yes, using DisplayRecordsMax was the fix it applied that reminded me. In fact it came to light because of a post the other Paul made to this forum about the number of displayed records. Thanks for thememory prompt