Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

visitorlist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: visitorlist.php 8239 2001-11-02 06:46:24Z br $
5 //
6 // Created on: <07-Jan-2001 12:56:58 bf>
7 //
8 // This source file is part of Exponential Basic, publishing software.
9 //
10 // Copyright (C) 1999-2001 eZ Systems. All rights reserved.
11 //
12 // This program is free software; you can redistribute it and/or
13 // modify it under the terms of the GNU General Public License
14 // as published by the Free Software Foundation; either version 2
15 // of the License, or (at your option) any later version.
16 //
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program; if not, write to the Free Software
24 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
25 //
26
27 // include_once( "classes/INIFile.php" );
28 $ini =& eZINI::instance( 'site.ini' );
29
30 $Language = $ini->variable( "eZStatsMain", "Language" );
31
32 // include_once( "classes/eztemplate.php" );
33 // include_once( "classes/ezdate.php" );
34 // include_once( "classes/ezlist.php" );
35
36 // include_once( "ezstats/classes/ezpageview.php" );
37 // include_once( "ezstats/classes/ezpageviewquery.php" );
38
39 $t = new eZTemplate( "kernel/ezstats/admin/" . $ini->variable( "eZStatsMain", "AdminTemplateDir" ),
40 "kernel/ezstats/admin/intl", $Language, "visitorlist.php" );
41
42 $t->setAllStrings();
43
44 $t->set_file( "visitor_page_tpl", "visitorlist.tpl" );
45
46 $t->set_block( "visitor_page_tpl", "visitor_list_tpl", "visitor_list" );
47 $t->set_block( "visitor_list_tpl", "visitor_tpl", "visitor" );
48
49
50 if ( !isset( $Offset ) or !is_numeric( $Offset ) )
51 $Offset = 0;
52 if ( !isset( $ViewLimit ) or !is_numeric( $ViewLimit ) )
53 $ViewLimit = 25;
54
55 $latest =& eZPageViewQuery::topVisitors( $ViewLimit, $Offset );
56 $ItemCount = eZPageViewQuery::topVisitorsCount();
57
58 $t->set_var( "item_start", $Offset + 1 );
59 $t->set_var( "item_end", $Offset + $ViewLimit );
60 $t->set_var( "item_count", $ItemCount );
61 $t->set_var( "item_limit", $ViewLimit );
62
63 if ( count( $latest ) > 0 )
64 {
65 $i = 0;
66 foreach ( $latest as $visitor )
67 {
68 if ( ( $i %2 ) == 0 )
69 $t->set_var( "bg_color", "bglight" );
70 else
71 $t->set_var( "bg_color", "bgdark" );
72
73 $t->set_var( "remote_ip", $visitor["IP"] );
74 $t->set_var( "remote_host_name", $visitor["HostName"] );
75 $t->set_var( "page_view_count", $visitor["Count"] );
76
77 $t->parse( "visitor", "visitor_tpl", true );
78 $i++;
79 }
80 eZList::drawNavigator( $t, $ItemCount, $ViewLimit, $Offset, "visitor_list_tpl" );
81
82 $t->parse( "visitor_list", "visitor_list_tpl" );
83 }
84 else
85 {
86 $t->set_var( "visitor_list", "" );
87 }
88
89 $t->pparse( "output", "visitor_page_tpl" );
90
91 ?>
$i
$i
Definition: admin/adlist.php:91
eZList\drawNavigator
static drawNavigator(&$t, $total_types, $max_types, $index, $parent=false, $variables=false)
Definition: ezlist.php:401
eZPageViewQuery\topVisitorsCount
static & topVisitorsCount()
Definition: ezpageviewquery.php:273
eZPageViewQuery\topVisitors
static & topVisitors( $limit=20, $offset=0)
Definition: ezpageviewquery.php:226
eZTemplate
Definition: eztemplate.php:107
$Offset
$Offset
Definition: ezarticle/user/search.php:110
$latest
$latest
Definition: visitorlist.php:55
$t
$t
Definition: visitorlist.php:39
$Language
$Language
Definition: visitorlist.php:30
$ini
$ini
Definition: visitorlist.php:28
$ItemCount
$ItemCount
Definition: visitorlist.php:56
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.