Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezlink/user/search.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: search.php 8883 2002-01-04 14:50:05Z kaid $
5 //
6 // Created on: <15-Sep-2000 14:40:06 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
29 $ini =& eZINI::instance( 'site.ini' );
30 $Language = $ini->variable( "eZLinkMain", "Language" );
31 $UserLimit = $ini->variable( "eZLinkMain", "UserSearchLimit" );
32
33 // include_once( "classes/eztemplate.php" );
34
35 // include_once( "ezlink/classes/ezlink.php" );
36 // include_once( "ezlink/classes/ezhit.php" );
37 // include_once( "classes/ezlist.php" );
38 // include_once( "classes/ezhttptool.php" );
39
40 $t = new eZTemplate( "kernel/ezlink/user/" . $ini->variable( "eZLinkMain", "TemplateDir" ),
41 "kernel/ezlink/user/intl", $Language, "search.php" );
42
43 $t->setAllStrings();
44
45 $t->set_file( "search_list", "searchlist.tpl" );
46
47 $t->set_block( "search_list", "search_item_tpl", "search_item" );
48
49 $t->set_block( "search_list", "empty_result_tpl", "empty_result" );
50
51 $t->set_block( "search_list", "search_result_tpl", "search_result" );
52
53 $t->set_block( "search_list", "previous_tpl", "previous" );
54 $t->set_block( "search_list", "next_tpl", "next" );
55
56 if ( !isset( $Offset ) )
57 $Offset = 0;
58
59 $link = new eZLink();
60
61 $t->set_var( "query_string", "" );
62 $t->set_var( "search_result", "" );
63
64 if ( isset( $SearchText ) and !isset( $QueryString ) )
65 $QueryString = $SearchText;
66
67 if ( $QueryString != "" )
68 {
69 $link_array =& $link->getQuery( $QueryString, $UserLimit, $Offset );
70 $total_count = $link->getQueryCount( $QueryString );
71
72 $t->set_var( "query_string", urlencode( $QueryString ) );
73 $t->set_var( "empty_result", "" );
74 $i = 0;
75 if ( count ( $link_array ) > 0 )
76 {
77 foreach( $link_array as $linkItem )
78 {
79 if ( ( $i % 2 ) == 0 )
80 {
81 $t->set_var( "bg_color", "#f0f0f0" );
82 }
83 else
84 {
85 $t->set_var( "bg_color", "#dcdcdc" );
86 }
87
88 $t->set_var( "link_id", $linkItem->id() );
89 $t->set_var( "link_title", $linkItem->name() );
90 $t->set_var( "link_description", $linkItem->description() );
91 $t->set_var( "link_groupid", $linkItem->categoryDefinition( false ) );
92 $t->set_var( "link_keywords", $linkItem->keywords() );
93 $t->set_var( "link_created", $linkItem->created() );
94 $t->set_var( "link_modified", $linkItem->modified() );
95 $t->set_var( "link_accepted", $linkItem->accepted() );
96 $t->set_var( "link_url", $linkItem->url() );
97
98 $hit = new eZHit();
99 $hits = $hit->getLinkHits( $linkItem->id() );
100
101 $t->set_var( "link_hits", $hits );
102
103 $t->set_var( "empty_result", "" );
104 $t->parse( "search_item", "search_item_tpl", true );
105 $i++;
106 }
107 }
108 else
109 {
110 $t->set_var( "search_item", "" );
111 $t->parse( "empty_result", "empty_result_tpl" );
112 }
113 }
114 else
115 {
116 $t->set_var( "query_string", "" );
117 $t->set_var( "search_item", "" );
118 $t->parse( "empty_result", "empty_result_tpl" );
119 }
120 eZList::drawNavigator( $t, $total_count, $UserLimit, $Offset, "search_list" );
121
122 $t->set_var( "link_start", $Offset + 1 );
123 $t->set_var( "link_end", min( $Offset + $UserLimit, $total_count ) );
124 $t->set_var( "link_total", $total_count );
125
126
127 $t->set_var( "hit_count", $total_count );
128
129 $t->pparse( "output", "search_list" );
130 ?>
$i
$i
Definition: admin/adlist.php:91
$total_count
$total_count
Definition: browserlist.php:54
eZHit
Definition: ezhit.php:40
eZLink
Definition: ezlink.php:65
eZList\drawNavigator
static drawNavigator(&$t, $total_types, $max_types, $index, $parent=false, $variables=false)
Definition: ezlist.php:401
eZTemplate
Definition: eztemplate.php:107
$SearchText
$SearchText
Definition: ezaddress/admin/typelist.php:143
$Offset
$Offset
Definition: ezarticle/user/search.php:110
$UserLimit
$UserLimit
Definition: ezlink/user/search.php:31
$t
$t
Definition: ezlink/user/search.php:40
$link
$link
Definition: ezlink/user/search.php:59
$Language
$Language
Definition: ezlink/user/search.php:30
$ini
$ini
Definition: ezlink/user/search.php:29
$link_array
$link_array
Definition: latest.php:52
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.