Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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

  • 2 months later...

Did you ever find the answer? I am wondering the same thing and would appreciate it if I could see the code.

  • 2 weeks later...
  • Author

I used the code in the FM Web Publishing guide that accompanies FX.php.

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.

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 by Guest

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.