Hi
I have a site with a selection of articles, jot powered comments, plus a forum using SMF. The SMF data tables are installed into the same database as ModX (with a prefix separating the tables obviously). I guess this is a pretty common setup.
What I would like to do is have a snippet that can generate an integrated ’What’s New’ list. This should show a single list containing, in descending date order, the most recent articles, comments and smf posts, perhaps displaying an icon to make it clear to the user what type of item it is. I could write a query that unions together queries for the modx_jot_content, modx_site_content and smf_messages tables, but I don’t really want to do this as I know it could cause problems with future versions of Modx or SMF.
Has anyone any ideas about a ’best practice’ way of approaching this problem? Once I’ve got it working I’ll happily post the snippet back up for anyone else to use.
John
To get most recent documents, use Ditto to list certain amount of documents (use &total parameter to limit) and order by date. To get most recent Jot comments, first do
this modification to be able to put * to &docid parameter and then order by date. To get most recent SMF forum posts, you could use SMFssi that is in the resource repo or NewsParserX to parse a RSS feed from SMF what lists the most recent posts..
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
Thanks Doze, I wasn’t aware of the jot hack. What I would like to achieve, though, is a single list of site updates in date order, most recent first. This list should contain articles, comments and forum posts all mixed together, but with an icon to differentiate the item type to the user.
John
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
-
☆ A M B ☆
- 24,524 Posts
Could be done in a snippet if MODx and SMF were using the same database, but would take one horrendous sql query! Gives me a headache just trying to imagine it!
Actually I’ve started going down that route - just a few UNIONs thats all! I’ll post back when I get it working.