Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

eznewsfeed/user/search.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: search.php 8504 2001-11-19 09:46:46Z jhe $
5 //
6 // Created on: <27-Nov-2000 11:52:01 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( "eznewsfeed/classes/eznews.php" );
28 // include_once( "eznewsfeed/classes/eznewscategory.php" );
29 // include_once( "eznewsfeed/classes/eznewsimporter.php" );
30
31 // include_once( "classes/ezdatetime.php" );
32 // include_once( "classes/ezlocale.php" );
33
34 $ini = eZINI::instance( 'site.ini' );
35
36 $Language = $ini->variable( "eZNewsFeedMain", "Language" );
37
38 if ( $SearchText == "" )
39 { //show anohther template if the search is
40 $t = new eZTemplate( "kernel/eznewsfeed/user/" . $ini->variable( "eZNewsFeedMain", "TemplateDir" ),
41 "kernel/eznewsfeed/user/intl/", $Language, "search.php" );
42
43 $t->setAllStrings();
44
45 $t->set_file( array(
46 "news_search_page_tpl" => "searchmenu.tpl"
47 ) );
48
49 $t->pparse( "output", "news_search_page_tpl" );
50 }
51 else
52 {
53
54 $t = new eZTemplate( "kernel/eznewsfeed/user/" . $ini->variable( "eZNewsFeedMain", "TemplateDir" ),
55 "kernel/eznewsfeed/user/intl/", $Language, "search.php" );
56
57 $t->setAllStrings();
58
59 $t->set_file( array(
60 "news_search_page_tpl" => "search.tpl"
61 ) );
62
63 // news
64 $t->set_block( "news_search_page_tpl", "news_list_tpl", "news_list" );
65 $t->set_block( "news_list_tpl", "news_item_tpl", "news_item" );
66
67 $news = new eZNews();
68
69
70 // news
71
72 // fetch the n next news items
73 $newsList = $news->search( $SearchText );
74
75 $locale = new eZLocale( $Language );
76 $i=0;
77 $t->set_var( "news_list", "" );
78
79
80 foreach ( $newsList as $news )
81 {
82 if ( ( $i % 2 ) == 0 )
83 {
84 $t->set_var( "starttr", "<tr>" );
85 $t->set_var( "endtr", "" );
86 }
87 else
88 {
89 $t->set_var( "starttr", "" );
90 $t->set_var( "endtr", "</tr>" );
91 }
92
93
94 $t->set_var( "news_name", $news->name() );
95
96 $t->set_var( "news_intro", $news->intro() );
97 $t->set_var( "news_url", $news->url() );
98 $t->set_var( "news_origin", $news->origin() );
99
100 $published = $news->originalPublishingDate();
101
102 $t->set_var( "news_date", $locale->format( $published ) );
103
104
105 $t->set_var( "news_id", $news->id() );
106
107 $t->parse( "news_item", "news_item_tpl", true );
108 $i++;
109 }
110
111 if ( count( $newsList ) > 0 )
112 $t->parse( "news_list", "news_list_tpl" );
113 else
114 $t->set_var( "news_list", "" );
115
116 $t->pparse( "output", "news_search_page_tpl" );
117 }
118
119 ?>
eZLocale
Definition: ezlocale.php:119
eZNews
Definition: eznews.php:63
eZTemplate
Definition: eztemplate.php:107
$t
foreach( $Modules as $module) if(isset( $ItemInsert)) $t
Definition: classes/admin/linklist.php:168
$SearchText
$SearchText
Definition: ezaddress/admin/typelist.php:143
$locale
$locale
Definition: eznewsfeed/user/search.php:75
$news
$news
Definition: eznewsfeed/user/search.php:67
$i
$i
Definition: eznewsfeed/user/search.php:76
$Language
$Language
Definition: eznewsfeed/user/search.php:36
$ini
$ini
Definition: eznewsfeed/user/search.php:34
$newsList
$newsList
Definition: eznewsfeed/user/search.php:73
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.