WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.9 R24 is now available!


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.13.x) »
  • Modules »
  • OneForAll AnyItems snippet - skip first 1, 2 or 3 items?
  • Print
Pages: [1]   Go Down

Author Topic: OneForAll AnyItems snippet - skip first 1, 2 or 3 items?  (Read 99 times)

Offline CodeALot

  • Posts: 605
  • Gender: Male
OneForAll AnyItems snippet - skip first 1, 2 or 3 items?
« on: October 29, 2025, 10:11:34 PM »
I'd like to use the OneForAll Anyitems where it reads the records of a OFA section but skips the first X items. Any tips on how to achieve that? Maybe another parameter to tell Anyitems to do that?
Logged

Offline sternchen8875

  • Global Moderator
  • *****
  • Posts: 665
Re: OneForAll AnyItems snippet - skip first 1, 2 or 3 items?
« Reply #1 on: October 30, 2025, 01:39:54 AM »
i think, its a easy job, but i cannot test it

i add a 4th parameter and call it offset. offset specifies, how many records to skip from the beginning of a result set before starting to return the data

the other parameters

section_id - the section_id  ;-)
limit - How many items do you want to show?
order - true == ASC, false == DESC

some examples

the first 3 items
Code: [Select]
oneforall_anyitems(123, 3);
or
Code: [Select]
oneforall_anyitems(123, 3, true, 0);
the next 3 items, but not item #1 - #3
Code: [Select]
oneforall_anyitems(123, 3, true, 3); // LIMIT 3, OFFSET 3
only item #5
Code: [Select]
oneforall_anyitems(123, 1, true, 4); // LIMIT 1, OFFSET 4
i hope, it works
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.13.x) »
  • Modules »
  • OneForAll AnyItems snippet - skip first 1, 2 or 3 items?
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2