Found the answer myself - instead of closing the else statement with the closing "tbody" tag, it needed a few lines, plus a closing else tag:
$CommentList .= '
</tbody>
</table>
</div>';
}
Does not quite do what I want it to do yet, for example, how to change this line to allow for more than one role to have access:
You can check if the role is listed in a array of roles you define right inside the IF:if ( in_array($Context->Session->User->RoleID, array(4, 5, 6)) )
Comments
$CommentList .= ' </tbody> </table> </div>'; }
Does not quite do what I want it to do yet, for example, how to change this line to allow for more than one role to have access:
if ($Context->Session->User->RoleID == 4)
if ( in_array($Context->Session->User->RoleID, array(4, 5, 6)) )
if ( in_array($Context->Session->User->RoleID, array(4, 5, 6)) )
or:
if ($Context->Session->User->RoleID == 4)
or:
if ($User->RoleID == 4)
Then if I login as the Admin (role id of 4), whatever is in the "if" statement does NOT execute - only the "else" portion executes.
With this:
if ($Context->Session->User->RoleID != 4)
And I am logged in as Admin, the code after the IF does execute.
It should be the other way around, no??