- <?php
- /*====================================================================*/
- /* What Visited my profile */
- /* For vBulletin 3.8.x */
- /* by StenLi (http://vbsupport.org/forum/member.php?u=42925) */
- /* Hook support (http://vbsupport.org/forum/showthread.php?p=303052) */
- /*====================================================================*/
- // ####################### SET PHP ENVIRONMENT ###########################
- error_reporting(E_ALL & ~E_NOTICE);
- // #################### DEFINE IMPORTANT CONSTANTS #######################
- define('THIS_SCRIPT', 'myip');
- define('CSRF_PROTECTION', true);
- // ################### PRE-CACHE TEMPLATES AND DATA ######################
- // get special phrase groups
- $phrasegroups = array(
- 'user',
- );
- // get special data templates from the datastore
- $actiontemplates = array();
- // pre-cache templates used by specific actions
- $globaltemplates = array(
- 'myip_s',
- 'myip_s_bits'
- );
- // ######################### REQUIRE BACK-END ############################
- require_once('./global.php');
- // Если пользователь не залогинен, то кидаем на страницу ошибки
- if(!$vbulletin->userinfo['userid'])
- {
- print_no_permission();
- }
- // UserID
- $un1=&$vbulletin->userinfo['userid'];
- // Запрос к бд по USERID
- $r=$db->query_read_slave("SELECT * FROM " . TABLE_PREFIX . "myip WHERE user_login = '".$un1."' LIMIT 20");
- // Цикл вывода
- while($rop = $db->fetch_array($r))
- {
- $ip=$rop['ip']; // IP адрес
- $date=$rop['date']; // Дата входа
- $u_agent=htmlspecialchars($rop['user_agent']); // Юзер агент
- eval('$myipbits.="' . fetch_template('myip_s_bits') . '";');
- }
- $navbits = array();
- $navbits[$parent] = 'MY IP - Информация'; // Заголовок navbar
- $navbits = construct_navbits(array());
- eval('$navbar = "' . fetch_template('navbar') . '";');
- eval('print_output("' . fetch_template('myip_s') . '");');
- // ################### MY IP END ######################
- ?>