March 9, 200718 yr Hi there, In the following code, what goes in the "Empty Reference!" brackets: Page: -*-* <?php $pages=ceil($returnedCount/$groupSize); if($pages>'1'){ $i='1'; $x='0';?> <? echo $i; ?> <? while($i<$pages){ $x=$i*$groupSize; $i++; echo ' | ' ?><? echo $i; ?> <? } } ?> Also, what is the following code for: -*-* The final effect should look like this: Page: 1 | 2 | 3 | 4 where the numbers are links to further pages of search results. Cheers, Steven
May 17, 200718 yr Did you ever find the answer? I am wondering the same thing and would appreciate it if I could see the code.
May 31, 200718 yr It should be the page your search results are on... ie) what you are trying to do is create a search that looks like: searchresults.php?i=1 etc.
May 31, 200718 yr I ended up using some other code. Here it is if anyone's interested: [color:green]function draw_pager($url, $total_pages, $current_page, $groupSize) { $URLExtend = '&org_unit='.$_POST['org_unit'].'&department='.$_POST['department'].'&jobFamiliesCombined='.$_POST['jobFamiliesCombined'].'&examplesCombined='.$_POST['examplesCombined'].'&areas_of_education='.$_POST['areas_of_education'].'&areas_other='.$_POST['areas_other'].'&category_employment='.$_POST['category_employment'].'&-lop='.$_POST['-lop'].'&go=Find+Records&-sortfield_1='.$_POST['-sortfield_1'].'&-sortorder_1='.$_POST['-sortorder_1'].'&'; if ( $current_page <= 0 || $current_page > $total_pages ) { $current_page = 1; } if ( $current_page > 1 ) { printf( "[start] n" , 0, 1); printf( "[Prev] n" , ($current_page - 1) * $groupSize, ($current_page-1)); } for( $i = ($current_page-5); $i <= $current_page+5; $i++ ) { $skip = ($i - 1) * $groupSize; if ($i < 1) continue; if ( $i > $total_pages ) break; if ( $i != $current_page ) { printf( "%2$d n" , $skip, $i); } else { printf("%2$d n", $skip, $i); } } if ( $current_page < $total_pages ) { printf( "[Next] n", $current_page * $groupSize, ($current_page+1)); printf( "[End] n", ($total_pages - 1) * $groupSize, $total_pages); } } $groupSize = 10; $pageGroupSize = 2; $pages = ceil($searchResults['foundCount']/$groupSize); $groups = ceil($pages/$pageGroupSize); $url = 'https://domain.edu/ii/search.php'; $current_page = isset($_POST['page']) ? $_POST['page'] 1; draw_pager($url, $pages, $current_page, $groupSize) ?>[/color] Edited May 31, 200718 yr by Guest
Create an account or sign in to comment