Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

user/tiplist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: tiplist_tpl.php,v 1.21.2.3 2002/010/08 11:56:16 master Exp $
5 //
6 // Created on: <25-Nov-2000 15:44:37 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( "ezuser/classes/ezuser.php" );
28 include_once( "classes/eztemplate.php" );
29
30 include_once( "eztip/classes/eztip.php" );
31 include_once( "eztip/classes/eztipcategory.php" );
32 include_once( "ezsitemanager/classes/ezsection.php" );
33 // site information
34 include_once( "classes/INIFile.php" );
35
36 $ini =& eZINI::instance( 'site.ini' );
37 $GlobalSiteIni =& $ini;
38 $category = new eZTipCategory( $CategoryID );
39
40 // fetch the user if any
41 $user =& eZUser::currentUser();
42 if ( !isset( $Limit ) )
43 $Limit = 1;
44 if ( !isset( $tipLocationID ) )
45 $tipLocationID = 0;
46 if ( !isset( $showTitle ) )
47 $showTitle = 0;
48 if ( !isset( $Offset ) )
49 $Offset = 0;
50
51 // tips
52 $tiplist_tpl =& $category->tips( "count", false, $Offset, $Limit, $tipLocationID );
53
54 /* for debugging
55 echo "<pre>";
56 print_r($tiplist_tpl);
57 echo "<pre>";
58 exit ();
59 */
60
61 if (count($tiplist_tpl) != 0) {
62
63 $Language = $ini->variable( "eZTipMain", "Language" );
64 unset($t);
65 $t = new eZTemplate( "eztip/user/" . $ini->variable( "eZTipMain", "TemplateDir" ), "eztip/user/intl", $Language, "tiplist.php" );
66
67 $t->setAllStrings();
68 $t->set_file( array(
69 "tiplist_tpl" => "tiplist.tpl"
70 ) );
71
72 $t->set_block( "tiplist_tpl", "tip_image_tpl", "tip_image" );
73 $t->set_block( "tiplist_tpl", "tip_html_tpl", "tip_html" );
74 $t->set_block( "tiplist_tpl", "tip_link_tpl", "tip_link" );
75 $t->set_block( "tiplist_tpl", "tip_title_tpl", "tip_title" );
76
77 if ($showTitle <> 1)
78 $t->set_var("tip_title", "");
79
80 $t->set_var( "site-design", $siteDesign );
81
82 foreach ( $tiplist_tpl as $tip )
83 {
84 $tipID = $tip->id();
85
86 $image =& $tip->image();
87
88 // ad image
89 if ( $image )
90 {
91 $variation =& $image->requestImageVariation( 145 , 200 );
92 $imgSRC =& $variation->imagePath( true ) ;
93 $imgWidth =& $variation->width();
94 $imgHeight =& $variation->height();
95 $imgName =& $image->name();
96 $t->set_var("tip_title", "");
97
98 }
99
100 $tip->addPageView();
101
102 if ( $tip->useHTML() )
103 {
104 if ($showTitle == 1)
105 {
106 $tipCat = $tip->categories();
107 $t->set_var("title_text", $tipCat[0]->Name );
108 $t->parse( "tip_title", "tip_title_tpl" );
109 }
110
111 $t->set_var("tip_image", "");
112 $t->set_var("html", $tip->htmlBanner());
113 $t->set_var("tip_id", $tipID);
114 if ( trim($tip->URL()) != "" )
115 {
116 //EP: check if it is external or internal banner --------------------
117 if ( preg_match( "/^([a-z]+:\/\/)/", $tip->URL() ) )
118 {
119 $t->set_var("tip_target", "_blank");
120 }
121 else
122 {
123 $t->set_var("tip_target", "_self");
124 }
125 //EP ----------------------------------------------------------------
126 $t->parse( "tip_link", "tip_link_tpl" );
127 } else {
128 $t->set_var("tip_link", "");
129 }
130 $t->parse( "tip_html", "tip_html_tpl" );
131 }
132 else
133 {
134 $t->set_var("tip_id", $tipID);
135 $t->set_var("image_width", $imgWidth);
136 $t->set_var("image_height", $imgHeight);
137 $t->set_var("tip_name", $imgName);
138 $t->set_var("image_src", $imgSRC);
139 $t->set_var("tip_html", "");
140 $t->set_var("tip_link", "");
141
142 if ( trim($tip->URL()) != "" )
143 {
144 $t->set_var("link", "/tip/goto/$tipID/" );
145
146 if ( preg_match( "/^([a-z]+:\/\/)/", $tip->URL() ) )
147 {
148 $t->set_var("link_start", '<a target="_blank" href="/tip/goto/' . $tipID . '/">' );
149 $t->set_var("link_end", "</a>" );
150 }
151 else
152 {
153 $t->set_var("link_start", '<a target="_self" href="/tip/goto/' . $tipID . '/">' );
154 $t->set_var("link_end", "</a>" );
155 }
156 } else {
157 $t->set_var("link_start", "" );
158 $t->set_var("link_end", "" );
159 }
160 $t->parse( "tip_image", "tip_image_tpl" );
161 }
162 }
163
164 $output = $t->parse( "output", "tiplist_tpl" );
165 print $output;
166 unset($showTitle);
167 }
168 ?>
$CategoryID
$CategoryID
Definition: admin/articleedit.php:53
eZTemplate
Definition: eztemplate.php:107
eZTipCategory
Definition: eztipcategory.php:44
eZUser\currentUser
static & currentUser()
Definition: ezuser.php:896
$t
foreach( $Modules as $module) if(isset( $ItemInsert)) $t
Definition: classes/admin/linklist.php:168
$Language
$Language
Definition: classes/admin/linklist.php:65
$Limit
$Limit
Definition: ezarticle/admin/categorylist.php:66
$Offset
$Offset
Definition: ezarticle/user/search.php:110
$variation
$variation
Definition: ezimagecatalogue/user/menubox.php:55
$output
$output
Definition: formpreview.php:81
Name
if($user) if(isset( $next) && $next)<?=isset($all_fields_error) &&$all_fields_error ?><?=isset($password_error) &&$password_error ?></p ><? endif;?>< form method="post">< table border="0" cellspacing="2" cellpadding="2" class="boxtext" style="font-size=13;">< tr >< td style="color:<?= isset( $error['first_name'] ) ?> First Name
Definition: step1.php:127
$tip
$tip
Definition: tipstatistics.php:57
$image
$image
Definition: user/articlelist.php:242
$category
$category
Definition: user/tiplist.php:38
$user
$user
Definition: user/tiplist.php:41
$ini
$ini
Definition: user/tiplist.php:36
$tiplist_tpl
$tiplist_tpl
Definition: user/tiplist.php:52
$GlobalSiteIni
$GlobalSiteIni
Definition: user/tiplist.php:37
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.