New Community Forums are coming. Watch this space for news.
Subscribe: RSS
  • Ok, thanks. I installed the basic Discuss theme that came along with the demo files.

    Actually, I'm not a programmer. Discuss for me is already kind of difficult. Instructions are poor for me to work with.

    Hard coding system settings is also a no go area for me.

    I hope Discuss 2 will be far more intuitive and well documented.

    Ok, back to business.

    You mention wrapper.tpl: what about that file? The instructions don't mention that file.

    This is my Login resource (just copied it from the instructions):
    [[!Login? &loginTpl=`disLoginTpl` &logoutTpl=`disLogoutTpl` &preHooks=`preHook.DiscussLogin` &postHooks=`postHook.DiscussLogin`]]

    • To be honest, if this is getting more complicated than this, I will have to look for an alternative. MODX is really missing some essential functionalities here: poor supply of addons and if there is an addon there's a lot coding to do.
      If MODX wants to survive (or is it dead yet?) these things need fixing.

      Maybe SMF is an alternative. In fact I don't need a classic forum, but need to build a community where members can discuss, offer skills and talents, update their profile, etc.
      • Modx is just fine. Discuss is a full-fledged, feature rich forum. It has weaknesses but also strengths too. It is, however, at the end of its life-cycle and was never well-documented.

        There are an enormous number of extras. Articles may be what you need: http://modx.com/extras/package/articles
        • Wow I just realized my login is gone too. Let me ask you, are you using the most updated Modx Revo?

          I have an independent login on my front page, that still works, and so I am able to see that when i am logged in the user links are still visible, no new PMs and so on...how about you?

          So I stand corrected, it seems you did do everything right. Well, one way around this would be to stick in an independent login code.

          The reason I think its the newest Revo is we just upgraded and I guess this got broken by the upgrade. Can't say for sure but probably.

          I should have moved on to a good solution already, sorry about that. Being lazy these days. We can just stick some basic login code in the discuss code to get this working, but styling will be a problem as it will only have default login styling unless you want to make a new tpl.

          So i am using a tpl I made before, here is the normal login code, and I will put it in the code I originally pasted. [[!Login? &preHooks=`preHook.DiscussLogin` &loginResourceId=`20` &loginTpl=`lgnNewFrontTpl` &postHooks=`postHook.DiscussLogin` ]] [ed. note: nuan88 last edited this post 3 years ago.]
          • That's interesting! Yes, I'm using most recent version.

            Right now, it's looks like I'll have to search for an alternative solution. MODX does not really help me here.
            • I've gotten a solution to this issue, but haven't done it yet myself. BobRay helped me out:

              https://forums.modx.com/thread/99793/one-bit-of-discuss-code-works-while-another-doesn-t-how-to-check-if-there-is-a-current-user-logged

              Its very odd that the one part of the code stopped working.

              Modx is weak in forums, but does have a number of extras that provide various functionality, and also can be integrated with other systems. But everyone wants something different of course, and has different coding ability, money or time. I picked up Discuss simply because the other options were not attractive to me at all for forums. With most, there is no easy way to customize very much, but a basic system is easy enough to do.

              This particular bug was not that hard to fix, so the core of Discuss is not really damaged. But, its hard to pick up a solution that is not being supported at all, which points to an uncertain future.
              • Ok here is the solution, it works fine.

                What was happening was the login part was gone but the actual user panel was working, so when I was already logged in I could see the panel.

                It seems the panel code will not work in the snippet, but it was already working anyway. So, I left it there and only changed the second clause, which wasn't working. The snippet returns nothing if the user is logged in, and returns the login box when not.

                Wrapper.tpl:
                Cut out everything within these brackets (line 74):

                                    [[+discuss.user.id:is=``:then=`
                
                                    `]]


                And place the inside portion into the snippet, and then call the snippet in wrapper.tpl in place of the above
                [[!LoginOrNothing]]


                The snippet's got my slightly customized code, you should use precisely what you have in your wrapper.tpl

                Snippet:
                <?php
                /* LoginOrNothing snippet */
                if ($modx->user->hasSessionContext('web')) {
                   return '';
                } else {
                   return '<div class="masthead-login m-login_box h-group" style="margin-top:5px; margin-left:25%;">
                                 <div class="masthead-title">Login below or <a href="[[~[[++discuss.register_resource_id]]]]">create an account!</a></div>
                                     <form class="m-login_block" method="post" action="[[~[[++discuss.login_resource_id]]]]">
                                         <input type="hidden" name="service" value="login" />
                                         <input type="hidden" name="discussPlace" value="[[+discuss.place]]" />
                                         <div class="f9-f12">
                <p style="white-space: nowrap;">
                                                 <input type="text" name="username" id="login-username">
                                                 <label class="loginUsernameLabel">Username</label><label class="loginPasswordLabel">/ Password</label>
                 
                                         <br />
                 
                                                 <input type="password" name="password" id="login-password">
                          
                                             </p>
                                <p style="white-space: nowrap;"><input class="alt-1-cta" type="submit" value="Login">  <a href="[[~11]]">Reset Password</a></p>
                                         </div>';
                }