Advertisement
xandr91

Disabling anonymous comments

Oct 17th, 2014
403
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.95 KB | None | 0 0
  1. // Change in core/pages/ajax.php, case 'comment' into:
  2. case "comment":     if($_POST["comment"]!="" && $_POST["ajax"]!=0 && USER_ID!='')
  3.             {
  4.                 $engine_session->addcomment($_POST["id"], $_POST["comment"], $_POST["anonymous"]);
  5.             }
  6.  
  7. // Change in themes/[theme_name]/tpl/comments.tpl (find by COMMENTS_HTML) by adding PHP code:
  8.  
  9. <div class="col-lg-12 comments" id="commentslist">
  10.         <?php echo COMMENTS_HTML; ?>
  11.       </div>
  12.       <hr>
  13.       <?php if(USER_ID!='') { ?>
  14.       <div class="col-lg-12">
  15.         <h3><?php echo langVar(416); ?>:</h3>
  16.         <form method="post" id="commentForm" onsubmit="addComment('<?php echo MAIN_QUESTION_ID; ?>'); return false;">
  17.           <div class="col-lg-10 col-sm-10 col-xs-9">
  18.             <textarea name="comment" id="comment" maxlength="255" class="form-control" rows="2"></textarea>
  19.           </div>
  20.           <div class="col-lg-2 col-sm-2 col-xs-3">
  21.             <a id="sendButton" class="btn btn-primary btn-sm" onclick="addComment('<?php echo MAIN_QUESTION_ID; ?>')"><?php echo langVar(417); ?> <i id="sendIndicator" class="fa fa-spinner fa-spin" style="display:none;"></i></a>
  22.             <?php if(SESSION_STATUS!="") { ?>
  23.               <div class="checkbox">
  24.                 <label>
  25.                   <input type="checkbox" name="anonymous" value="1" id="anonymous"> <?php echo langVar(82); ?>
  26.                 </label>
  27.               </div>
  28.             <?php } else { ?>
  29.               <div class="checkbox">
  30.                 <label>
  31.                   <input name="anonymous" type="hidden" value="1" id="anonymous"> <?php echo langVar(82); ?>
  32.                 </label>
  33.               </div>
  34.             <?php } ?>
  35.           </div>
  36.         </form>
  37.         <div id="commentSuccess" class="commentSuccess" style="display:none">
  38.           <?php echo langVar(418); ?>. <a href="javascript://" onclick="commentAgain()" class="nofollow"><?php echo langVar(419); ?></a>      
  39.         </div>
  40.       </div>
  41.       <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement