Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

pageviewlist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: pageviewlist.php 8239 2001-11-02 06:46:24Z br $
5 //
6 // Created on: <06-Jan-2001 17:11:01 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 // include_once( "classes/ezlocale.php" );
36
37 // include_once( "ezstats/classes/ezpageview.php" );
38 // include_once( "ezstats/classes/ezpageviewquery.php" );
39
40 $t = new eZTemplate( "kernel/ezstats/admin/" . $ini->variable( "eZStatsMain", "AdminTemplateDir" ),
41 "kernel/ezstats/admin/intl", $Language, "pageviewlist.php" );
42
43 $t->setAllStrings();
44
45 $t->set_file( "page_view_page_tpl", "pageviewlist.tpl" );
46
47 $t->set_block( "page_view_page_tpl", "page_view_list_tpl", "page_view_list" );
48 $t->set_block( "page_view_list_tpl", "page_view_tpl", "page_view" );
49
50 if ( !isset( $Offset ) or !is_numeric( $Offset ) )
51 $Offset = 0;
52
53 $latest =& eZPageViewQuery::latest( $ViewLimit, $Offset );
54
55 $ItemCount = eZPageViewQuery::latestCount();
56 $ItemCount = count( $latest );
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 $locale = new eZLocale( $Language );
64
65 if ( count( $latest ) > 0 )
66 {
67 $i = 0;
68 foreach ( $latest as $pageview )
69 {
70 if ( ( $i %2 ) == 0 )
71 $t->set_var( "bg_color", "bglight" );
72 else
73 $t->set_var( "bg_color", "bgdark" );
74
75 $dateTime = $pageview->dateTime();
76 $time =& $dateTime->time();
77 $t->set_var( "request_time", $locale->format( $dateTime ) );
78 $t->set_var( "remote_ip", $pageview->remoteIP() );
79 $t->set_var( "remote_host_name", $pageview->remoteHostName() );
80 $t->set_var( "request_page", $pageview->requestPage() );
81
82 $t->parse( "page_view", "page_view_tpl", true );
83 $i++;
84 }
85 eZList::drawNavigator( $t, $ItemCount, $ViewLimit, $Offset, "page_view_list_tpl" );
86
87 $t->parse( "page_view_list", "page_view_list_tpl" );
88 }
89 else
90 {
91 $t->set_var( "page_view_list", "" );
92 }
93
94 $t->pparse( "output", "page_view_page_tpl" );
95
96 ?>
$i
$i
Definition: admin/adlist.php:91
$dateTime
$dateTime
Definition: authorview.php:77
eZList\drawNavigator
static drawNavigator(&$t, $total_types, $max_types, $index, $parent=false, $variables=false)
Definition: ezlist.php:401
eZLocale
Definition: ezlocale.php:119
eZPageViewQuery\latest
static & latest( $limit=20, $offset=0)
Definition: ezpageviewquery.php:182
eZPageViewQuery\latestCount
static & latestCount()
Definition: ezpageviewquery.php:205
eZTemplate
Definition: eztemplate.php:107
$Offset
$Offset
Definition: ezarticle/user/search.php:110
$time
$time
Definition: homepage.php:327
$latest
$latest
Definition: pageviewlist.php:53
$locale
$locale
Definition: pageviewlist.php:63
$t
$t
Definition: pageviewlist.php:40
$Language
$Language
Definition: pageviewlist.php:30
$ini
$ini
Definition: pageviewlist.php:28
$ItemCount
$ItemCount
Definition: pageviewlist.php:55
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.