Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

index.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: index.php 7506 2001-09-27 10:26:56Z bf $
5 //
6 // Created on: <27-Apr-2001 10:15:40 amos>
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/ezlist.php" );
31
32 // include_once( "ezarticle/classes/ezarticlecategory.php" );
33 // include_once( "ezarticle/classes/ezarticle.php" );
34
35 $ini =& eZINI::instance( 'site.ini' );
36 $Language = $ini->variable( "eZArticleMain", "Language" );
37
38 $t = new eZTemplate( "kernel/ezarticle/user/" . $ini->variable( "eZArticleMain", "TemplateDir" ),
39 "kernel/ezarticle/user/intl/", $Language, "index.php" );
40
41 $t->setAllStrings();
42
43 $t->set_file( "index_tpl", "index.tpl" );
44
45 $t->set_block( "index_tpl", "index_item_tpl", "index_item" );
46 $t->set_block( "index_item_tpl", "article_item_tpl", "article_item" );
47 $t->set_block( "article_item_tpl", "comma_item_tpl", "comma_item" );
48 $t->set_block( "index_tpl", "letter_item_tpl", "letter_item" );
49
50 $t->set_var( "index_item", "" );
51
52 $letterArray =& eZArticle::keywordFirstLetters();
53
54 if ( !in_array( $CurrentIndex, $letterArray ) )
55 {
56 $CurrentIndex = $letterArray[0];
57 }
58
59 $t->set_var( "current_letter", $CurrentIndex );
60
61
62 foreach ( $letterArray as $letter )
63 {
64 $t->set_var( "letter", $letter );
65 $t->parse( "letter_item", "letter_item_tpl", true );
66 }
67
68
69 $indexes =& eZArticle::manualKeywordIndex( $CurrentIndex );
70 foreach( $indexes as $indexKeyword )
71 {
72 $t->set_var( "article_item", "" );
73 $t->set_var( "index_name", $indexKeyword );
74 $articles =& eZArticle::searchByShortContent( "", array( $indexKeyword ) );
75 $i = 0;
76 foreach( $articles as $article )
77 {
78 $t->set_var( "comma_item", "" );
79 if ( $i > 0 )
80 $t->parse( "comma_item", "comma_item_tpl" );
81 $t->set_var( "article_name", $article->name() );
82 $t->set_var( "article_id", $article->id() );
83 $t->set_var( "article_page", 1 );
84 $cats = $article->categories( false );
85 $t->set_var( "article_category", $cats[0] );
86 $t->parse( "article_item", "article_item_tpl", true );
87 ++$i;
88 }
89 $t->parse( "index_item", "index_item_tpl", true);
90 }
91
92 if ( $GenerateStaticPage == "true" and $cachedFile != "" )
93 {
94 $fp = eZPBFile::fopen( $cachedFile, "w+");
95 $output = $t->parse( "output", "index_tpl" );
96
97 // print the output the first time while printing the cache file.
98 print( $output );
99 fwrite ( $fp, $output );
100 fclose( $fp );
101 }
102 else
103 {
104 $t->pparse( "output", "index_tpl" );
105 }
106
107 ?>
$i
$i
Definition: admin/adlist.php:91
$article
$article
Definition: articlelog.php:45
$articles
$articles
Definition: authorview.php:64
eZArticle\searchByShortContent
static & searchByShortContent( $short_content, $keywords, $offset=0, $max=-1, $as_object=true)
Definition: ezarticle.php:1159
eZArticle\manualKeywordIndex
static & manualKeywordIndex( $firstLetter=false)
Definition: ezarticle.php:1064
eZArticle\keywordFirstLetters
static & keywordFirstLetters()
Definition: ezarticle.php:982
eZPBFile\fopen
static fopen( $filename, $options)
Definition: ezpbfile.php:326
eZTemplate
Definition: eztemplate.php:107
$fp
$fp
Definition: export.php:97
$cachedFile
$cachedFile
Definition: eznewsfeed/user/headlines.php:109
$output
$output
Definition: formpreview.php:81
$indexes
foreach( $letterArray as $letter) $indexes
Definition: index.php:69
$t
$t
Definition: index.php:38
$Language
$Language
Definition: index.php:36
$ini
$ini
Definition: index.php:35
$letterArray
$letterArray
Definition: index.php:52
$GenerateStaticPage
$GenerateStaticPage
Definition: quizscores.php:95
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.