Welcome to Geeklog, Anonymous Monday, December 23 2024 @ 10:37 am EST

Geeklog Forums

How to 'LIMIT" along list ??


Jisam

Anonymous
indescribable
List of forum topics or any topics can become really very long eg . recent topics list : ...

How to add something like LIMIT in the forum/index.php probably inthe following area so that the list becomes small

if ($orderby == 'subject') {
$order = "ORDER BY subject ASC";
} elseif ($orderby == 'date') {
$order = "ORDER BY lastupdated DESC";
} elseif ($orderby == 'views') {
$order = "ORDER BY views DESC";
} elseif ($orderby == 'replies') {
$order = "ORDER BY replies DESC";
} else {
$order = "ORDER BY lastupdated DESC";
}


Any help will be very much appreciated. :helpme
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Well, you can of course simply add a "LIMIT 10" (for example) after any of those, but then you will only ever see the first couple of entries. Adding something like paging is a non-trivial task ...

bye, Dirk
 Quote

Jisam

Anonymous
Thanks Dirk.

But limiting to say for example 10 or 20 etc will reduce
the load on resource usage Won't it ??

BTW, how trivial is paging Confused
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by: Jisam But limiting to say for example 10 or 20 etc will reduce the load on resource usage Won't it ??

If that's what you're after (it wasn't clear from your post) - sure.


Quote by: Jisam BTW, how trivial is paging Confused

I said non-trivial. And I mean it ...

bye, Dirk
 Quote

All times are EST. The time is now 10:37 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content