method get documentation in bbn\Appui\Imessages

Gets the page's internal messages of an user

function(string $id_option, string $id_user, $simple = true) { $cfg =& $this->class_cfg; // Current datetime $now = date('Y-m-d H:i:s'); // Get the user's group $id_group = $this->db->selectOne('bbn_users', 'id_group', ['id' => $id_user]); $db =& $this->db; $fields = array_map( function ($a) use ($db, $cfg) { return $db->cfn($a, $cfg['table']); }, array_keys($this->db->getColumns($cfg['table'])) ); // Get the page's internal messages of the user $messages = $this->db->rselectAll( [ 'tables' => [$cfg['tables']['users']], 'fields' => $fields, 'join' => [ [ 'table' => $cfg['table'], 'on' => [ [ 'field' => $this->db->cfn($cfg['arch']['imessages']['id'], $cfg['table']), 'exp' => $this->db->cfn($cfg['arch']['users']['id_imessage'], $cfg['tables']['users']) ] ] ] ], 'where' => [ 'conditions' => [ [ 'field' => $this->db->cfn($cfg['arch']['imessages']['id_option'], $cfg['table']), 'value' => $id_option ], [ 'logic' => 'OR', 'conditions' => [ [ 'field' => $this->db->cfn($cfg['arch']['imessages']['start'], $cfg['table']), 'operator' => 'isnull' ], [ 'field' => $this->db->cfn($cfg['arch']['imessages']['start'], $cfg['table']), 'operator' => '<=', 'exp' => 'NOW()' ] ] ], [ 'logic' => 'OR', 'conditions' => [ [ 'field' => $this->db->cfn($cfg['arch']['imessages']['end'], $cfg['table']), 'operator' => 'isnull' ], [ 'field' => $this->db->cfn($cfg['arch']['imessages']['end'], $cfg['table']), 'operator' => '>', 'exp' => 'NOW()' ] ] ], [ 'logic' => 'OR', 'conditions' => [ [ 'field' => $this->db->cfn($cfg['arch']['imessages']['id_user'], $cfg['table']), 'value' => $id_user ], [ 'field' => $this->db->cfn($cfg['arch']['imessages']['id_group'], $cfg['table']), 'value' => $id_group ], [ 'logic' => 'OR', 'conditions' => [ [ 'field' => $this->db->cfn($cfg['arch']['imessages']['id_user'], $cfg['table']), 'operator' => 'isnull' ], [ 'field' => $this->db->cfn($cfg['arch']['imessages']['id_group'], $cfg['table']), 'operator' => 'isnull' ] ] ] ] ], [ 'logic' => 'OR', 'conditions' => [ [ 'field' => $this->db->cfn($cfg['arch']['users']['hidden'], $cfg['tables']['users']), 'operator' => 'isnull' ], [ 'field' => $this->db->cfn($cfg['arch']['users']['hidden'], $cfg['tables']['users']), 'operator' => '=', 'value' => 0 ] ] ] ] ] ] ); if ($res = $this->fromNotes($messages, $simple)) { // Get and return the imessage's content|title from notes archive return $res; } return null; }

Gets the page's internal messages of an user BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way

This website uses cookies to ensure you get the best experience on our website.