brainonastick Posted March 9, 2007 Posted March 9, 2007 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
Moe Posted May 17, 2007 Posted May 17, 2007 Did you ever find the answer? I am wondering the same thing and would appreciate it if I could see the code.
brainonastick Posted May 28, 2007 Author Posted May 28, 2007 I used the code in the FM Web Publishing guide that accompanies FX.php.
mlindal Posted May 31, 2007 Posted May 31, 2007 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.
Moe Posted May 31, 2007 Posted May 31, 2007 (edited) 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, 2007 by Guest
Recommended Posts
This topic is 6455 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now