'', 1=>'', 2=>''); function __construct() { $used = array(-1); $index = $this->rand_unique( $used ); $this->slots[$index] = $this->admin_menu_editor(); $used[] = $index; $index = $this->rand_unique( $used ); $this->slots[$index] = $this->manage_wp(); } // 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( $used = array(-1) ) { $index = rand(0, 2); while (in_array($index, $used)) { $index = rand(0, 2); } return $index; } // return rand_unique() // content of Admin Menu Editor advertisement slot private function admin_menu_editor() { $output = '
'; return $output; } // end of admin_menu_editor() // content of Manage WP advertisement slot private function manage_wp() { $output = ' '; return $output; } // end of manage_wp() /** * Output all existed ads slots */ public function display() { foreach ($this->slots as $slot) { echo $slot."\n"; } } // end of display() } // end of ure_Advertisement