GetRandomChild

Uses GetChildList to retrieve a list of a given parent page's children and selects one ID at random.

Prototype

function GetRandomChild($ParentPageID, $UserID)

Parameters

  • $ParentPageID - the page whose children you're trying to find
  • $UserID - the user that should be used to determine page permissions and visibility

Return Values

If there are children available the function returns an integer representing the page ID of a randomly chose child of the given parent page.  If there are not children to choose from the function returns NULL.