Warning: chmod(): Operation not permitted in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8 [0] in function chmod in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8 [1] in function include_once in /var/www/hopeinstoughton_www/wp-settings.php on line 560 [2] in function require_once in /var/www/hopeinstoughton_www/wp-config.php on line 85 [3] in function require_once in /var/www/hopeinstoughton_www/wp-load.php on line 50 [4] in function require_once in /var/www/hopeinstoughton_www/wp-blog-header.php on line 13 [5] in function require in /var/www/hopeinstoughton_www/index.php on line 17
| Server IP : 94.177.8.99 / Your IP : 216.73.217.165 Web Server : Apache/2.4.58 (Ubuntu) System : Linux aries 6.8.0-134-generic #134-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 26 18:43:11 UTC 2026 x86_64 User : www-data ( 33) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/hopeinstoughton_www/wp-content/plugins/user-role-editor/includes/classes/ |
Upload File : |
<?php
/*
* User Role Editor plugin: advertisement showing class
* Author: Vladimir Garagulya
* email: vladimir@shinephp.com
* site: http://shinephp.com
*
*/
class URE_Advertisement {
private $slots_quantity = 1;
private $slots = array();
function __construct() {
$this->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 = '
<div style="text-align: center;">
bla-bla-bla;
</div>';
return $output;
}
*/
// content of Admin Menu Editor advertisement slot
private function admin_menu_editor() {
$output = '
<div style="text-align: center;">
<a href="https://adminmenueditor.com/?utm_source=UserRoleEditor&utm_medium=banner&utm_campaign=Plugins" target="_new" >
<img src="' . URE_PLUGIN_URL . 'images/admin-menu-editor-pro.jpg' . '" alt="Admin Menu Editor Pro"
title="Move, rename, hide, add admin menu items, restrict access" width="250" height="250" />
</a>
</div>
';
return $output;
}
// end of admin_menu_editor()
/**
* Output all existed ads slots
*/
public function display() {
if ( empty( $this->slots ) ) {
return;
}
?>
<div id="ure-sidebar" class="ure_table_cell" >
<?php
foreach ($this->slots as $slot) {
echo $slot . "\n";
}
?>
</div>
<?php
}
// end of display()
}
// end of URE_Advertisement class