Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezforum/admin/search.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: search.php 9733 2002-10-02 14:50:11Z bf $
5 //
6 // Created on: <12-Oct-2000 20:33:02 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 // include_once( "ezforum/classes/ezforum.php" );
29 // include_once( "classes/ezlocale.php" );
30 // include_once( "ezuser/classes/ezuser.php" );
31 // include_once( "classes/ezlist.php" );
32
33 $ini =& eZINI::instance( 'site.ini' );
34
35 $Language = $ini->variable( "eZForumMain", "Language" );
36 $Limit = $ini->variable( "eZForumMain", "SearchAdminLimit" );
37
38 // include_once( "classes/eztemplate.php" );
39
40 $t = new eZTemplate( "kernel/ezforum/admin/" . $ini->variable( "eZForumMain", "AdminTemplateDir" ),
41 "kernel/ezforum/admin/intl", $Language, "search.php" );
42
43 $t->setAllStrings();
44
45 $t->set_file( "search_tpl", "search.tpl" );
46
47 $t->set_block( "search_tpl", "message_tpl", "message" );
48
49 $t->set_block( "search_tpl", "empty_result_tpl", "empty_result" );
50 $t->set_block( "search_tpl", "search_result_tpl", "search_result" );
51
52 $t->set_block( "search_tpl", "previous_tpl", "previous" );
53 $t->set_block( "search_tpl", "next_tpl", "next" );
54 $t->set_var( "site_style", $SiteDesign );
55
56
57 if ( !isset( $Offset ) )
58 $Offset = 0;
59
60 $t->set_var( "url_text", "" );
61 $t->set_var( "search_result", "" );
62
63 if ( $QueryString != "" )
64 {
65 $t->set_var( "url_text", urlencode( $QueryString ) );
66
67 $forum = new eZForum();
68
69 // do a search in all forums
70 $messages =& $forum->search( $QueryString, $Offset, $Limit, $total_count);
71
72 $locale = new eZLocale( $Language );
73
74 $level = 0;
75 $i = 0;
76
77 $AnonymousPoster = $ini->variable( "eZForumMain", "AnonymousPoster" );
78
79 if ( count( $messages ) > 0 )
80 foreach ( $messages as $message )
81 {
82 if ( ( $i % 2 ) == 0 )
83 $t->set_var( "td_class", "bglight" );
84 else
85 $t->set_var( "td_class", "bgdark" );
86
87 $t->set_var( "message_topic", $message->topic() );
88
89 $t->set_var( "postingtime", $locale->format( $message->postingTime() ) );
90
91 $t->set_var( "message_id", $message->id() );
92
93 $author = $message->user();
94
95 if ( $author->id() != 0 )
96 {
97 $t->set_var( "user", $author->firstName() . " " . $author->lastName() );
98 }
99 else
100 {
101 $t->set_var( "user", $AnonymousPoster );
102 }
103
104 $t->parse( "message", "message_tpl", true );
105 $i++;
106 }
107
108 if ( count( $messages ) == 0 )
109 {
110 $t->parse( "empty_result", "empty_result_tpl" );
111 }
112 else
113 {
114 $t->parse( "search_result", "search_result_tpl", true );
115 $t->set_var( "empty_result", "" );
116 }
117 }
118 else
119 {
120 $t->parse( "empty_result", "empty_result_tpl" );
121 }
122 eZList::drawNavigator( $t, $total_count, $Limit, $Offset, "search_tpl" );
123
124 $t->set_var( "forum_start", $Offset + 1 );
125 $t->set_var( "forum_end", min( $Offset + $Limit, $total_count ) );
126 $t->set_var( "forum_total", $total_count );
127
128 $t->pparse("output","search_tpl");
129
130 ?>
$locale
$locale
Definition: admin/adlist.php:127
$i
$i
Definition: admin/adlist.php:91
$author
$author
Definition: admin/articleedit.php:834
$forum
$forum
Definition: admin/forumlist.php:50
$level
$level
Definition: admin/message.php:106
$message
$message
Definition: admin/message.php:51
$total_count
$total_count
Definition: browserlist.php:54
eZForum
Definition: ezforum.php:44
eZList\drawNavigator
static drawNavigator(&$t, $total_types, $max_types, $index, $parent=false, $variables=false)
Definition: ezlist.php:401
eZLocale
Definition: ezlocale.php:119
eZTemplate
Definition: eztemplate.php:107
$Offset
$Offset
Definition: ezarticle/user/search.php:110
$SiteDesign
$SiteDesign
Definition: ezbulkmail/user/datasupplier.php:31
$AnonymousPoster
$AnonymousPoster
Definition: ezforum/admin/messagelist.php:77
$Limit
$Limit
Definition: ezforum/admin/search.php:36
$t
$t
Definition: ezforum/admin/search.php:40
$Language
$Language
Definition: ezforum/admin/search.php:35
$ini
$ini
Definition: ezforum/admin/search.php:33
$messages
$messages
Definition: homepage.php:328
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.