Project

General

Profile

« Previous | Next » 

Revision 1255

Added by Dietmar over 14 years ago

Ticket #912 fix Search Template bug

View differences:

branches/2.8.x/CHANGELOG
9 9
- = Removed
10 10
# = Bugfix
11 11
! = Update/Change
12

  
12
 
13 13
------------------------------------- 2.8.1 -------------------------------------
14 14
21-Jan-2010 Dietmar Woellbrink (Luisehahne)
15
#	Ticket #912 fix Search Template bug
16
21-Jan-2010 Dietmar Woellbrink (Luisehahne)
15 17
#	Ticket #915 fix bug in search (utf-8 characters corrupted)(thanks to Thorn)
16 18
19-Jan-2010 Dietmar Woellbrink (Luisehahne)
17 19
#	fix some more small css-errors in WB Backend (thanks to Ruebenwurzel)
branches/2.8.x/wb/admin/interface/version.php
27 27
 * This file is where the WB release version is stored.
28 28
 *
29 29
 */
30
 /**
30
/**
31
 *
31 32
 * @category     	admin
32 33
 * @package      	interface
33 34
 * @filesource		$HeadURL$
......
43 44
 * @revision     	$Revision$
44 45
 * @platform     	WebsiteBaker 2.8.x
45 46
 * @requirements 	PHP 4.3.4 and higher
46
 * @lastmodified    $Date: $
47
 * @lastmodified    $Date$
47 48
 * 
48 49
 */
49 50

  
......
54 55

  
55 56
// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
56 57
if(!defined('VERSION')) define('VERSION', '2.8.1');
57
if(!defined('REVISION')) define('REVISION', '1254');
58
if(!defined('REVISION')) define('REVISION', '1255');
58 59

  
59 60
?>
60 61

  
branches/2.8.x/wb/admin/settings/save.php
1 1
<?php
2
/****************************************************************************
3
* SVN Version information:
2
/*
4 3
*
5
* $Id$
4
*                       About WebsiteBaker
6 5
*
7
*****************************************************************************
8
*                          WebsiteBaker
9
*
10
* WebsiteBaker Project <http://www.websitebaker2.org/>
11
* Copyright (C) 2009, Website Baker Org. e.V.
12
*         http://start.websitebaker2.org/impressum-datenschutz.php
13
* Copyright (C) 2004-2009, Ryan Djurovich
14
*
15
*                        About WebsiteBaker
16
*
17 6
* Website Baker is a PHP-based Content Management System (CMS)
18 7
* designed with one goal in mind: to enable its users to produce websites
19 8
* with ease.
20 9
*
21
*****************************************************************************
10
*                       LICENSE INFORMATION
22 11
*
23
*****************************************************************************
24
*                        LICENSE INFORMATION
25
*
26 12
* WebsiteBaker is free software; you can redistribute it and/or
27 13
* modify it under the terms of the GNU General Public License
28 14
* as published by the Free Software Foundation; either version 2
......
36 22
* You should have received a copy of the GNU General Public License
37 23
* along with this program; if not, write to the Free Software
38 24
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
39
****************************************************************************
40 25
*
41 26
*                   WebsiteBaker Extra Information
42 27
*
43 28
*
44
*
45
*
46
*****************************************************************************/
29
*/
47 30
/**
48 31
 *
49
 * @category     admin
50
 * @package      settings
51
 * @author       Ryan Djurovich
52
 * @copyright    2004-2009, Ryan Djurovich
53
 * @copyright    2009-2010, Website Baker Org. e.V.
54
 * @version      $Id$
55
 * @platform     WebsiteBaker 2.8.x
56
 * @requirements >= PHP 4.3.4
57
 * @license      http://www.gnu.org/licenses/gpl.html
32
 * @category        admin
33
 * @package         settings
34
 * @author          Ryan Djurovich
35
 * @copyright       2004-2009, Ryan Djurovich
36
 * @copyright       2009-2010, Website Baker Org. e.V.
37
 * @filesource		$HeadURL$
38
 * @author          Ryan Djurovich
39
 * @copyright       2004-2009, Ryan Djurovich
58 40
 *
41
 * @author          WebsiteBaker Project
42
 * @link			http://www.websitebaker2.org/
43
 * @copyright       2009-2010, Website Baker Org. e.V.
44
 * @link			http://start.websitebaker2.org/impressum-datenschutz.php
45
 * @license         http://www.gnu.org/licenses/gpl.html
46
 * @version         $Id$
47
 * @platform        WebsiteBaker 2.8.x
48
 * @requirements    PHP 4.3.4 and higher
49
 * @lastmodified    $Date$
50
 *
59 51
 */
