Site Map

 

iCents.IsLocked and iCents.IsUnlocked Functions

The unlock attribute of a paid-link indicates the absolute URL for the content that must be unlocked for access when the link is paid. The content will then be unlocked for the period of time indicated by the duration attribute.

The iCents.IsLocked function returns true if a given content is currently unlocked. iCents.IsUnlocked is the opposite, and returns true if a given content is locked at the moment. Pass the content URL as a function parameter.

Pass true or false as a second function parameter to indicate whether or not the function must ignore the fact that iCents was turned off on the page. This situation may have taken place if the iCents.TurnOff function was called.

Pass true or false as a third function parameter to indicate whether or not the function should accept payments made with test accounts.

Syntax:

iCents.IsLocked(URL, ignore turn off or not, accept test account payments or not)

iCents.IsUnlocked(URL, ignore turn off or not, accept test account payments or not)

 

For example:

iCents.IsLocked("http://example.com/test.html", true, true)