max number of pages

Hello Experts,

in osCommerce i wish to limit number of pages in the products_new.php.
currently the "product new" page shows all the products in the shop (5 pages) and i am trying to figure out how to set it to max 2 pages.

i guess this part of code i have attached is what deals with the "MAX_DISPLAY_PAGE_LINKS". any one knows how to add a max?

  $products_new_array = array();

  $products_new_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added DESC, pd.products_name";
 //Replace the 12 by MAX_DISPLAY_PRODUCTS_NEW  to show 9 products in a page. 
  $products_new_split = new splitPageResults($products_new_query_raw, 20);

  if (($products_new_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3'))) {
<div class="page_counter"><?php echo /*sprintf(TEXT_STYLES_FOUND, $products_new_split->number_of_rows) .'&nbsp;&nbsp;'*/ TEXT_RESULT_PAGE . $products_new_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></div>     

Open in new window

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Paolo SantiangeliConsulente InformaticoCommented:
Did you try configuration >> Maximum Values >> New Products Listing from administration?

RefaelAuthor Commented:
the thing is... the the values set there are different then the pages that are actually being counted. so i it does not apply to the page. therefore it will be better to set it from within?  
Paolo SantiangeliConsulente InformaticoCommented:
if i got it... you have to change thi line:
  $products_new_split = new splitPageResults($products_new_query_raw, 20);

with this one:
  $products_new_split = new splitPageResults($products_new_query_raw, MAX_DISPLAY_PRODUCTS_NEW);

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.