/home/vianto5/heredit.mx/wp-content/plugins/user-role-editor/includes/classes
Edit: /home/vianto5/heredit.mx/wp-content/plugins/user-role-editor/includes/classes/advertisement.php (2855B)
init();
}
// end of __construct
/**
* Returns random number not included into input array
*
* @param array $used - array of numbers used already
*
* @return int
*/
private function rand_unique( $max_ind, $used = array(-1) ) {
if ( $max_ind<0 ) {
$max_ind = 0;
}
$index = wp_rand( 0, $max_ind );
$iterations = 0;
while ( in_array( $index, $used ) && $iterations<=$max_ind * 3 ) {
$index = wp_rand( 0, $max_ind );
$iterations++;
}
return $index;
}
// return rand_unique()
private function init() {
$this->slots = array();
$used = array(-1);
$max_ind = $this->slots_quantity - 1;
$index = $this->rand_unique( $max_ind, $used );
$this->slots[$index] = $this->admin_menu_editor();
/*
$used[] = $index;
$index = $this->rand_unique( $used, $max_ind );
$this->slots[$index] = $this->some_other_slot();
ksort( $this->slots );
*
*/
}
// end of init()
/*
private function some_other_slot() {
$output = '
bla-bla-bla;
';
return $output;
}
*/
// content of Admin Menu Editor advertisement slot
private function admin_menu_editor() {
$output = '
';
return $output;
}
// end of admin_menu_editor()
/**
* Output all existed ads slots
*/
public function display() {
if ( empty( $this->slots ) ) {
return;
}
?>