We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9583
    • 25 Posts
    In my spare time I’ve been testing the wonderful new SMF bridge (the user sync works great!), and I’ve been picking through both this site and over at simplemachines to try and figure out how to take it to the next step for my desired goals for my site. However, with both SMF’s and MODx’s documentation in these areas still "ramping up", as it were, and my being enough of a PHP newb to not being able to intuitively root answers out of the code, I need a few hints and pointers of what I should be looking at.

    Goal #1: I want SMF to manage my web users -- registration, login/logout, ban controls, profiles, etc. Most of my users’ activities will take place in the forum, but I also want them to be able to contribute articles to the "main" MODx-driven site. I’d like it to be a single-signon, seamless solution -- a user logged in to the forum navigates to a variation of a NewsPublisher page that I’m making, and they’re identified as being logged in (and registered for that matter) by MODx when they get there. My thoughts:

    • I’ve found the various SMF "integrate_" hooks, but I’m having a hard time finding how to match them up with MODx hooks. Essentially, I want to build the reverse of the current bridge for user reg, etc, When a user registers, I want MODx to sync the user account.
    • The "SMF_UserComments" snippet seems to be the best starting place for the user authentication once they’re already logged in via SMF, but I can’t quite put my finger on how to make that go one step further and automagically log them in as a MODx webuser
    • ...would it make more sense to automatically log them in as a MODx webuser when they log in to SMF instead? Can I/should I do both?

    Goal #2: I want to SMF to manage users’ comments on articles. I don’t want in-line posting & display -- just a link to the relevant discussion on the forum. But when a user creates the article in the first place, I want:

    • The "attached" forum topic post to be created, preferably with titling and content derived from the MODx article’s content
    • A TV for the article is set to a link to the forum topic
    However:

    • I can’t find anything about how to generate a new post in SMF via an API -- there’s definitely nothing in that SSI for that sort of thing
    • I’m guessing I need to manually do it via DB; should I pursue doing it with the MODx DBAPI, or do you think I need to extend the SMF SSI?

    Goal #3: On the SMF templates, I’d like to include some dynamic MODx-generated menu links to sections on the "main" site. I can easily build a hidden document in MODx that generates whatever bit of code I want, but I’ve had zero luck trying to include that in SMF’s PHP. Is there:

    • A method of running a MODx snippet/document from SMF?
    • Or a way to do the equivalent from a DB call?
    • Or a way to automatically "publish" a static PHP include-file to the filesystem that contains the output of a snippet I want?

    Finally, I’m also planning on weaving G2 into the mix -- the G2<->SMF bridge seems to be stalled, though, and I get the sense that the G2<->MODx bridge is impending. If the current SMF bridge model of having MODx control the login/registration/user-authentication is going to also link in with the G2 bridge, and all 3 will play together, am I just wasting my time pursuing using SMF as the user manager? tongue
      • 14267
      • 113 Posts
      Well, here’s some possible help with goal 2: including SSI.php allows you to call other SMF functions, including createPost(). Look here:

      http://www.simplemachines.org/community/index.php?action=search2;search=createpost

      I made a snippet that allows a manager user to post to a forum but won’t put it here because I’m not using it and therefore don’t remember if I thoroughly tested it. PM if you’d like it.

      Not much given your overall scope, but hope it helps.
        • 9583
        • 25 Posts
        Quote from: jlarson at Apr 08, 2006, 03:33 PM

        Well, here’s some possible help with goal 2: including SSI.php allows you to call other SMF functions, including createPost().
        Ah, that may be a piece of the puzzle I’m missing. I was under the impression that if the function wasn’t in SSI.php, I wouldn’t be able to access it at all due to however it was they were "protecting" internal functions. Interesting. More code to muddle through... Thanks! grin


        I made a snippet that allows a manager user to post to a forum but won’t put it here because I’m not using it and therefore don’t remember if I thoroughly tested it. PM if you’d like it.

        Not much given your overall scope, but hope it helps.

        That would be handy, as every little bit helps me at this "not even sure where to begin" stage. smiley
          • 37272
          • 216 Posts
          I’ll be trying out the bridge soon too. SMFs registration features would be very handy, you are right.

          If you manage get this sorted out, perhaps you would like to share? wink
            • 9583
            • 25 Posts
            Quote from: Colin at Apr 10, 2006, 11:15 PM

            I’ll be trying out the bridge soon too. SMFs registration features would be very handy, you are right.

            If you manage get this sorted out, perhaps you would like to share? wink

            Oh, I will, though I recommend no-one count on anything polished coming from me -- I’m a hack who only tolerates coding just enough to force something to my will, then I move on to the next crazy puzzle. smiley

            (Also, it takes me forever-and-a-half when I can only spend a couple of hours a couple of times a week on it. tongue )

            Still would like a hint on how to hook into MODx’s webuser authentication though...