SMF Commenter

The SMF Commenter is a WordPress Plugin that allows you to use a Simple Machine Forums (SMF) installation for comments.

What it Does:
When you publish a post in WordPress it will create a new topic in the forums with the same title and body. The SMF user and the board in which the topic is created are determined before hand on an options screen. In addition to creating a topic a Link to the topic is automatically added to the appropriate WordPress post, and a link back to the wordpress post is automatically added to the end of the SMF topic. The comment counter inWordPress is also updated to reflect the number of replies to the SMF topic.

What it does not do:
This system does not integrate users between the two system, nor does it display the replies from the SMF topic on the WordPress page, nor does it allow users to leave SMF comments from the WordPress page. You should use this Plugin with the WordPress comment system completely deactivated as it’s meant as a complete replacement. It doesn’t do anything special above and beyond what has been listed above.

Known Bugs:
There are a few known bugs with the system, nothing major and they might get fixed eventually. If you have a solution let me know and I’ll implement it.

  • After publishing a post in WordPress you will see a header error on the screen for a brief moment before being forwarded to the newly created SMF topic, I have no idea how to prevent or suppress this error. It doesn’t hurt anything though.
  • Some Special HTML Characters don’t convert properly and wind up looking VERY special once they appear in the SMF Topic.
  • Line breaks are carried over as line breaks in the code as opposed to <br /> because of this 1 out of every 10 posts or so will have all of the line breaks collapsed in the SMF Topic.

Features for Future Versions:

  • Integration with Post Processing elements such as viper’s video quicktags so that the special post formatting from the final displayed WordPress post appears in the SMF topic instead of the raw formatting from the database.
  • A Drop down or base intelligence to determine which board within SMF the topic should be created.
  • Modify the # Comments link to take you to the SMF Topic
  • Display SMF Comments on the WordPress page
  • File Attachment Integration

Features that wont ever be added:

Stuff you ask for. I wrote this plugin for my friends at Nintendo-Scene where it gets used daily. I could care less of anyone else uses it or needs feature X or doesn’t like how it does Y. This plugin wasn’t written for you. Honestly you’ll be lucky of any of the proposed feature updates ever make it into the plugin because I’ve got better things to do.

Why Is this Plugin Here:

You may be asking yourself “If he doesn’t care about other people using his plugin why did he even post it here?” The simple truth is this: I didn’t want to write this plugin, but I needed this function and in searching for something that already did it I found nothing but lots of other people complaining that there was no plugin available. I found ONE guy who had something like this up and running, he went out of his way to brag about it and then when I asked for the code it vanished, so f*ck him, I wrote my own.

To prevent that from happening to someone else I’m making this plugin available to everyone. You can use it as is, or you can tweak it out to your own needs, or you can use it as a starting point to build a much better integration between the two platforms. Honestly I don’t care what you do with it. But since I was nice enough to share it at least be nice enough to let me know if you’re using it or if you’ve made any improvements.

Also part of it that I don’t really have time to support this plugin like many of the other plugin authors do. If you need some help setting it up post here or something and I’ll see if I can lend a hand but no support expressed or implied so don’t get mad if I don’t have the time to help you out.

Installation Instructions:

  1. Copy all files to your wordpress plugin folder including the “wp_smf_commenter” folder
  2. Edit the line include_once(‘/forums/Sources/Subs-Post.php’); in the “wp_smf_commenter.php” file to reflect the absolute server path of the Subs-Post.php file in SMF. In most cases this includes low level folders that are not visible from the web.
  3. Go into the WordPress Admin page and activate the plugin from the Plugins screen and then set the SMF Commenter options from the Options screen
    in the SMF Commenter options page.


SMF Commenter .41

6 Responses to “SMF Commenter”

  • Hi, I know you’ve stated no support for this plugin but I have found this plugin to be so useful that I hope you can help me with this.

    I originally had the plugin installed on wordpress on a shared hosting account and it worked perfectly. Since moving my site to a personal IIS box I’m having issues.

    I get this error message when trying to view any wordpress page with the plugin installed:

    WordPress database error Table ‘dcp_wrdp1.smf_messages’ doesn’t exist for query SELECT COUNT(*) FROM smf_messages WHERE ID_TOPIC = 1828

    The problem seems to be with the database name, the plugin is trying to select SMF data from the wordpress database… is an assumption made that SMF and wordpress are using the same database?

  • You are correct, it does work on the assumption that both WP and SMF are sharing the same database.

  • Omg, after hours of searching, i found a plugin that would make my wishs come through, but there is a problem :\

    I know, you dont want give support officialy, but i looked through the files by my own, but cant figure out whats the problem ..

    First, my Setup is WordPress 2.6 (is it compatible with this version ?)
    and SMF 1.1.5.

    When i want to post an article, the “Cannot grab db values from wp-config.php” appears, which comes, i read the smf__create_topic.php, when the plugin couldnt read out the wp-config.

    So, i edited the line for the prefix,
    eval ($wp_config[8]); //evaluates line 20 (set $table_prefix)
    becouse in line 20 there is this table_prefix.

    But still the error appears.
    Can you give me something to go on ?

    greetings, oldboy

  • yeah, since SMF and WP don’t play nice to get the DB values it actually reads the raw php from the config.php file and evaluate the lines blindly.

    it’s really horrible practice I know but it’s the only way I could think of to allow them to share the same config data.

    It should work with WP 2.6 as the original website for which this plugin was design is running 2.6.1 and still using the plugin…

    though they upgrade after I left the site so I don’t know if they ended up changing anything.

    In short your problem seems to be that it’s having trouble fetching the database config data.

    you edited this line
    eval ($wp_config[8]); //evaluates line 20 (set $table_prefix)
    everything after the “//” is a comment which means it’s not actual code. the [8] needs to be changed as well if the prefix location moved so change it to
    eval ($wp_config[20]);

    similarly check to make sure the other lines are correct.

  • thanks mate, this works for me, i changed “eval ($wp_config[8]); //evaluates line 20 (set $table_prefix)” to eval ($wp_config[19]); //evaluates line 20 (set $table_prefix).

    The plugin creates the topic in the configurated board, all good.
    But when i post in wordpress, the following error comes (but ir works)

    Warning: Cannot modify header information – header allready sent by (output startet at “my root/wp-content/plugins/wp-content/plugins/wp_smf_commenter/wp_smf_commenter.php:83) in pluggabble.php on line 770

    is this error normal ?

    thanks in advance, great plugin indeed

  • yes that is normal… it’s one of the known bugs, it doesn’t harm anything but the page header gets set twice. I actually figured out why at some point when I encountered a similar problem on another project but I never got around to fixing it here. At this point I’ve completely forgotten why it happens… heh

    ..but it’s just an annoyance, nothing to be worried about.

Leave a Reply

You must login to post a comment.