Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

adstatistics.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: adstatistics.php 7824 2001-10-12 15:58:37Z br $
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( "ezad/classes/ezad.php" );
36 // include_once( "ezad/classes/ezadcategory.php" );
37
38
39 $ini =& eZINI::instance( 'site.ini' );
40 $Language = $ini->variable( "eZAdMain", "Language" );
41 $ImageDir = $ini->variable( "eZAdMain", "ImageDir" );
42
43 $t = new eZTemplate( "kernel/ezad/admin/" . $ini->variable( "eZAdMain", "AdminTemplateDir" ),
44 "kernel/ezad/admin/intl/", $Language, "adstatistics.php" );
45
46 $t->setAllStrings();
47
48 $t->set_file( array(
49 "ad_edit_page_tpl" => "adstatistics.tpl"
50 ) );
51
52 $t->set_block( "ad_edit_page_tpl", "image_tpl", "image" );
53 $t->set_block( "ad_edit_page_tpl", "html_item_tpl", "html_item" );
54
55
56 $ad = new eZAd( $AdID );
57
58 $t->set_var( "ad_title", $ad->name() );
59 $t->set_var( "ad_description", $ad->description() );
60 $t->set_var( "ad_url", $ad->url() );
61 $t->set_var( "ad_id", $ad->id() );
62
63 $clickCount = $ad->clickCount();
64 $t->set_var( "ad_click_count", $clickCount );
65
66 if ( $clickCount > 0 )
67 $clickRevenue =& $ad->totalClickRevenue();
68 else
69 $clickRevenue=0;
70
71 $viewRevenue =& $ad->totalViewRevenue();
72
73 $t->set_var( "ad_view_revenue", $viewRevenue );
74 $t->set_var( "ad_click_revenue", $clickRevenue );
75
76 $t->set_var( "ad_view_count", $ad->viewCount() );
77
78 $revenueTotal = $clickRevenue + $viewRevenue;
79 $t->set_var( "ad_total_revenue", $revenueTotal );
80
81 $view_count = $ad->viewCount();
82
83 if ( is_numeric( $view_count ) and $view_count != 0 )
84 {
85 $value = ( $ad->clickCount() / $view_count ) * 100;
86 $t->set_var( "ad_click_percent", round( $value, 2 ) );
87 }
88 else
89 {
90 $t->set_var( "ad_click_percent", ( 0 ) );
91 }
92
93 if ( $ad->isActive() == true )
94 {
95 $t->set_var( "ad_is_active", "checked" );
96 }
97 else
98 {
99 $t->set_var( "ad_is_active", "" );
100 }
101
102 if ( $ad->useHTML() )
103 {
104 $t->set_var( "image", "" );
105
106 $t->set_var( "html_banner", $ad->htmlBanner() );
107 $t->parse( "html_item", "html_item_tpl" );
108
109 }
110 else
111 {
112 $image = $ad->image();
113
114 if ( $image )
115 {
116 $t->set_var( "image_src", $image->filePath() );
117 $t->set_var( "image_alt", $image->caption() );
118 $t->set_var( "image_width", $image->width() );
119 $t->set_var( "image_height", $image->height() );
120 $t->set_var( "image_file_name", $image->originalFileName() );
121
122 $t->set_var( "html_item", "" );
123
124 $t->parse( "image", "image_tpl" );
125 }
126 }
127
128 $t->pparse( "output", "ad_edit_page_tpl" );
129
130 ?>
$ad
$ad
Definition: adstatistics.php:56
$ImageDir
$ImageDir
Definition: adstatistics.php:41
$t
$t
Definition: adstatistics.php:43
$clickRevenue
else $clickRevenue
Definition: adstatistics.php:69
$viewRevenue
$viewRevenue
Definition: adstatistics.php:71
$clickCount
$clickCount
Definition: adstatistics.php:63
$Language
$Language
Definition: adstatistics.php:40
$ini
$ini
Definition: adstatistics.php:39
$view_count
$view_count
Definition: adstatistics.php:81
$revenueTotal
$revenueTotal
Definition: adstatistics.php:78
eZAd
Definition: ezad.php:46
eZTemplate
Definition: eztemplate.php:107
$image
$image
Definition: user/articlelist.php:242
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.