source: extensions/User_Info_Tracking/admin/home.php @ 25035

Last change on this file since 25035 was 19701, checked in by Charles2012, 12 years ago

Upload to SVN.

File size: 2.4 KB
Line 
1<?php
2defined('USER_INFO_TRACKING_PATH') or die('Hacking attempt!');
3
4// +-----------------------------------------------------------------------+
5// | Home tab                                                              |
6// +-----------------------------------------------------------------------+
7
8// send variables to template
9//$template->assign(array(
10//  'user_info_tracking' => $conf['user_info_tracking'],
11//  'INTRO_CONTENT' => load_language('intro.html', USER_INFO_TRACKING_PATH, array('return'=>true)),
12//  ));
13
14
15$profile_url = get_root_url().'admin.php?page=profile&amp;user_id=';
16$perm_url = get_root_url().'admin.php?page=user_perm&amp;user_id=';
17
18
19$ip_geolocalisation1 = '<a href="http://www.geoiptool.com/en/?IP=';
20$ip_geolocalisation2 = '" title="Geo IP localisation" target="_blank"><img src="'.USER_INFO_TRACKING_PATH.'images/geoip.ico" class="button" alt="'.l10n('IP_geolocalisation').'"></a>';
21
22$ip_ripe1 = '<a href="http://www.ripe.net/whois?form_type=simple&amp;full_query_string=&amp;searchtext=';
23$ip_ripe2 = '+&amp;do_search=Search" title="Ripe Whois" target="_blank">';
24$ip_ripe3 = '</a>';
25
26
27        $query = '
28        SELECT
29          *
30        FROM
31          [UserinfoMap]
32        WHERE
33          [UserinfoMap::itemId] = ?
34        ';
35
36
37
38$messages = pwg_query("SELECT * FROM `". USER_INFO_TRACKING_TABLE2 ."`
39  ORDER BY timeStamp DESC;");
40 
41if (pwg_db_num_rows($messages)) {
42  while ($message = pwg_db_fetch_assoc($messages)) {
43    $item = array(
44      'id' => $message['id'],
45      'userId' => $message['userId'],
46      'userId2' => $profile_url.$message['userId'],
47      'userId3' => $perm_url.$message['userId'],
48      'userName' => $message['userName'],
49      'ipAddress' => $message['ipAddress'],
50      'timeStamp' => $message['timeStamp'],
51      'action' => $message['action'],
52      'testIpAddress' => $ip_geolocalisation1.$message['ipAddress'].$ip_geolocalisation2.' '.$ip_ripe1.$message['ipAddress'].$ip_ripe2.$message['ipAddress'].$ip_ripe3,
53    );
54//    if (is_admin() OR $message['author'] = $user['username']) {
55//      $item['U_DELETE'] = AM_ADMIN . '&amp;delete_message=' . $message['id'];
56//      $item['U_EDIT'] = AM_ADMIN . '&amp;tab=edit&amp;message_id=' . $message['id'];
57//    } 
58   
59    $template->append('messages', $item);
60  }
61 
62}
63
64
65
66
67
68
69
70
71
72// define template file
73$template->set_filename('user_info_tracking_content', realpath(USER_INFO_TRACKING_PATH . 'admin/template/home.tpl'));
74
75
76?>
Note: See TracBrowser for help on using the repository browser.