This project is not covered by Drupal’s security advisory policy.

Created page node.
Community posting settings at node edit time.
Posted topic on SMF2 forum.
Settings page.


Drupal to Simple Machines Forum 2 (SMF2) posting module.


- SMF 2.0 "REST" API from used with MODIFICATIONS, so you shouldn't use it.
If newer API appear on github, API files that included on module will updated after testing.

- CURL (php library) should be enabled (SMF2 API REST requirements).

- Token module:


- Install as usual, see for further information.

- Copy server part smf2p\inc\api to SMF2 site.
So path should like:
- Open there /api/index.php file, row #48 and change SECRET_KEY to any row, for example:
define ('SECRET_KEY', 'Put your secret key here');

- if you use nginx, please be sure that http://FORUMURL/api/login/user.json should work, see .htaccess file in api folder for apache, that instruct rules.


- Visit "SMF2 Posting settings" - admin/config/content/smf2p - for configuring:
* Fill secret key, that you enter at "Installation" time.
* Fill Absolute URL to SMF2 site:
* Fill Absolute URL to copied SMF2 API REST site folder:
* Enter Email of user, that will author of posts in SMF2 site.
* Click "Save configuration", and if all ok, new settings fields appear. Otherwise, check error messages.
* Fill next on success:
- Allowed node types;
- Display link to forum at node view as field or in links
- Title template;
- Body template;
- For title and body use tokens tree for finding correct token replacer, especially under "Nodes".
- Some tokens generated only after node save submitting, so you change these [TOKEN:VALUE] to {{TOKEN:VALUE}},
for example: Node NID generated only after submitting, so you should do next: [node:nid] to {{node:nid}}
But title of node should be [node:title], since it used from filled form elements.

- Visit "Permissions" - admin/people/permissions for configuring "smf2p" permissions:
* Publish CONTENTTYPE to SMF2 - enable for selected roles.

- Visit selected content types field display admin page:
* For example, Page content type: admin/structure/types/manage/page/display
* Check that "URL to Forum topic" is visible and correctly ordered.


For posting node to forum:
* Add node with allowed node type and appropriate user permission.
* Fill required node form fields. Passing validation of form is important, since enabling posting
to forum will check it.
* Click Community fieldset options at the bottom and check Create post on forum.
* Title and Body will regenerated with current filled token. If you will change node form elements above,
you should click Refresh for updating current fields.
* Select certain Board.
* Check or change title and body. Please don't touch {{TOKENS}}, this is unaccessible tokens at this
moment (for example, NID will generated only after submitting).
* Click Save.
* Check Node view, forum topic link should appear. Try click, it open new window with generated topic.

For editing posted forum settings on node:
* Edit node, that already have posted to forum.
* Now you cann't edit title and body.
* You can change only URL of forum (so you should prepare forum topic on SMF2 site).
* You can also uncheck "Create post on forum", if you don't want show Forum link.
If you will enable it again, you still can change only URL.


- Warning: If you move SMF2 forum with "api" folder to other place, please remove dynamically
created "smfapi_settings.txt" file folder on "api" folder.


* Make posted forum topic to be changeable after posting. So title, body and board can be changed at node editing.
* Make check that user can post to selected board.


For supporting cyrillic: SMF2_site/Sources/Subs-Db-mysql.php #374 add:
@mysql_query("SET NAMES utf8");
I don't know why they made this for PostgreSql, but don't do for others.


Sponsored by

Project Information