[SOLVED] Smarty: People who are Familiar, I was wo
Moderator: General Moderators
- NewfieBilko
- Forum Contributor
- Posts: 189
- Joined: Sun Jun 06, 2004 6:45 pm
- Location: Newfoundland
- Contact:
- NewfieBilko
- Forum Contributor
- Posts: 189
- Joined: Sun Jun 06, 2004 6:45 pm
- Location: Newfoundland
- Contact:
- NewfieBilko
- Forum Contributor
- Posts: 189
- Joined: Sun Jun 06, 2004 6:45 pm
- Location: Newfoundland
- Contact:
- NewfieBilko
- Forum Contributor
- Posts: 189
- Joined: Sun Jun 06, 2004 6:45 pm
- Location: Newfoundland
- Contact:
- NewfieBilko
- Forum Contributor
- Posts: 189
- Joined: Sun Jun 06, 2004 6:45 pm
- Location: Newfoundland
- Contact:
Oh yea, i've run into another little snag... Say i go maxrecords to 100, viewing 100 entries.. Then I hit the "NEXT" link which I have put in &maxRecords={maxRecords}, but instead of showing 100, it will go back to default of 10!!!!... I tried putting this code into my UsersGrid.php:
But it doesn't seem to do much.
The maxRecords in the link NEXT does pass 5 as the variable from the last update of max, but when it hit it, it ignores and just goes back to 10. I also noticed my offset is raising by 10 everytime for this regardless
Code: Select all
<?php
if(isset($_REQUEST["maxRecords"])) {
$maxRecords == $_REQUEST["maxrecords"];
}
?>The maxRecords in the link NEXT does pass 5 as the variable from the last update of max, but when it hit it, it ignores and just goes back to 10. I also noticed my offset is raising by 10 everytime for this regardless
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Code: Select all
<?php
if(isset($_REQUEST["maxRecords"])) {
$maxRecords = $_REQUEST["maxrecords"];
}
?>Code: Select all
$maxRecords = isset($_REQUEST['maxRecords']) ? $_REQUEST['maxRecords'] : MAX_RECORDS_DEFAULT;- NewfieBilko
- Forum Contributor
- Posts: 189
- Joined: Sun Jun 06, 2004 6:45 pm
- Location: Newfoundland
- Contact:
- NewfieBilko
- Forum Contributor
- Posts: 189
- Joined: Sun Jun 06, 2004 6:45 pm
- Location: Newfoundland
- Contact:
hmm, sorry,nevermind, it works for the first Click of NEXT, but on the second click, the origional value gets put back into place, showing 10...
in my .php i have :
and in the html of the next I have:
and finally in my setup.php i have:
Now, like i said.. I put 5 into the input, works fine, calls 5.. Then i hit next, it shows a maxrecord in the URL of 5, and next is displayed fine.. The 2nd time, it shows this url:
/frmUsersGrid.php?&offset=10&sort_mode=login_desc&maxRecords=10
Its either defaulting back to 10 because there is no holder, OR the offset is triggering it?
in my .php i have :
Code: Select all
<?php
if(isset($_REQUEST["maxRecords"])) {
$maxRecords = isset($_REQUEST['maxRecords']) ? ($_REQUEST['maxRecords']) : MAX_RECORDS_DEFAULT;
}
?>Code: Select all
<?php
{if $prev_offset >= 0}
[<a class="link" href="frmUsersGrid.php?&offset={$prev_offset}&sort_mode={$sort_mode}&maxRecords={$maxRecords}">{tr}PREVIOUS{/tr}</a>]
{/if}
{tr}Page{/tr}: {$actual_page}/{$cant_pages}
{if $next_offset >= 0}
[<a class="link" href="frmUsersGrid.php?&offset={$next_offset}&sort_mode={$sort_mode}&maxRecords={$maxRecords}">{tr}NEXT{/tr}</a>]
{/if}
?>and finally in my setup.php i have:
Code: Select all
<?php
if(!empty($_POST['maxRecords']) && ctype_digit($_POST['maxRecords']) && $_POST['maxRecords'] > 0){
$maxRecords = $_POST['maxRecords'];
} else {
$maxRecords = 10;
}
$smarty->assign('maxRecords',$maxRecords);
?>
?>/frmUsersGrid.php?&offset=10&sort_mode=login_desc&maxRecords=10
Its either defaulting back to 10 because there is no holder, OR the offset is triggering it?
- NewfieBilko
- Forum Contributor
- Posts: 189
- Joined: Sun Jun 06, 2004 6:45 pm
- Location: Newfoundland
- Contact: