Révision 5d12d676
Ajouté par Assos Assos il y a environ 6 ans
drupal7/sites/all/modules/views/modules/statistics.views.inc | ||
---|---|---|
12 | 12 |
*/ |
13 | 13 |
function statistics_views_data() { |
14 | 14 |
// Basic table information. |
15 |
|
|
16 | 15 |
// ---------------------------------------------------------------- |
17 |
// node_counter table |
|
18 |
|
|
16 |
// 'node_counter' table. |
|
19 | 17 |
$data['node_counter']['table']['group'] = t('Content statistics'); |
20 | 18 |
|
19 |
// Joins to the node table. |
|
21 | 20 |
$data['node_counter']['table']['join'] = array( |
22 |
// ...to the node table |
|
23 | 21 |
'node' => array( |
24 | 22 |
'left_field' => 'nid', |
25 | 23 |
'field' => 'nid', |
26 | 24 |
), |
27 | 25 |
); |
28 | 26 |
|
29 |
// totalcount
|
|
27 |
// Total count.
|
|
30 | 28 |
$data['node_counter']['totalcount'] = array( |
31 | 29 |
'title' => t('Total views'), |
32 | 30 |
'help' => t('The total number of times the node has been viewed.'), |
... | ... | |
34 | 32 |
'field' => array( |
35 | 33 |
'handler' => 'views_handler_field_statistics_numeric', |
36 | 34 |
'click sortable' => TRUE, |
37 |
),
|
|
35 |
), |
|
38 | 36 |
'filter' => array( |
39 | 37 |
'handler' => 'views_handler_filter_numeric', |
40 | 38 |
), |
... | ... | |
43 | 41 |
), |
44 | 42 |
); |
45 | 43 |
|
46 |
// daycount
|
|
44 |
// Day count.
|
|
47 | 45 |
$data['node_counter']['daycount'] = array( |
48 | 46 |
'title' => t('Views today'), |
49 | 47 |
'help' => t('The total number of times the node has been viewed today.'), |
... | ... | |
51 | 49 |
'field' => array( |
52 | 50 |
'handler' => 'views_handler_field_statistics_numeric', |
53 | 51 |
'click sortable' => TRUE, |
54 |
),
|
|
52 |
), |
|
55 | 53 |
'filter' => array( |
56 | 54 |
'handler' => 'views_handler_filter_numeric', |
57 | 55 |
), |
... | ... | |
60 | 58 |
), |
61 | 59 |
); |
62 | 60 |
|
63 |
// timestamp
|
|
61 |
// Timestamp.
|
|
64 | 62 |
$data['node_counter']['timestamp'] = array( |
65 | 63 |
'title' => t('Most recent view'), |
66 | 64 |
'help' => t('The most recent time the node has been viewed.'), |
... | ... | |
77 | 75 |
), |
78 | 76 |
); |
79 | 77 |
|
80 |
|
|
81 | 78 |
// ---------------------------------------------------------------- |
82 |
// accesslog table |
|
83 |
|
|
79 |
// 'accesslog' table. |
|
84 | 80 |
$data['accesslog']['table']['group'] = t('Access log'); |
85 | 81 |
|
86 |
// Advertise this table as a possible base table |
|
82 |
// Advertise this table as a possible base table.
|
|
87 | 83 |
$data['accesslog']['table']['base'] = array( |
88 | 84 |
'field' => 'aid', |
89 | 85 |
'title' => t('Access log'), |
... | ... | |
91 | 87 |
'weight' => 10, |
92 | 88 |
); |
93 | 89 |
|
94 |
// For other base tables, explain how we join |
|
90 |
// For other base tables, explain how we join.
|
|
95 | 91 |
$data['accesslog']['table']['join'] = array( |
96 | 92 |
'users' => array( |
97 | 93 |
'field' => 'uid', |
98 | 94 |
'left_field' => 'uid', |
99 |
),
|
|
95 |
), |
|
100 | 96 |
); |
101 | 97 |
|
102 |
// accesslog.aid
|
|
98 |
// Access event ID / 'aid'.
|
|
103 | 99 |
$data['accesslog']['aid'] = array( |
104 | 100 |
'title' => t('Aid'), |
105 | 101 |
'help' => t('Unique access event ID.'), |
... | ... | |
120 | 116 |
), |
121 | 117 |
); |
122 | 118 |
|
123 |
// session id
|
|
119 |
// Session ID.
|
|
124 | 120 |
$data['accesslog']['sid'] = array( |
125 | 121 |
'title' => t('Session ID'), |
126 | 122 |
'help' => t('Browser session ID of user that visited page.'), |
... | ... | |
128 | 124 |
'field' => array( |
129 | 125 |
'handler' => 'views_handler_field', |
130 | 126 |
'click sortable' => TRUE, |
131 |
),
|
|
132 |
'filter' => array(
|
|
127 |
), |
|
128 |
'filter' => array( |
|
133 | 129 |
'handler' => 'views_handler_filter_string', |
134 |
),
|
|
135 |
'argument' => array(
|
|
136 |
'handler' => 'views_handler_argument_string',
|
|
137 |
),
|
|
138 |
'sort' => array(
|
|
130 |
), |
|
131 |
'argument' => array( |
|
132 |
'handler' => 'views_handler_argument_string', |
|
133 |
), |
|
134 |
'sort' => array( |
|
139 | 135 |
'handler' => 'views_handler_sort', |
140 |
),
|
|
136 |
), |
|
141 | 137 |
); |
142 | 138 |
|
143 |
// title
|
|
139 |
// Title.
|
|
144 | 140 |
$data['accesslog']['title'] = array( |
145 | 141 |
'title' => t('Page title'), |
146 | 142 |
'help' => t('Title of page visited.'), |
... | ... | |
148 | 144 |
'field' => array( |
149 | 145 |
'handler' => 'views_handler_field_accesslog_path', |
150 | 146 |
'click sortable' => TRUE, |
151 |
),
|
|
152 |
'filter' => array(
|
|
147 |
), |
|
148 |
'filter' => array( |
|
153 | 149 |
'handler' => 'views_handler_filter_string', |
154 |
),
|
|
155 |
'sort' => array(
|
|
150 |
), |
|
151 |
'sort' => array( |
|
156 | 152 |
'handler' => 'views_handler_sort', |
157 |
),
|
|
158 |
'argument' => array(
|
|
153 |
), |
|
154 |
'argument' => array( |
|
159 | 155 |
'handler' => 'views_handler_argument_string', |
160 |
),
|
|
156 |
), |
|
161 | 157 |
); |
162 | 158 |
|
163 |
// path
|
|
159 |
// Path.
|
|
164 | 160 |
$data['accesslog']['path'] = array( |
165 | 161 |
'title' => t('Path'), |
166 | 162 |
'help' => t('Internal path to page visited (relative to Drupal root.)'), |
... | ... | |
168 | 164 |
'field' => array( |
169 | 165 |
'handler' => 'views_handler_field_accesslog_path', |
170 | 166 |
'click sortable' => TRUE, |
171 |
), |
|
172 |
'filter' => array( |
|
173 |
'handler' => 'views_handler_filter_string', |
|
174 |
), |
|
175 |
'sort' => array( |
|
176 |
'handler' => 'views_handler_sort', |
|
177 |
), |
|
178 |
//No argument here. Can't send forward slashes as arguments. |
|
179 |
//Can be worked around by node ID. |
|
180 |
//(but what about aliases?) |
|
167 |
), |
|
168 |
'filter' => array( |
|
169 |
'handler' => 'views_handler_filter_string', |
|
170 |
), |
|
171 |
'sort' => array( |
|
172 |
'handler' => 'views_handler_sort', |
|
173 |
), |
|
174 |
// No argument here. Can't send forward slashes as arguments. Can be |
|
175 |
// worked around by node ID. (but what about aliases?) |
|
181 | 176 |
); |
182 | 177 |
|
183 |
// referrer
|
|
178 |
// Referrer.
|
|
184 | 179 |
$data['accesslog']['url'] = array( |
185 | 180 |
'title' => t('Referrer'), |
186 | 181 |
'help' => t('Referrer URI.'), |
187 | 182 |
'field' => array( |
188 | 183 |
'handler' => 'views_handler_field_url', |
189 | 184 |
'click sortable' => TRUE, |
190 |
),
|
|
185 |
), |
|
191 | 186 |
'filter' => array( |
192 | 187 |
'handler' => 'views_handler_filter_string', |
193 | 188 |
), |
... | ... | |
196 | 191 |
), |
197 | 192 |
); |
198 | 193 |
|
199 |
// hostname
|
|
194 |
// Hostname.
|
|
200 | 195 |
$data['accesslog']['hostname'] = array( |
201 | 196 |
'title' => t('Hostname'), |
202 | 197 |
'help' => t('Hostname of user that visited the page.'), |
203 | 198 |
'field' => array( |
204 | 199 |
'handler' => 'views_handler_field', |
205 | 200 |
'click sortable' => TRUE, |
206 |
),
|
|
201 |
), |
|
207 | 202 |
'filter' => array( |
208 | 203 |
'handler' => 'views_handler_filter_string', |
209 | 204 |
), |
... | ... | |
215 | 210 |
), |
216 | 211 |
); |
217 | 212 |
|
218 |
// user
|
|
213 |
// User ID / 'uid'.
|
|
219 | 214 |
$data['accesslog']['uid'] = array( |
220 | 215 |
'title' => t('User'), |
221 | 216 |
'help' => t('The user who visited the site.'), |
... | ... | |
223 | 218 |
'handler' => 'views_handler_relationship', |
224 | 219 |
'base' => 'users', |
225 | 220 |
'base field' => 'uid', |
226 |
),
|
|
221 |
), |
|
227 | 222 |
); |
228 | 223 |
|
229 |
// timer
|
|
224 |
// Timer.
|
|
230 | 225 |
$data['accesslog']['timer'] = array( |
231 | 226 |
'title' => t('Timer'), |
232 | 227 |
'help' => t('Time in milliseconds that the page took to load.'), |
... | ... | |
242 | 237 |
), |
243 | 238 |
); |
244 | 239 |
|
245 |
// timestamp
|
|
240 |
// Timestamp.
|
|
246 | 241 |
$data['accesslog']['timestamp'] = array( |
247 | 242 |
'title' => t('Timestamp'), |
248 | 243 |
'help' => t('Timestamp of when the page was visited.'), |
... | ... | |
258 | 253 |
), |
259 | 254 |
); |
260 | 255 |
|
261 |
|
|
262 | 256 |
return $data; |
263 | 257 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules