Help Hỏi về cách tắt lưu IP của xenforo

bạn vô user option có mục ip đấy, sửa thời gian lưu ip từ 365 ngày thành 15 hay 30 ngày thôi
 
  • Like
Reactions: THB
mở file này: library\XenForo\Model\Ip.php
tìm và xóa đoạn
PHP:
        $this->_getDb()->insert('xf_ip', array(
            'user_id' => $userId,
            'content_type' => $contentType,
            'content_id' => $contentId,
            'action' => $action,
            'ip' => $ipAddress,
            'log_date' => max(0, $date)
        ));
xong
Thế là nó không lưu IP nữa hả bác ?
Nếu em chỉ muốn lưu ip của member và không lưu ip của superadmin ,admin và mod thì sao ?
 
  • Like
Reactions: THB
vậy thì đừng xóa đoạn đó mà thay thành:

PHP:
        if ($this->_getDb()->fetchRow('
            SELECT moderator.*, user.username
            FROM xf_moderator AS moderator
            INNER JOIN xf_user AS user ON (user.user_id = moderator.user_id)
            WHERE moderator.user_id = ?
        ', $userId)==''){
        $this->_getDb()->insert('xf_ip', array(
            'user_id' => $userId,
            'content_type' => $contentType,
            'content_id' => $contentId,
            'action' => $action,
            'ip' => $ipAddress,
            'log_date' => max(0, $date)
        ));}
 
Sửa lần cuối:
vậy thì đừng xóa đoạn đó mà thay thành:

PHP:
        if ($this->_getDb()->fetchRow('
            SELECT moderator.*, user.username
            FROM xf_moderator AS moderator
            INNER JOIN xf_user AS user ON (user.user_id = moderator.user_id)
            WHERE moderator.user_id = ?
        ', $userId)==''){
        $this->_getDb()->insert('xf_ip', array(
            'user_id' => $userId,
            'content_type' => $contentType,
            'content_id' => $contentId,
            'action' => $action,
            'ip' => $ipAddress,
            'log_date' => max(0, $date)
        ));}
Cám ơn bạn . để mình thử
 
vậy thì đừng xóa đoạn đó mà thay thành:

PHP:
        if ($this->_getDb()->fetchRow('
            SELECT moderator.*, user.username
            FROM xf_moderator AS moderator
            INNER JOIN xf_user AS user ON (user.user_id = moderator.user_id)
            WHERE moderator.user_id = ?
        ', $userId)==''){
        $this->_getDb()->insert('xf_ip', array(
            'user_id' => $userId,
            'content_type' => $contentType,
            'content_id' => $contentId,
            'action' => $action,
            'ip' => $ipAddress,
            'log_date' => max(0, $date)
        ));}
Nó vẫn lưu thím à . Xem trong http://domain.xxx/online/ vẫn có IP
 
Nó vẫn lưu thím à . Xem trong http://domain.xxx/online/ vẫn có IP
cái đó là ip đang online, còn lưu là trong table xf_ip, khi nó lưu thì mọi thông hoạt động của user đều ghi nhật ký ip.
còn muốn không hiện ở /online/ đó thì vào template online_list, tìm và xóa:
Mã:
<a href="{xen:if '{$user.user_id}', {xen:link online/user-ip, $user}, {xen:link online/guest-ip, '', 'ip={$user.ipHex}'}}" class="OverlayTrigger ip"><span>{xen:helper ip, $user.ip}</span></a>

đó là xóa toàn bộ, muốn chỉ xóa ở admin hoặc mod thì ko xóa mà thay code thành
Mã:
<xen:if>...hỏi nữa thì nói :)</xen:if>[CODE]
 
Sửa lần cuối:
  • Like
Reactions: THB
Back
Top