/**
     * Activate style.
     *
     * @param int $style_id.
     * @return null
     */
    protected function activate($style_id)
    {
        $sql = 'UPDATE ' . STYLES_TABLE . '
			SET style_active = 1
			WHERE style_id = ' . (int) $style_id;
        $this->db->sql_query($sql);
    }
Exemplo n.º 2
0
 /**
  * Connect to demo board database.
  *
  * @return bool Returns false if connection failed.
  */
 protected function db_connect()
 {
     $config = new \phpbb\config_php_file($this->board_root_path, $this->php_ext);
     $db_driver = $config->convert_30_dbms_to_31($config->get('dbms'));
     $db_driver = new $db_driver();
     $connection = $db_driver->sql_connect($config->get('dbhost'), $config->get('dbuser'), $config->get('dbpasswd'), $config->get('dbname'), $config->get('dbport'));
     if (is_string($connection)) {
         return false;
     }
     $this->db = new \phpbb\db\driver\factory($this->container);
     $this->db->set_driver($db_driver);
     $this->table_prefix = $config->get('table_prefix');
     return true;
 }