Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Author Topic: How to add individual article limit for individual pages?  (Read 2007 times)

amak

  • Newbie
  • *
  • Karma: 4
  • Posts: 40
How to add individual article limit for individual pages?
« on: May 11, 2007, 10:15:48 am »

Hi,

i'm just playing with snews and i'd like to have the following situation:

On all pages the predefined 'article_limit' from the table 'settings' should be used - works as intended. I've just set it to 1 for having it like a printed book ... each article is like one page in a book.

But:

If a user visits the 'Homepage' (like just calling domain.com or like the classic index.php) the predefined value of 1 from the db should be replaced by 5.

Any hints for me how to change this statically in the script (using the newest version).

Thanks for any help!
Logged
Regards,
Amak

amak

  • Newbie
  • *
  • Karma: 4
  • Posts: 40
How to add individual article limit for individual pages?
« Reply #1 on: May 11, 2007, 10:43:05 am »

Hmm .. seems to be solved by myself:

I've added:

Code: [Select]
if ($home == 'home' && $use_cat_id == '0') {
$article_limit = 5;
}
right before

Code: [Select]
$query_articles .= " LIMIT ".($currentPage - 1) * $article_limit.", ".$article_limit;Just testing it further now.
Logged
Regards,
Amak