Announcement

Collapse
No announcement yet.

Add Detailed IP Info Modal to the Who's Online page

Collapse
X
Collapse
First Prev Next Last
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • glennrocksvb
    replied
    Don't you already restrict the Who's Online module itself to specific usergroups?

    Leave a comment:


  • Snowhog
    replied
    Does this MOD allow for selection of user groups who can use this? If it doesn’t, can you modify it so it does?

    Leave a comment:


  • glennrocksvb
    replied
    Unfortunately no. This is an HTML change that includes some JavaScript for the modal. It cannot be done in CSS which is for styling purposes only.

    Leave a comment:


  • Snowhog
    replied
    Can this be coded for css_additional.css and avoid the issue of updated templates?

    Leave a comment:


  • glennrocksvb
    commented on 's reply
    Here you go...

    Admins receive the New User email notification whenever a new user signs up to their forum. By default, the email shows an unclickable plain-text IP address of the user. To convert the IP Address in the email into a clickable link that shows detailed IP information that includes, city, region, country, postal code, ISP

  • glennrocksvb
    replied
    You can do something similar to the New User email notifications sent to the Admins when a new user signs up. The email contains IP address of the user which you can also link to ipinfo.io. I will post it separately.

    Leave a comment:


  • Add Detailed IP Info Modal to the Who's Online page

    By default in vB5, clicking the IP Address of a user in the Who's Online page (/online) just shows you the hostname information of the user. That is not very useful. What you want to know is what country, state/region, city, postal code the user is approximately in. Additional information such as internet service and timezone is also useful.

    To enable you to see detailed IP information, we can utilize the ipinfo.io website to give us those information. Please see instructions below on how to do it.
    1. Logon to AdminCP.
    2. Go to Styles β†’ Search in Templates
    3. Choose the target style/theme in the "Search in Style" dropdown.
    4. In the "Search for Text" field, type onlineuser_details.
    5. Select "Yes" in the "Search Titles Only" radio button.
    6. Click Find button.
    7. In the search results, double-click the template to edit it or select it then click Customize button.
    8. Find the following code. This is used on desktop/tablet: (Hint: This is near the middle section of the template)
      HTML Code:
      	<a href="#" class="resolveIpLink">{vb:var onlineUser.host}</a>
    9. Replace it with the following code:
      HTML Code:
      	<vb:comment><a href="#" class="resolveIpLink">{vb:var onlineUser.host}</a></vb:comment>
      	<a href="https://ipinfo.io/{vb:var onlineUser.host}/json" class="resolveIpLink-new" target="_blank" rel="noopener" onclick="var w=600,h=200,y=window.outerHeight/2 + window.screenY - (h/2),x=(window.outerWidth/2) + window.screenX - (w/2);window.open(this.href, 'ipInfoWin', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + y + ', left=' + x);return false;">{vb:var onlineUser.host}</a>
    10. Find another instance of the same code. This is used on mobile. (Hint: This is near the bottom section of the template)
      HTML Code:
      <a href="#" class="resolveIpLink">{vb:var onlineUser.host}</a>
    11. Replace it with the following code:
      HTML Code:
      <vb:comment><a href="#" class="resolveIpLink">{vb:var onlineUser.host}</a></vb:comment>
      	<a href="https://ipinfo.io/{vb:var onlineUser.host}/json" class="resolveIpLink-new" target="_blank" rel="noopener">{vb:var onlineUser.host}</a>
    12. Click Save button.
    13. Repeat Steps 2-10 for other active styles/themes on your forum (if any).
    14. Go to the Who's Online page on your forum (/online) to confirm the change is working. See sample IP Address modal below:

      Click image for larger version  Name:	ipinfo-modal.png Views:	6 Size:	52.6 KB ID:	23280

    If you are using CloudFlare, Sucuri or something similar, you may not be able to see the actual user's IP address. To fix that, you have do this.

    NOTE: This mod requires editing an existing vB5 template which means a template merge conflict may arise during vB5 upgrade. In which case, you'd need to resolve the conflict to make sure the template would still be working as intended. This also means that this mod cannot be done in vBCloud as it does not allow to edit existing vB5 templates.
    Last edited by glennrocksvb; 03-28-2022, 04:54 PM. Reason: Updated steps for mobile

Latest Posts

Collapse

Working...
X
Searching...Please wait.
An unexpected error was returned: 'Your submission could not be processed because you have logged in since the previous page was loaded.

Please push the back button and reload the previous window.'
An unexpected error was returned: 'Your submission could not be processed because the token has expired.

Please push the back button and reload the previous window.'
An internal error has occurred and the module cannot be displayed.
There are no results that meet this criteria.
Search Result for "|||"