public static function getInstance() { if (self::$oInstance == null) { self::$oInstance = new vs_settings(); } return self::$oInstance; }
public function __construct() { $this->counter = new vs_counter(); $this->settings = vs_settings::getInstance(); $this->labels = $this->settings->get_display_labels(); $this->count_values = $this->counter->vc_count_users(); $this->displayOptions = $this->settings->get_display_options(); $this->title = $this->labels['widgetTitle']; $this->onlineUsersLabel = $this->labels['nowOnlineLabel']; $this->overallUsersLabel = $this->labels['overallLabel']; $this->dailyUsersLabel = $this->labels['dailyLabel']; $this->weeklyUsersLabel = $this->labels['weeklyLabel']; }
public function __construct($time = 120) { global $wpdb; global $table_prefix; load_plugin_textdomain('visits_counter', false, basename(dirname(__FILE__)) . '/languages/'); $this->settings = vs_settings::getInstance(); $this->online_counter_table = $table_prefix . "vs_current_online_users"; $this->overall_counter_table = $table_prefix . "vs_overall_counter"; $this->section_name = 'visits-counter'; if ($time < 0) { return new WP_Error('wrong_time', "I can't check users from future. Parameter time range can't be less than 0 in visits counter plugin."); } else { $this->time_range = $time; } }