vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 5.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=259)
-   -   Miscellaneous Hacks - [vBMods.rocks] Add Detailed IP Info Modal to the Who's Online page (https://vborg.vbsupport.ru/showthread.php?t=329141)

noypiscripter 01-27-2022 10:00 PM

[vBMods.rocks] Add Detailed IP Info Modal to the Who's Online page
 
1 Attachment(s)
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:
    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. Click Save button.
  11. Repeat Steps 2-10 for other active styles/themes on your forum (if any).
  12. Go to the Who's Online page on your forum (/online) to confirm the change is working. See sample IP Address modal below:

Go to https://vbmods.rocks/forum/vbulletin...-s-online-page for screenshot and more info.

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.


All times are GMT. The time now is 02:32 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01143 seconds
  • Memory Usage 1,718KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete