Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

articlelinks.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: articlelinks.php 6344 2001-08-01 16:22:23Z kaid $
5 //
6 // Created on: <03-Jan-2001 10:47:00 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 // graham : php - error log fix project : 20005-05-27 (undefined variable patch)
28 // this just shuts of the hundreds of thousands of error log entries (performance)
29 $DefaultLinkText = "";
30
31 $ArticlePageCaching =& $ini->variable( "eZArticleMain", "PageCaching");
32 $PageCaching = "disabled";
33
34 $PureStatic = "false";
35 //$PureStatic ="true";
36
37 // unset( $CacheFile );
38 unset( $GenerateStaticPage );
39
40 if ( $PageCaching == "enabled" )
41 {
42 // include_once( "classes/ezcachefile.php" );
43 $CacheFile = new eZCacheFile( "kernel/ezarticle/cache/",
44 array( "articlelinklist", $CategoryID, $url_array[3], $GlobalSiteDesign ),
45 "cache", "," );
46 if ( $CacheFile->exists() )
47 {
48 include( $CacheFile->filename( true ) );
49 $PureStatic = "true";
50 }
51 else
52 {
53 $GenerateStaticPage = "true";
54 }
55 }
56
57 if ( $PureStatic != "true" )
58 {
59 // include_once( "classes/INIFile.php" );
60 // include_once( "classes/eztemplate.php" );
61 // include_once( "classes/ezlocale.php" );
62
63 // include_once( "ezarticle/classes/ezarticlecategory.php" );
64 // include_once( "ezarticle/classes/ezarticle.php" );
65 // include_once( "ezarticle/classes/ezarticlerenderer.php" );
66
67 $ini =& eZINI::instance( 'site.ini' );
68 $Language = $ini->variable( "eZArticleMain", "Language" );
69 $ImageDir = $ini->variable( "eZArticleMain", "ImageDir" );
70
71 $t = new eZTemplate( "kernel/ezarticle/user/" . $ini->variable( "eZArticleMain", "TemplateDir" ),
72 "kernel/ezarticle/user/intl/", $Language, "articlelinks.php" );
73
74 $t->setAllStrings();
75
76 $t->set_file( array(
77 "article_list_page_tpl" => "articlelinks.tpl"
78 ) );
79
80
81 $t->set_block( "article_list_page_tpl", "article_list_tpl", "article_list" );
82 $t->set_block( "article_list_tpl", "article_item_tpl", "article_item" );
83
84 $t->set_var( "image_dir", $ImageDir );
85 $t->set_var( "sitedesign", $GlobalSiteDesign );
86
87 $category = new eZArticleCategory( $CategoryID );
88
89 $category_name_no_whitespace = $category->name();
90 $category_name_no_whitespace = str_replace(" ", "&nbsp;", $category_name_no_whitespace);
91
92 $t->set_var( "current_category_name", $category_name_no_whitespace );
93 $t->set_var( "current_category_description", $category->description() );
94
95 $articleList =& $category->articles( $category->sortMode(), false, true );
96
97 $locale = new eZLocale( $Language );
98 $i=0;
99 $t->set_var( "article_list", "" );
100 foreach ( $articleList as $article )
101 {
102 $t->set_var( "article_id", $article->id() );
103 $t->set_var( "article_name", $article->name() );
104 $catDef =& $article->categoryDefinition();
105
106 $t->set_var( "article_category_id", $catDef->id() );
107
108 if ( ( $i % 2 ) == 0 )
109 {
110 $t->set_var( "td_class", "bglight" );
111 }
112 else
113 {
114 $t->set_var( "td_class", "bgdark" );
115 }
116
117 if ( $article->linkText() != "" )
118 {
119 $t->set_var( "article_link_text", $article->linkText() );
120 }
121 else
122 {
123 $t->set_var( "article_link_text", isset($DefaultLinkText)?$DefaultLinkText:'More' );
124 }
125
126 if ( ( $url_array[2] == "articlestatic" ) && ( $url_array[3] == $article->id() ) )
127 {
128 $t->set_var( "mark", "menumark" );
129 }
130 else
131 {
132 $t->set_var( "mark", "" );
133 }
134
135 $t->parse( "article_item", "article_item_tpl", true );
136 $i++;
137 }
138
139 if ( count( $articleList ) > 0 )
140 $t->parse( "article_list", "article_list_tpl" );
141 else
142 $t->set_var( "article_list", "" );
143
144 if ( isset( $GenerateStaticPage ) and $GenerateStaticPage == "true" )
145 {
146 $output = $t->parse( "output", "article_list_page_tpl" );
147 // print the output the first time while printing the cache file.
148 print( $output );
149 $CacheFile->store( $output );
150 }
151 else
152 {
153 $t->pparse( "output", "article_list_page_tpl" );
154 }
155 }
156
157 ?>
$ImageDir
$ImageDir
Definition: adedit.php:291
$category
if( $Action=="Edit") $category
Definition: adedit.php:378
$locale
$locale
Definition: admin/adlist.php:127
$i
$i
Definition: admin/adlist.php:91
$CategoryID
$CategoryID
Definition: admin/articleedit.php:53
$PureStatic
$PureStatic
Definition: articlelinks.php:34
$ArticlePageCaching
$ArticlePageCaching
Definition: articlelinks.php:31
$DefaultLinkText
$DefaultLinkText
Definition: articlelinks.php:29
$PageCaching
$PageCaching
Definition: articlelinks.php:32
$article
$article
Definition: articlelog.php:45
eZArticleCategory
Definition: ezarticlecategory.php:45
eZLocale
Definition: ezlocale.php:119
eZTemplate
Definition: eztemplate.php:107
$t
foreach( $Modules as $module) if(isset( $ItemInsert)) $t
Definition: classes/admin/linklist.php:168
$Language
$Language
Definition: classes/admin/linklist.php:65
$ini
$ini
Definition: classes/admin/linklist.php:64
$url_array
$url_array
Definition: ezaddress/admin/datasupplier.php:34
$output
$output
Definition: formpreview.php:81
$GlobalSiteDesign
global $GlobalSiteDesign
Definition: latestmessages.php:52
$articleList
$articleList
Definition: pendinglist.php:112
$GenerateStaticPage
$GenerateStaticPage
Definition: quizscores.php:95
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.