60 52

  
61 53
// prevent this file from being accessed directly in the browser (would set all entries in DB settings table to '')
......
78 70
$js_back = "javascript: history.go(-1);";
79 71

  
80 72
// Ensure that the specified default email is formally valid
81
if(isset($_POST['server_email'])) {
73
if(isset($_POST['server_email']))
74
{
82 75
	$_POST['server_email'] = strip_tags($_POST['server_email']);
83 76
	if(!eregi("^([0-9a-zA-Z]+[-._+&])*[0-9a-zA-Z]+@([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}$", $_POST['server_email'])) {
84 77
		$admin->print_error($MESSAGE['USERS']['INVALID_EMAIL'].
......
87 80
}
88 81

  
89 82
// Work-out file mode
90
if($advanced == '') {
83
if($advanced == '')
84
{
91 85
	// Check if should be set to 777 or left alone
92
	if(isset($_POST['world_writeable']) AND $_POST['world_writeable'] == 'true') {
86
	if(isset($_POST['world_writeable']) AND $_POST['world_writeable'] == 'true')
87
    {
93 88
		$file_mode = '0777';
94 89
		$dir_mode = '0777';
95 90
	} else {
......
164 159
}
165 160

  
166 161
// Create new database object
167
$database = new database();
162
/*$database = new database(); */
168 163

  
169 164
// Query current settings in the db, then loop through them and update the db with the new value
170 165
$query = "SELECT name FROM ".TABLE_PREFIX."settings";
171 166
$results = $database->query($query);
172
while($setting = $results->fetchRow()) {
167
while($setting = $results->fetchRow())
168
{
173 169
	$setting_name = $setting['name'];
174 170
	$value = $admin->get_post($setting_name);
175
	if ($setting_name!='wb_version') {
171
	if ($setting_name!='wb_version')
172
    {
176 173
		$allow_tags_in_fields = array('website_header', 'website_footer','wbmailer_smtp_password');
177 174
		if(!in_array($setting_name, $allow_tags_in_fields)) {
178 175
			$value = strip_tags($value);
......
204 201
	$old_value = $search_setting['value'];
205 202
	$setting_name = $search_setting['name'];
206 203
	$post_name = 'search_'.$search_setting['name'];
207
	if($admin->get_post($post_name) == '')
208
    {
209
        $value = $old_value;
210
    }
211
	else
212
    {
213
        $value = $admin->get_post($post_name);
214
    }
204
    // hold old value if post is empty
205
    // check search template
206
    $value = ( ($admin->get_post($post_name) == '') AND ($setting_name != 'template') ) ? $old_value : $admin->get_post($post_name);
215 207

  
216 208
	$value = $admin->add_slashes($value);
217 209
	$database->query("UPDATE ".TABLE_PREFIX."search SET value = '$value' WHERE name = '$setting_name'");
218 210

  
branches/2.8.x/wb/admin/settings/index.php
1 1
<?php
2
/****************************************************************************
3
* SVN Version information:
2
/*
4 3
*
5
* $Id$
4
*                       About WebsiteBaker
6 5
*
7
*****************************************************************************
8
*                          WebsiteBaker
9
*
10
* WebsiteBaker Project <http://www.websitebaker2.org/>
11
* Copyright (C) 2009, Website Baker Org. e.V.
12
*         http://start.websitebaker2.org/impressum-datenschutz.php
13
* Copyright (C) 2004-2009, Ryan Djurovich
14
*
15
*                        About WebsiteBaker
16
*
17 6
* Website Baker is a PHP-based Content Management System (CMS)
18 7
* designed with one goal in mind: to enable its users to produce websites
19 8
* with ease.
20 9
*
21
*****************************************************************************
10
*                       LICENSE INFORMATION
22 11
*
23
*****************************************************************************
24
*                        LICENSE INFORMATION
25
*
26 12
* WebsiteBaker is free software; you can redistribute it and/or
27 13
* modify it under the terms of the GNU General Public License
28 14
* as published by the Free Software Foundation; either version 2
......
36 22
* You should have received a copy of the GNU General Public License
37 23
* along with this program; if not, write to the Free Software
38 24
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
39
****************************************************************************
40 25
*
41 26
*                   WebsiteBaker Extra Information
42 27
*
43 28
*
44
*
45
*
46
*****************************************************************************/
29
*/
47 30
/**
48 31
 *
49
 * @category     admin
50
 * @package      settings
51
 * @author       Ryan Djurovich
52
 * @copyright    2004-2009, Ryan Djurovich
53
 * @copyright    2009-2010, Website Baker Org. e.V.
54
 * @version      $Id$
55
 * @platform     WebsiteBaker 2.8.x
56
 * @requirements >= PHP 4.3.4
57
 * @license      http://www.gnu.org/licenses/gpl.html
32
 * @category        admin
33
 * @package         settings
34
 * @author          Ryan Djurovich
35
 * @copyright       2004-2009, Ryan Djurovich
36
 * @copyright       2009-2010, Website Baker Org. e.V.
37
 * @filesource		$HeadURL$
38
 * @author          Ryan Djurovich
39
 * @copyright       2004-2009, Ryan Djurovich
58 40
 *
41
 * @author          WebsiteBaker Project
42
 * @link			http://www.websitebaker2.org/
43
 * @copyright       2009-2010, Website Baker Org. e.V.
44
 * @link			http://start.websitebaker2.org/impressum-datenschutz.php
45
 * @license         http://www.gnu.org/licenses/gpl.html
46
 * @version         $Id$
47
 * @platform        WebsiteBaker 2.8.x
48
 * @requirements    PHP 4.3.4 and higher
49
 * @lastmodified    $Date$
50
 *
59 51
 */
60 52

  
61 53
require('../../config.php');
......
304 296
$template->set_var('SELECTED', $selected);
305 297
$template->parse('editor_list', 'editor_list_block', true);  
306 298
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'module' AND function = 'wysiwyg'");
307
if($result->numRows() > 0) {
308
	while($addon = $result->fetchRow()) {
299
if($result->numRows() > 0)
300
{
301
	while($addon = $result->fetchRow())
302
    {
309 303
		$template->set_var('FILE', $addon['directory']);
310 304
		$template->set_var('NAME', $addon['name']);
311 305
		if((defined('WYSIWYG_EDITOR') AND $addon['directory'] == WYSIWYG_EDITOR) ? $selected = ' selected="selected"' : $selected = '');
......
316 310

  
317 311
// Insert templates for search settings
318 312
$template->set_block('main_block', 'search_template_list_block', 'search_template_list');
319
$search_template = ($search_template == DEFAULT_TEMPLATE) ? '' : $search_template;
320
if( $search_template == '')
321
{
322
    $selected = ' selected="selected"';
323
}
324
else
325
{
326
  $selected = '';
327
}
328 313

  
314
$search_template = ( ($search_template == DEFAULT_TEMPLATE) OR ($search_template == '') ) ? '' : $search_template;
315

  
316
$selected = ( ($search_template != DEFAULT_TEMPLATE) ) ?  ' selected="selected"' : $selected = '';
317

  
329 318
$template->set_var(array(
330
        'FILE' => DEFAULT_TEMPLATE,
319
        'FILE' => '',
331 320
        'NAME' => $TEXT['SYSTEM_DEFAULT'],
332 321
        'SELECTED' => $selected
333 322
    ));
......
341 330
    {
342 331
		$template->set_var('FILE', $addon['directory']);
343 332
		$template->set_var('NAME', $addon['name']);
333
        $selected = ($addon['directory'] == $search_template) ? ' selected="selected"' :  $selected = '';
334
		$template->set_var('SELECTED', $selected);
344 335

  
345
		if($addon['directory'] == $search_template)
346
        {
347
            $selected = ' selected="selected"';
348
        }
349
        else
350
        {
351
            $selected = '';
352
        }
353

  
354
		$template->set_var('SELECTED', $selected);
355 336
		$template->parse('search_template_list', 'search_template_list_block', true);
356 337
	}
357 338
}
......
362 343
foreach($ER_LEVELS AS $value => $title) {
363 344
	$template->set_var('VALUE', $value);
364 345
	$template->set_var('NAME', $title);
365
	if(ER_LEVEL == $value) {
366
		$template->set_var('SELECTED', ' selected="selected"');
367
	} else {
368
		$template->set_var('SELECTED', '');
369
	}
346
    $selected = (ER_LEVEL == $value) ? ' selected="selected"' : '';
347
    $template->set_var('SELECTED', $selected);
348

  
370 349
	$template->parse('error_reporting_list', 'error_reporting_list_block', true);
371 350
}
372 351

  
......
377 356

  
378 357
// Insert page level limits
379 358
$template->set_block('main_block', 'page_level_limit_list_block', 'page_level_limit_list');
380
for($i = 1; $i <= 10; $i++) {
359
for($i = 1; $i <= 10; $i++)
360
{
381 361
	$template->set_var('NUMBER', $i);
382
	if(PAGE_LEVEL_LIMIT == $i) {
362
	if(PAGE_LEVEL_LIMIT == $i)
363
    {
383 364
		$template->set_var('SELECTED', ' selected="selected"');
384 365
	} else {
385 366
		$template->set_var('SELECTED', '');
386 367

  

Also available in: Unified diff