You are here

function jcarousel_getItems in jCarousel 6

This function returns the items. Typically, this would fetch it from a database (SELECT * FROM items LIMIT $limit OFFSET $offset) or from a directory.

2 calls to jcarousel_getItems()
index.php in jcarousel/examples/bestpractice/index.php
jcarousel_ajax.php in jcarousel/examples/bestpractice/jcarousel_ajax.php

File

jcarousel/examples/bestpractice/jcarousel_functions.php, line 64

Code

function jcarousel_getItems($limit = null, $offset = null) {
  global $jcarousel_items;

  // Copy items over
  $return = $jcarousel_items;
  if ($offset !== null) {
    $return = array_slice($return, $offset);
  }
  if ($limit !== null) {
    $return = array_slice($return, 0, $limit);
  }
  return $return;
}