PHPackages                             gn36/phpbb-oo-posting-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. gn36/phpbb-oo-posting-api

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

gn36/phpbb-oo-posting-api
=========================

Helper classes for creating/modifying posts, topics and PMs in phpBB to be added to vendor by other extensions.

2241[1 issues](https://github.com/gn36/phpbb-oo-posting-api/issues)PHP

Since Jan 20Pushed 9y ago3 watchersCompare

[ Source](https://github.com/gn36/phpbb-oo-posting-api)[ Packagist](https://packagist.org/packages/gn36/phpbb-oo-posting-api)[ RSS](/packages/gn36-phpbb-oo-posting-api/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

phpBB 3.1 OO Posting API
========================

[](#phpbb-31-oo-posting-api)

This repository contains an API for simple creation and editing of posts and PMs in phpBB. It adds classes for post, topic, and pm. These classes can be integrated in an extension. The classes take care of all necessary parameter handling in the background so that only the forum\_id, title and text of the new post must be set and the classes handle the rest. Any available bbcode can be used regularly in the text. For PMs, recipients can be set easily.

Warning: Development is still at an early stage and major bugs may still be present in this api. Currently, only the post and privmsg classes are ready for use, which means, no handling of attachments and no handling of polls. PMs can also not be loaded for editing currently.

Installation
------------

[](#installation)

Add `gn36/phpbb-oo-posting-api` to your extensions composer dependencies and install using composer.

Use
---

[](#use)

To create a new topic in the forum with forum\_id = 1:

```
$post = new \Gn36\OoPostingApi\post();

$post->forum_id = 1;
$post->post_subject = 'Subject of the new topic';
$post->post_text = 'The text of the first post. [b]This is bold![/b]';

// This is optional: Change the author id. Default is current user.
$post->poster_id = ANONYMOUS; // Create a guest post (could be any user id)
// This is only necessary for guests if you want a name to appear at the post
$post->post_username = 'I am a guest';

// Submit
$post->submit();

```

To create a reply in the topic with topic\_id = 1:

```
$post = new \Gn36\OoPostingApi\post();

$post->topic_id = 1;
$post->post_subject = 'Subject of the new post';
$post->post_text = 'The text of the reply. [i]This can also contain bbcodes.[/i]';

$post->submit();

```

To edit a post with post\_id = 1:

```
$post = \Gn36\OoPostingApi\post::get(1);
$post->post_text = 'This is the new post text';

// This will also change the topic title if you edit the first post:
$post->post_subject = 'This is the new post title';

$post->submit();

```

To create a new pm to the user with user\_id = 2 and the group with group\_id = 5:

```
$pm = new \Gn36\OoPostingApi\privmsg();

$pm->to(2); // Send to user with id 2
$pm->to('g', 5); // Send to group with id 5

$pm->message_subject = 'The subject of the pm';
$pm->message_text = 'This is the text.
	Again [b]bold[/b] and [color=red]any other[/color] bbcode are allowed.';

$pm->submit();

```

To reply to a pm with the message\_id = 11:

```
//reply_to(11, false) disables quoting the original text
$pm = \Gn36\OoPostingApi\privmsg::reply_to(11);

$pm->message_text .= 'The original message will be quoted and this text appears below.
	You could also replace the original text, but if you do so, consider passing a second parameter to	privmsg::reply_to, so it does not load the original text at all.';

// Nothing else needed, recipients are set automatically:
$pm->submit();

```

Development
-----------

[](#development)

If you find a bug, please report it on

Automated Testing
-----------------

[](#automated-testing)

We will use automated unit tests including functional tests in the future to prevent regressions. Check out our travis build below:

master: [![Build Status](https://camo.githubusercontent.com/c983b85e3c3cd318015fca7e0591e2a4e09e52030de111215b22a55637f89b9e/68747470733a2f2f7472617669732d63692e6f72672f676e33362f70687062622d6f6f2d706f7374696e672d6170692e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/gn36/phpbb-oo-posting-api)

License
-------

[](#license)

[GPLv2](license.txt)

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e47f1b5867779b0b6cb87f82997314b29dfe81deeb98d783059c8b6e13fe7ecc?d=identicon)[gn\[36](/maintainers/gn[36)

---

Top Contributors

[![gn36](https://avatars.githubusercontent.com/u/607501?v=4)](https://github.com/gn36 "gn36 (16 commits)")

### Embed Badge

![Health badge](/badges/gn36-phpbb-oo-posting-api/health.svg)

```
[![Health](https://phpackages.com/badges/gn36-phpbb-oo-posting-api/health.svg)](https://phpackages.com/packages/gn36-phpbb-oo-posting-api)
```

###  Alternatives

[rezzza/ruler-bundle

A simple stateless production rules engine for Symfony 2.

2712.8k](/packages/rezzza-ruler-bundle)[demouth/dmgeocoder

Geocoding library.

216.9k](/packages/demouth-dmgeocoder)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
