We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14281
    • 120 Posts
    I’ve been doing some alterations to the UserComments snippet. Everything in there is pretty straight-forward so far, except this one line:

    if($uid && ($uid*-1)==$modx->documentObject['createdby']) {


    The variable $uid refers back to this statement in the snippet:

    $uid = $modx->getLoginUserID();


    Am I reading the code correctly, that $uid is being multiplied by negative one, and the product of that operation is being compared to the main document’s author’s user ID? If I’m reading that right, then my question is why does the user’s login ID have to be multiplied by negative one before comparing it to the document author?
      • 18397
      • 3,250 Posts
      Not sure if this applies here but if a used ID is negative it means it is a web user in some snippets.
        • 15987
        • 786 Posts
        I think the user Id is multiplied by one when you are storing an smf user id not a modx id.