We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1570
    • 38 Posts
    Hi All, I’ve got a couple of questions regarding this snippet

    Question 1

    I have this site which is integrated with a punbb forum so ppl can register and login in the site itself but all the users go into the punbb users table so a registered user in the site also gets registered in the forums and vice versa.

    I’ve run into this problem using jot tho.

    I would like only registered users to be able to post comments, the rest can just read whats already posted.

    Is it possible to set a parameter in the snippet call, like a sort of boolean, to allow or disallow users comments. Im calling jot from within another snippet so i can do this dynamically.

    What i would like to achieve is something like this:

    //Pseudocode
    if(person in page is logged in)
    output jot with posting comments enabled
    else
    output jot with comments disabled

    Question 2

    Does jot have a centralized system where you can moderate all comments of all pages from, something like a module for the backend?

    If not i might have to develop one myself, i’ll upload to the community if it ends up being a decent module smiley

    Thanks Andrew
      • 1570
      • 38 Posts
      Ok i figured out question 1 myself, pretty straight forward really rolleyes


      code sample for those who need the same thing

      <?php
      echo'<div class="clearer"></div>
      <div class="dots" style="margin:0px;"></div>
      <div class="clearer"></div>';
      
      echo'[+jot.html.navigation+]
      [+jot.html.comments+]';
      
      if(isset($_SESSION['site_user']))
      {
      	if(!$_SESSION['site_user']['is_guest'])
      		echo'[+jot.html.form+]';
      	else
      		echo'<h4>Would you like to comment?</h4>
      		<p><a href="[~8~]">Register</a> for a free account or <a href="[~7~]">Sign In</a> if you\'re already a member.</p>';
      }
      echo'[+jot.html.navigation+]
      [[Jot? &subscribe=`1` &pagination=`10` &placeholders=`1` &output=`0`]]';
      ?>


      Question 2 is still valid tho, please help if you can

      Thanks again
        • 8609
        • 607 Posts
        Would be interested to learn how you have punbb integration working? Did you create a bridge?

        For the moderation, look at JoCo -> http://modxcms.com/forums/index.php/topic,30632.0.html

          • 1570
          • 38 Posts
          Thanks for the link.

          What i did was create a set of php files that use punbb’s own functions to handle the db queries to the users table, so i kinda went with the punbb flow instead of hacking at it.

          Punbb has a few php files that contain all the functions you’ll need, however if you include these files in a modx snippet (in order to run them) modx will crash :/

          So what i did was create a php file that includes these punbb php files and sets certain punbb settings for the session, then i included this ’master include’ file in other php files that handle the various operations such as registering ect.

          The when a user registers i post to the register file and it handles it and posts back with a responce.

          Then i modded the index.php so it includes the ’master include’ before the parser executes, so it doesnt crash and set a modx session with the punbb user session, so i have access to the user data from my snippets.

          The only downside is that i dnt think you can update the forum because i dunno if the function will be compatible with the new version.

          If you want i can send you the source code smiley
            • 8609
            • 607 Posts
            I would appreciate the source code. What version of punbb is this compatible with? I think one of the most frequently requested features for Evo is forum integration smiley
              • 1570
              • 38 Posts
              It’s punbb 1.3.4 the latest i think.

              The files i have a re still a work in progress in a way, you will need to edit them slightly so they post back to your pages correctly.

              Do you have an email address i can send to?

                • 8609
                • 607 Posts
                Sure, my username at gmail
                  • 1570
                  • 38 Posts
                  Gonna prepare and send.

                  BTW

                  Does anyone know how to modify the JOT form, so i only have the comments textarea without the name subject ect..