Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

tipstatistics.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: tipstatistics.php,v 1.15 2001/10/12 15:58:37 br Exp $
5 //
6 // Created on: <26-Nov-2000 11:47:03 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 // include_once( "classes/eztemplate.php" );
29 // include_once( "classes/ezlocale.php" );
30 // include_once( "classes/ezimagefile.php" );
31 // include_once( "classes/ezlog.php" );
32
33 // include_once( "classes/ezdatetime.php" );
34
35 // include_once( "eztip/classes/eztip.php" );
36 // include_once( "eztip/classes/eztipcategory.php" );
37
38
39 $ini =& eZINI::instance( 'site.ini' );
40
41 $Language = $ini->variable( "eZTipMain", "Language" );
42 $ImageDir = $ini->variable( "eZTipMain", "ImageDir" );
43
44 $t = new eZTemplate( "kernel/eztip/admin/" . $ini->variable( "eZTipMain", "AdminTemplateDir" ),
45 "kernel/eztip/admin/intl/", $Language, "tipstatistics.php" );
46
47 $t->setAllStrings();
48
49 $t->set_file( array(
50 "tip_edit_page_tpl" => "tipstatistics.tpl"
51 ) );
52
53 $t->set_block( "tip_edit_page_tpl", "image_tpl", "image" );
54 $t->set_block( "tip_edit_page_tpl", "html_item_tpl", "html_item" );
55
56
57 $tip = new eZTip( $TipID );
58
59 $t->set_var( "tip_title", $tip->name() );
60 $t->set_var( "tip_description", $tip->description() );
61 $t->set_var( "tip_url", $tip->url() );
62 $t->set_var( "tip_id", $tip->id() );
63
64 $clickCount = $tip->clickCount();
65 $t->set_var( "tip_click_count", $clickCount );
66
67 $t->set_var( "tip_view_count", $tip->viewCount() );
68
69 $view_count = $tip->viewCount();
70
71 if ( is_numeric( $view_count ) and $view_count != 0 )
72 {
73 $value = ( $tip->clickCount() / $view_count ) * 100;
74 $t->set_var( "tip_click_percent", round( $value, 2 ) );
75 }
76 else
77 {
78 $t->set_var( "tip_click_percent", ( 0 ) );
79 }
80
81 if ( $tip->isActive() == true )
82 {
83 $t->set_var( "tip_is_active", "checked" );
84 }
85 else
86 {
87 $t->set_var( "tip_is_active", "" );
88 }
89
90 if ( $tip->useHTML() )
91 {
92 $t->set_var( "image", "" );
93
94 $t->set_var( "html_banner", $tip->htmlBanner() );
95 $t->parse( "html_item", "html_item_tpl" );
96
97 }
98 else
99 {
100 $image = $tip->image();
101
102 if ( $image )
103 {
104 $t->set_var( "image_src", $image->filePath() );
105 $t->set_var( "image_alt", $image->caption() );
106 $t->set_var( "image_width", $image->width() );
107 $t->set_var( "image_height", $image->height() );
108 $t->set_var( "image_file_name", $image->originalFileName() );
109
110 $t->set_var( "html_item", "" );
111
112 $t->parse( "image", "image_tpl" );
113 }
114 }
115
116 $t->pparse( "output", "tip_edit_page_tpl" );
117
118 ?>
eZTemplate
Definition: eztemplate.php:107
eZTip
Definition: eztip.php:46
$ImageDir
$ImageDir
Definition: tipstatistics.php:42
$t
$t
Definition: tipstatistics.php:44
$clickCount
$clickCount
Definition: tipstatistics.php:64
$Language
$Language
Definition: tipstatistics.php:41
$ini
$ini
Definition: tipstatistics.php:39
$tip
$tip
Definition: tipstatistics.php:57
$view_count
$view_count
Definition: tipstatistics.php:69
$image
$image
Definition: user/articlelist.php:242
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.