/** * Конструктор класса * * @param int $items_pp Количество пользователей на странице */ function __construct($items_pp = 0) { parent::__construct($items_pp); }
/** * Конструктор класса. */ public function __construct() { parent::__construct(0); $this->oStatDB = new DB('stat'); $this->oMemBuff = new memBuff(); //$this->oMemBuff->delete( 'traffic_stat_domains' ); $this->aDomains = $this->oMemBuff->get('traffic_stat_domains'); // если в мемкеше потерялось, читаем с базы if ($this->aDomains === false) { $aDomains = $GLOBALS['DB']->rows('SELECT * FROM traffic_stat_domains ORDER BY id'); if ($aDomains) { foreach ($aDomains as $aOne) { $this->aDomains[$aOne['id']] = $aOne; } } $this->oMemBuff->set('traffic_stat_domains', $this->aDomains, self::MEMBUFF_TTL); } }
/** * Конструктор класса. * * @param int $items_pp Количество пользователей на странице */ public function __construct($items_pp) { parent::__construct($items_pp); }
/** * Конструктор класса * * @param array $user_permissions права пользователя * @param int $items_pp Количество элементов на странице */ function __construct($uid = 0, $user_permissions = array(), $items_pp = 20) { $this->curr_uid = $uid; $this->user_permissions = $user_permissions; $this->mem_buff = new memBuff(); $this->contents = $this->getContents(); $this->content_streams = $this->mem_buff->get('user_content_streams'); $this->streams_count = $this->mem_buff->get('ucs_streams_count'); $this->first_update = $this->mem_buff->get('ucs_first_update'); $this->last_update = $this->mem_buff->get('ucs_last_update'); $this->initial_sreams = $this->content_streams; // если в мемкеше потерялось, читаем с базы if ($this->content_streams === false) { $this->streams_count = array(); $this->first_update = time(); $this->last_update = time(); $DB = new DB('plproxy'); $res = $DB->query("SELECT * FROM mod_streams() ORDER BY type, pos"); while ($row = pg_fetch_assoc($res)) { $type = $row['type']; $pos = $row['pos']; $aOne = array(); if ($row['id'] == '_first_update') { $this->first_update = $row['time']; continue; } if (empty($this->content_streams[$type])) { $this->content_streams[$type] = array(); } if (empty($this->streams_count[$type])) { $this->streams_count[$type] = 0; } $aOne['stream_id'] = $row['id']; $aOne['admin_id'] = $row['admin_id'] ? (int) $row['admin_id'] : ''; $aOne['stream_num'] = is_null($row['num']) ? '' : (int) $row['num']; $aOne['resolve_cnt'] = $row['resolve_cnt'] ? (int) $row['resolve_cnt'] : 0; if ($row['admin_name']) { $aOne['admin_name'] = $row['admin_name']; } if ($row['time']) { $aOne['time'] = (int) $row['time']; $this->streams_count[$type]++; if ($row['time'] > $this->last_update) { $this->last_update = $row['time']; } } $this->content_streams[$type][] = $aOne; } if (is_array($this->content_streams) && $this->content_streams) { $this->_saveStreams(true); } } //$this->mem_buff->touchTag( 'user_content' ); // сброс мемкеша в процессе разработки parent::__construct($items_pp); }