Random Number

Developer

Laisvunas

3rd Party (Commercial)


EE Version Support

  • ExpressionEngine 1.x
  • ExpressionEngine 2

Compatibility

If an item is crossed out, it might be untested, not applicable or incompatible. Contact the developer to be sure.

  • Updater
  • Multi Site Manager
  • Stand Alone Entry Form
  • Low Variables
  • Content Elements
  • Better Workflow
  • Matrix
  • Grid
  • Webservice
  • Publisher

Requirements

  • jQuery for the Control Panel

Add-On Type(s)

Plugin

Tags

Random Number allows you to output random numbers.

PARAMETERS

1) min - Optional. Allows you to specify the lowest number to return.
Default value is “1”.

2) max - Optional. Allows you to specify the highest number to return.
Default value is “50”.

3) invalid_input - Optional. Accepts two values: “alert” and “silence”.
Default value is “silence”. If the value is “alert”, then in cases when
the plugin has some problem with parameters,  PHP alert is being shown;
if the value is “silence”, then in cases when the plugin has
some problem with parameters, it finishes its work without any alert being shown.
Set this parameter to “alert” for development, and to “silence” - for deployment.

VARIABLES

The plugin supports one hundred variables of the type outlined below:

{random_number_0}, {random_number_1}, {random_number_2}, {random_number_3}, ...
{random_number_10}, {random_number_11}, {random_number_13}, ..., {random_number_99}

The numbers at the end of variables are used only to differentiate
variables from each other.

Conditionals are supported.

EXAMPLE OF USAGE

{exp:random_number min="1" max="10"}

{if random_number_0 > 5}

Some code

{if:else}

Some code

{/if}

{/exp:random_number}

A more complicated example - Random Number plugin together with Child Categories and Category Info plugins used to output three random categories:


{exp:cat_info category_id="179" parse="inward"}
{exp:random_number min="1" max="{cat_info_nonempty_subcategories_number}" parse="inward"}
{exp:child_categories parent="179" child_categories_sort_by="name" child_categories_sort_direction="asc" show_empty="no" entries_sort_by="date" entries_sort_direction="asc" entries_limit="10" site="1" parse="inward"}

{child_category_start}
{if "{random_number_0}" == "{child_category_count}" OR "{random_number_1}" == "{child_category_count}" OR "{random_number_2}" == "{child_category_count}"}

<a href="{child_category_url_title}">{child_category_name}</a>, number of entries: {entries_total}
<p>{child_category_description}<p>

{/if}
{child_category_end}

{/exp:child_categories}
{/exp:random_number}
{/exp:cat_info}

Random Number Links

This entry was created July 13, 2009, 1:11 pm.
This entry was last updated August 28, 2011, 5:43 am.

Disclaimer: Information about ExpressionEngine add-ons is provided as a service to you, the user, and every member of the ExpressionEngine community. devot:ee is not responsible if you hose, mangle, wreck, or otherwise destroy your EE website by installing an add-on that you found out about at this site, regardless of its rating, Favorites status, commercial or free status, or general popularity. Caveat EEmptor!

Returns: devot:ee has a 30-day return policy on all commercial add-ons sold through devot-ee.com. If you need to return an add-on, do not go to the developer or the developer's site, but rather visit our returns page at https://devot-ee.com/returns to initiate your return. If you have questions, email support@devot-ee.com.

There are no reviews for this add-on yet.

What are you waiting for? Rate it and review it!