Project

General

Profile

Actions

Feature #16180

closed

Add random on listNum

Added by Jean-Baptiste Rio over 18 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2006-05-25
Due date:
% Done:

100%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

A little patch to offer random value on listNum with the keyword 'rand' :

File class.tslib_content.php - Line 3347 and next

function listNum($content,$listNum,$char) {
$char = $char ? $char : ',';
if (t3lib_div::testInt($char)) {
$char = chr($char);
}
$temp = explode($char,$content);
$last = ''.(count($temp)-1);
+ if ($listNum = 'rand') $listNum = rand(count($temp));
$index=$this->calc(eregi_replace('last',$last,$listNum));
return $temp[$index];
}

(issue imported from #M3557)

Actions

Also available in: Atom PDF