Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezlink/admin/search.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: search.php 8751 2001-12-13 10:40:19Z 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
31 // include_once( "classes/INIFile.php" );
32
33 $ini = eZINI::instance( 'site.ini' );
34 $Language = $ini->variable( "eZLinkMain", "Language" );
35 $AdminLimit = $ini->variable( "eZLinkMain", "AdminSearchLimit" );
36
37 // include_once( "classes/eztemplate.php" );
38 // include_once( "classes/ezlist.php" );
39
40 // include_once( "ezlink/classes/ezlinkcategory.php" );
41 // include_once( "ezlink/classes/ezlink.php" );
42 // include_once( "ezlink/classes/ezhit.php" );
43
44 // // include_once( "classes/ezquery.php" );
45
46 // setter template filer
47 $t = new eZTemplate( "kernel/ezlink/admin/" . $ini->variable( "eZLinkMain", "AdminTemplateDir" ),
48 "kernel/ezlink/admin/intl", $Language, "search.php" );
49
50 $t->setAllStrings();
51
52 $t->set_file( array(
53 "search_list" => "searchlist.tpl"
54 ) );
55
56 $t->set_block( "search_list", "search_item_tpl", "search_item" );
57
58 $t->set_block( "search_list", "empty_result_tpl", "empty_result" );
59 $t->set_block( "search_list", "search_result_tpl", "search_result" );
60
61 if ( !isset( $Offset ) )
62 $Offset = 0;
63
64 $link = new eZLink();
65
66 $t->set_var( "search_result", "" );
67
68 $t->set_var( "query_string", "" );
69
70 if ( $QueryString != "" )
71 {
72 $t->set_var( "query_string", urlencode( $QueryString ) );
73
74 $link_array = $link->getQuery( $QueryString, $AdminLimit, $Offset );
75 $total_count = $link->getQueryCount( $QueryString );
76
77 $t->set_var( "empty_result", "" );
78 $i=0;
79 if ( $link_array )
80 {
81 foreach( $link_array as $linkItem )
82 {
83 if ( ( $i % 2 ) == 0 )
84 {
85 $t->set_var( "bg_color", "#f0f0f0" );
86 }
87 else
88 {
89 $t->set_var( "bg_color", "#dcdcdc" );
90 }
91
92 $t->set_var( "link_id", $linkItem->id() );
93 $t->set_var( "link_title", $linkItem->name() );
94 $t->set_var( "link_description", $linkItem->description() );
95 $t->set_var( "link_categoryid", $linkItem->categoryDefinition( false ) );
96 //$t->set_var( "link_categoryid", $linkItem->linkcategoryid() );
97 $t->set_var( "link_keywords", $linkItem->keywords() );
98 $t->set_var( "link_created", $linkItem->created() );
99 $t->set_var( "link_modified", $linkItem->modified() );
100 $t->set_var( "link_accepted", $linkItem->accepted() );
101 $t->set_var( "link_url", $linkItem->url() );
102
103 $hit = new eZHit();
104 $hits = $hit->getLinkHits( $linkItem->id() );
105
106 $t->set_var( "link_hits", $hits );
107
108 $t->set_var( "empty_result", "" );
109
110 $t->parse( "search_item", "search_item_tpl", true );
111 $i++;
112 }
113 }
114 else
115 {
116 $t->set_var( "search_item", "" );
117 $t->parse( "empty_result", "empty_result_tpl" );
118 }
119 }
120 else
121 {
122 $total_count = 0;
123 $t->set_var( "search_item", "" );
124 $t->parse( "empty_result", "empty_result_tpl" );
125 }
126 eZList::drawNavigator( $t, $total_count, $AdminLimit, $Offset, "search_list" );
127
128 $t->set_var( "link_start", $Offset + 1 );
129 $t->set_var( "link_end", min( $Offset + $AdminLimit, $total_count ) );
130 $t->set_var( "link_total", $total_count );
131
132
133 $t->set_var( "hit_count", $total_count );
134
135 $t->set_var( "linkcategory_id", isset( $LGID ) ? $LGID : 0 );
136
137 $t->pparse( "output", "search_list" );
138
139 ?>
$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
$Offset
$Offset
Definition: ezarticle/user/search.php:110
$t
$t
Definition: ezlink/admin/search.php:47
$AdminLimit
$AdminLimit
Definition: ezlink/admin/search.php:35
$link
$link
Definition: ezlink/admin/search.php:64
$Language
$Language
Definition: ezlink/admin/search.php:34
$ini
$ini
Definition: ezlink/admin/search.php:33
$link_array
$link_array
Definition: latest.php:52
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.