I love the way the tutorials section works on this forum - the tutorials being seperate from the forum but comments appearing on the forum.

Is this a standard code? I very much expect not being Dani's forum, but if it is, which one is it? If not I don't suppose you fancy doing a tutorials tutorial?

:lol:

Dani AI

Generated

raised a practical goal: when an article is published, create a forum thread and surface comments in the forum so article readers get pulled into discussion. has already noted the site uses bespoke integrations, so the safest path is to wire into the article save/publish flow or to use an external sync that respects the forum’s posting and permission checks.

Common, reliable approaches (with tradeoffs):

  • On-publish push (tight integration): hook into the article publish event and programmatically create a forum thread + first post at that moment. Record a single mapping (article_id ↔ thread_id) so edits, deletes and duplicate-creation checks are trivial. Pros: immediate visibility, unified discussion. Cons: requires coding inside the article codepath and attention to permissions/notification behavior.

  • Asynchronous mirror (queued sync): let the article system stay as-is and run a cron/queue job that creates threads or mirrors comments to the forum. Pros: looser coupling and safer for live sites; you can retry on failure. Cons: eventual consistency and more moving parts.

  • Pull-only (forum as canonical comments): keep all comments in the forum and render them inline on the article page by querying the mapped thread. Pros: single source of truth for moderation, search, and spam controls. Cons: requires template work and careful permission checks when embedding.

Implementation tips and pitfalls:

  • Always store an explicit mapping so the integration never creates duplicates and can sync updates/deletions.
  • Respect user identity: either post as the article author (if authenticated) or use a system account and attribute the author in the post body.
  • Preserve formatting and sanitize HTML/BBCode consistently.
  • Consider moderation flow and notification volume before enabling automatic thread creation.
  • Test everything on a local/dev copy, enable verbose logging, and back up the database before running migrations.

A small prototype that creates a thread on publish, stores the mapping, then handles edit/delete sync will reveal the issues to solve (permissions, spam, formatting).

Recommended Answers

All 3 Replies

Hey there vord. You guessed it, it's custom written. While Morgan conned me into releasing my mod_rewrite tutorial ;) I would rather keep everything else I have on DaniWeb exclusive to DaniWeb. Tech forums nowadays are a dime a dozen, and it's our unique portal, blogs, code snippets, tutorials, irc chat, and link directory, in addition to all the other mini-hacks I coded (such as our "solved" threads), that make us unique :)

While our mod_rewrite tutorial was mostly just editing various bits and pieces of vB code and templates (i.e. replacing PHP urls with .html urls) all of the other hacks we've got are thousands of lines of pure PHP code - and damn it I suffered through five years of a computer science undergraduate degree to be able to write code that efficient, optimized, and object oriented! :)

I will say, however, that there are a couple hacks on vBulletin.org that do a good job of providing the same functionality as we do here at DaniWeb (dare I say, albeit not as cleanly coded).

vB Advanced CMPS is a good alternative to my portal (our moderator Zachery put a lot into this one, I believe). v3 Articles is a good article / tutorial database. If I'm not mistaken there's another vBArticles hack as well. vBJournal is a good blogs script, written by one of DaniWeb's own members, as well. And then there is the Links and Files Database you can also find on vbulletin.org for vB 3. There is also vBxIRC that is based on the same Java chat software as DaniWeb's IRC chat, also created by Zachery.

It was extremely generous of you to post your vbulletin mod-rewrite. It's amazing how a few lines of code changes can transform the way vbulletin works on the web. Without the mod-rewrite I think phpbb is better.

I have V3 articles and it works pretty well, but it's kind of isolated from the forum. I'll see if I can hack it a little to automatically post a new thread in the forum when a new article is posted, and transfer the comments to the forum. That way it might draw some of our article readers into the forum, and let our members know when new articles have been posted.

I'm not blessed with a computer science degree (I'm an engineer), but I do have a test forum up and running which I can break without anyone noticing :) I'll have a play around. Probably I'll find out a lot about vbulletin permissions along the way.

Good luck!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.