<input name="allowed_register" value="yes" type="checkbox"<?php echo allowed_register() ? " checked" : ""; ?> > 是否允许新用户注册 </label> </div> </div> </div> <div class="form-group"> <label class="col-sm-2 control-label">评论权限</label> <div class="col-sm-10"> <div class="checkbox"> <label> <input name="allowed_comment" value="yes" type="checkbox"<?php echo allowed_comment() ? " checked" : ""; ?> > 是否允许用户评论 </label> </div> </div> </div> <div class="form-group"> <label class="col-sm-2 control-label">评论排序</label> <div class="col-sm-10"> <div class="checkbox"> <label> <input name="comment_order_desc" value="yes" type="checkbox"<?php echo comment_order_desc() ? " checked" : ""; ?>
/** * 通过传入一个参数判断是否开启了评论 * @param int $status * @return bool */ function image_comment_status($status) { return allowed_comment() && 0 + $status > 0; }