| 1 | 
        
            1348
         | 
        
            Luisehahne
         | 
        <?php
  | 
      
      
        | 2 | 
        
         | 
        
         | 
        /**
  | 
      
      
        | 3 | 
        
         | 
        
         | 
         *
  | 
      
      
        | 4 | 
        
         | 
        
         | 
         * @category        admin
  | 
      
      
        | 5 | 
        
         | 
        
         | 
         * @package         settings
  | 
      
      
        | 6 | 
        
         | 
        
         | 
         * @author          WebsiteBaker Project
  | 
      
      
        | 7 | 
        
         | 
        
         | 
         * @copyright       2004-2009, Ryan Djurovich
  | 
      
      
        | 8 | 
        
            1349
         | 
        
            Luisehahne
         | 
         * @copyright       2009-2011, Website Baker Org. e.V.
  | 
      
      
        | 9 | 
        
            1348
         | 
        
            Luisehahne
         | 
         * @link			http://www.websitebaker2.org/
  | 
      
      
        | 10 | 
        
         | 
        
         | 
         * @license         http://www.gnu.org/licenses/gpl.html
  | 
      
      
        | 11 | 
        
         | 
        
         | 
         * @platform        WebsiteBaker 2.8.x
  | 
      
      
        | 12 | 
        
            1374
         | 
        
            Luisehahne
         | 
         * @requirements    PHP 5.2.2 and higher
  | 
      
      
        | 13 | 
        
            1348
         | 
        
            Luisehahne
         | 
         * @version         $Id$
  | 
      
      
        | 14 | 
        
         | 
        
         | 
         * @filesource		$HeadURL$
  | 
      
      
        | 15 | 
        
         | 
        
         | 
         * @lastmodified    $Date$
  | 
      
      
        | 16 | 
        
         | 
        
         | 
         *
  | 
      
      
        | 17 | 
        
         | 
        
         | 
         */
  | 
      
      
        | 18 | 
        
         | 
        
         | 
        
  | 
      
      
        | 19 | 
        
         | 
        
         | 
        // prevent this file from being accessed directly in the browser (would set all entries in DB settings table to '')
  | 
      
      
        | 20 | 
        
         | 
        
         | 
        if(!isset($_POST['default_language']) || $_POST['default_language'] == '') die(header('Location: index.php'));
 | 
      
      
        | 21 | 
        
         | 
        
         | 
        
  | 
      
      
        | 22 | 
        
         | 
        
         | 
        // Find out if the user was view advanced options or not
  | 
      
      
        | 23 | 
        
         | 
        
         | 
        $advanced = ($_POST['advanced'] == 'yes') ? '?advanced=yes' : '';
  | 
      
      
        | 24 | 
        
         | 
        
         | 
        
  | 
      
      
        | 25 | 
        
         | 
        
         | 
        // Print admin header
  | 
      
      
        | 26 | 
        
         | 
        
         | 
        require('../../config.php');
 | 
      
      
        | 27 | 
        
         | 
        
         | 
        require_once(WB_PATH.'/framework/class.admin.php');
  | 
      
      
        | 28 | 
        
         | 
        
         | 
        
  | 
      
      
        | 29 | 
        
         | 
        
         | 
        if($advanced == '')
  | 
      
      
        | 30 | 
        
         | 
        
         | 
        {
 | 
      
      
        | 31 | 
        
         | 
        
         | 
        	$admin = new admin('Settings', 'settings_basic');
 | 
      
      
        | 32 | 
        
         | 
        
         | 
        } else {
 | 
      
      
        | 33 | 
        
         | 
        
         | 
        	$admin = new admin('Settings', 'settings_advanced');
 | 
      
      
        | 34 | 
        
         | 
        
         | 
        }
  | 
      
      
        | 35 | 
        
         | 
        
         | 
        
  | 
      
      
        | 36 | 
        
            1425
         | 
        
            Luisehahne
         | 
        // Create a javascript back link
  | 
      
      
        | 37 | 
        
         | 
        
         | 
        $js_back = ADMIN_URL.'/settings/index.php'.$advanced;
  | 
      
      
        | 38 | 
        
         | 
        
         | 
        
  | 
      
      
        | 39 | 
        
            1355
         | 
        
            FrankH
         | 
        if( !$admin->checkFTAN() )
  | 
      
      
        | 40 | 
        
         | 
        
         | 
        {
 | 
      
      
        | 41 | 
        
            1425
         | 
        
            Luisehahne
         | 
        	$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'],$js_back );
  | 
      
      
        | 42 | 
        
            1355
         | 
        
            FrankH
         | 
        	exit();
  | 
      
      
        | 43 | 
        
         | 
        
         | 
        }
  | 
      
      
        | 44 | 
        
         | 
        
         | 
        
  | 
      
      
        | 45 | 
        
            1348
         | 
        
            Luisehahne
         | 
        // Ensure that the specified default email is formally valid
  | 
      
      
        | 46 | 
        
         | 
        
         | 
        if(isset($_POST['server_email']))
  | 
      
      
        | 47 | 
        
         | 
        
         | 
        {
 | 
      
      
        | 48 | 
        
         | 
        
         | 
        	$_POST['server_email'] = strip_tags($_POST['server_email']);
  | 
      
      
        | 49 | 
        
         | 
        
         | 
            // $pattern = '/^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@([a-z0-9]([-a-z0-9_]?[a-z0-9])*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z]{2})|([1]?\d{1,2}|2[0-4]{1}\d{1}|25[0-5]{1})(\.([1]?\d{1,2}|2[0-4]{1}\d{1}|25[0-5]{1})){3})(:[0-9]{1,5})?\r/im';
 | 
      
      
        | 50 | 
        
         | 
        
         | 
            $pattern = '/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.(([0-9]{1,3})|([a-zA-Z]{2,6}))$/';
 | 
      
      
        | 51 | 
        
         | 
        
         | 
            if(false == preg_match($pattern, $_POST['server_email']))
  | 
      
      
        | 52 | 
        
         | 
        
         | 
            {
 | 
      
      
        | 53 | 
        
         | 
        
         | 
        		$admin->print_error($MESSAGE['USERS']['INVALID_EMAIL'].
  | 
      
      
        | 54 | 
        
         | 
        
         | 
        			'<br /><strong>Email: '.htmlentities($_POST['server_email']).'</strong>', $js_back);
  | 
      
      
        | 55 | 
        
         | 
        
         | 
        	}
  | 
      
      
        | 56 | 
        
         | 
        
         | 
        }
  | 
      
      
        | 57 | 
        
         | 
        
         | 
        
  | 
      
      
        | 58 | 
        
         | 
        
         | 
        // Work-out file mode
  | 
      
      
        | 59 | 
        
         | 
        
         | 
        if($advanced == '')
  | 
      
      
        | 60 | 
        
         | 
        
         | 
        {
 | 
      
      
        | 61 | 
        
         | 
        
         | 
        	// Check if should be set to 777 or left alone
  | 
      
      
        | 62 | 
        
         | 
        
         | 
        	if(isset($_POST['world_writeable']) && $_POST['world_writeable'] == 'true')
  | 
      
      
        | 63 | 
        
         | 
        
         | 
            {
 | 
      
      
        | 64 | 
        
         | 
        
         | 
        		$file_mode = '0777';
  | 
      
      
        | 65 | 
        
         | 
        
         | 
        		$dir_mode = '0777';
  | 
      
      
        | 66 | 
        
         | 
        
         | 
        	} else {
 | 
      
      
        | 67 | 
        
         | 
        
         | 
        		$file_mode = STRING_FILE_MODE;
  | 
      
      
        | 68 | 
        
         | 
        
         | 
        		$dir_mode = STRING_DIR_MODE;
  | 
      
      
        | 69 | 
        
         | 
        
         | 
        	}
  | 
      
      
        | 70 | 
        
         | 
        
         | 
        } else {
 | 
      
      
        | 71 | 
        
         | 
        
         | 
        	// Work-out the octal value for file mode
  | 
      
      
        | 72 | 
        
         | 
        
         | 
        	$u = 0;
  | 
      
      
        | 73 | 
        
         | 
        
         | 
        	if(isset($_POST['file_u_r']) && $_POST['file_u_r'] == 'true') {
 | 
      
      
        | 74 | 
        
         | 
        
         | 
        		$u = $u+4;
  | 
      
      
        | 75 | 
        
         | 
        
         | 
        	}
  | 
      
      
        | 76 | 
        
         | 
        
         | 
        	if(isset($_POST['file_u_w']) && $_POST['file_u_w'] == 'true') {
 | 
      
      
        | 77 | 
        
         | 
        
         | 
        		$u = $u+2;
  | 
      
      
        | 78 | 
        
         | 
        
         | 
        	}
  | 
      
      
        | 79 | 
        
         | 
        
         | 
        	if(isset($_POST['file_u_e']) && $_POST['file_u_e'] == 'true') {
 | 
      
      
        | 80 | 
        
         | 
        
         | 
        		$u = $u+1;
  | 
      
      
        | 81 | 
        
         | 
        
         | 
        	}
  | 
      
      
        | 82 | 
        
         | 
        
         | 
        	$g = 0;
  | 
      
      
        | 83 | 
        
         | 
        
         | 
        	if(isset($_POST['file_g_r']) && $_POST['file_g_r'] == 'true') {
 | 
      
      
        | 84 | 
        
         | 
        
         | 
        		$g = $g+4;
  | 
      
      
        | 85 | 
        
         | 
        
         | 
        	}
  | 
      
      
        | 86 | 
        
         | 
        
         | 
        	if(isset($_POST['file_g_w']) && $_POST['file_g_w'] == 'true') {
 | 
      
      
        | 87 | 
        
         | 
        
         | 
        		$g = $g+2;
  | 
      
      
        | 88 | 
        
         | 
        
         | 
        	}
  | 
      
      
        | 89 | 
        
         | 
        
         | 
        	if(isset($_POST['file_g_e']) && $_POST['file_g_e'] == 'true') {
 | 
      
      
        | 90 | 
        
         | 
        
         | 
        		$g = $g+1;
  | 
      
      
        | 91 | 
        
         | 
        
         | 
        	}
  | 
      
      
        | 92 | 
        
         | 
        
         | 
        	$o = 0;
  | 
      
      
        | 93 | 
        
         | 
        
         | 
        	if(isset($_POST['file_o_r']) && $_POST['file_o_r'] == 'true') {
 | 
      
      
        | 94 | 
        
         | 
        
         | 
        		$o = $o+4;
  | 
      
      
        | 95 | 
        
         | 
        
         | 
        	}
  | 
      
      
        | 96 | 
        
         | 
        
         | 
        	if(isset($_POST['file_o_w']) && $_POST['file_o_w'] == 'true') {
 | 
      
      
        | 97 | 
        
         | 
        
         | 
        		$o = $o+2;
  | 
      
      
        | 98 | 
        
         | 
        
         | 
        	}
  | 
      
      
        | 99 | 
        
         | 
        
         | 
        	if(isset($_POST['file_o_e']) && $_POST['file_o_e'] == 'true') {
 | 
      
      
        | 100 | 
        
         | 
        
         | 
        		$o = $o+1;
  | 
      
      
        | 101 | 
        
         | 
        
         | 
        	}
  | 
      
      
        | 102 | 
        
         | 
        
         | 
        	$file_mode = "0".$u.$g.$o;
  | 
      
      
        | 103 | 
        
         | 
        
         | 
        	// Work-out the octal value for dir mode
  | 
      
      
        | 104 | 
        
         | 
        
         | 
        	$u = 0;
  | 
      
      
        | 105 | 
        
         | 
        
         | 
        	if(isset($_POST['dir_u_r']) && $_POST['dir_u_r'] == 'true') {
 | 
      
      
        | 106 | 
        
         | 
        
         | 
        		$u = $u+4;
  | 
      
      
        | 107 | 
        
         | 
        
         | 
        	}
  | 
      
      
        | 108 | 
        
         | 
        
         | 
        	if(isset($_POST['dir_u_w']) && $_POST['dir_u_w'] == 'true') {
 | 
      
      
        | 109 | 
        
         | 
        
         | 
        		$u = $u+2;
  | 
      
      
        | 110 | 
        
         | 
        
         | 
        	}
  | 
      
      
        | 111 | 
        
         | 
        
         | 
        	if(isset($_POST['dir_u_e']) && $_POST['dir_u_e'] == 'true') {
 | 
      
      
        | 112 | 
        
         | 
        
         | 
        		$u = $u+1;
  | 
      
      
        | 113 | 
        
         | 
        
         | 
        	}
  | 
      
      
        | 114 | 
        
         | 
        
         | 
        	$g = 0;
  | 
      
      
        | 115 | 
        
         | 
        
         | 
        	if(isset($_POST['dir_g_r']) && $_POST['dir_g_r'] == 'true') {
 | 
      
      
        | 116 | 
        
         | 
        
         | 
        		$g = $g+4;
  | 
      
      
        | 117 | 
        
         | 
        
         | 
        	}
  | 
      
      
        | 118 | 
        
         | 
        
         | 
        	if(isset($_POST['dir_g_w']) && $_POST['dir_g_w'] == 'true') {
 | 
      
      
        | 119 | 
        
         | 
        
         | 
        		$g = $g+2;
  | 
      
      
        | 120 | 
        
         | 
        
         | 
        	}
  | 
      
      
        | 121 | 
        
         | 
        
         | 
        	if(isset($_POST['dir_g_e']) && $_POST['dir_g_e'] == 'true') {
 | 
      
      
        | 122 | 
        
         | 
        
         | 
        		$g = $g+1;
  | 
      
      
        | 123 | 
        
         | 
        
         | 
        	}
  | 
      
      
        | 124 | 
        
         | 
        
         | 
        	$o = 0;
  | 
      
      
        | 125 | 
        
         | 
        
         | 
        	if(isset($_POST['dir_o_r']) && $_POST['dir_o_r'] == 'true') {
 | 
      
      
        | 126 | 
        
         | 
        
         | 
        		$o = $o+4;
  | 
      
      
        | 127 | 
        
         | 
        
         | 
        	}
  | 
      
      
        | 128 | 
        
         | 
        
         | 
        	if(isset($_POST['dir_o_w']) && $_POST['dir_o_w'] == 'true') {
 | 
      
      
        | 129 | 
        
         | 
        
         | 
        		$o = $o+2;
  | 
      
      
        | 130 | 
        
         | 
        
         | 
        	}
  | 
      
      
        | 131 | 
        
         | 
        
         | 
        	if(isset($_POST['dir_o_e']) && $_POST['dir_o_e'] == 'true') {
 | 
      
      
        | 132 | 
        
         | 
        
         | 
        		$o = $o+1;
  | 
      
      
        | 133 | 
        
         | 
        
         | 
        	}
  | 
      
      
        | 134 | 
        
         | 
        
         | 
        	$dir_mode = "0".$u.$g.$o;
  | 
      
      
        | 135 | 
        
         | 
        
         | 
        }
  | 
      
      
        | 136 | 
        
         | 
        
         | 
        
  | 
      
      
        | 137 | 
        
            1354
         | 
        
            Luisehahne
         | 
        $allow_tags_in_fields = array('website_header', 'website_footer');
 | 
      
      
        | 138 | 
        
         | 
        
         | 
        $allow_empty_values = array('website_header','website_footer','sec_anchor','pages_directory','page_spacer');
 | 
      
      
        | 139 | 
        
         | 
        
         | 
        $disallow_in_fields = array('pages_directory', 'media_directory','wb_version');
 | 
      
      
        | 140 | 
        
            1348
         | 
        
            Luisehahne
         | 
        // Create new database object
  | 
      
      
        | 141 | 
        
         | 
        
         | 
        /*$database = new database(); */
  | 
      
      
        | 142 | 
        
         | 
        
         | 
        
  | 
      
      
        | 143 | 
        
         | 
        
         | 
        // Query current settings in the db, then loop through them and update the db with the new value
  | 
      
      
        | 144 | 
        
            1354
         | 
        
            Luisehahne
         | 
        $settings = array();
  | 
      
      
        | 145 | 
        
         | 
        
         | 
        $old_settings = array();
  | 
      
      
        | 146 | 
        
         | 
        
         | 
        // Query current settings in the db, then loop through them to get old values
  | 
      
      
        | 147 | 
        
         | 
        
         | 
        $sql = 'SELECT `name`, `value` FROM `'.TABLE_PREFIX.'settings`';
  | 
      
      
        | 148 | 
        
         | 
        
         | 
        $sql .= 'ORDER BY `name`';
  | 
      
      
        | 149 | 
        
         | 
        
         | 
        
  | 
      
      
        | 150 | 
        
         | 
        
         | 
        $res_settings = $database->query($sql);
  | 
      
      
        | 151 | 
        
            1430
         | 
        
            Luisehahne
         | 
        $passed = false;
  | 
      
      
        | 152 | 
        
            1354
         | 
        
            Luisehahne
         | 
        while($setting = $res_settings->fetchRow())
  | 
      
      
        | 153 | 
        
            1348
         | 
        
            Luisehahne
         | 
        {
 | 
      
      
        | 154 | 
        
            1354
         | 
        
            Luisehahne
         | 
        	$old_settings[$setting['name']] = $setting['value'];
  | 
      
      
        | 155 | 
        
            1348
         | 
        
            Luisehahne
         | 
        	$setting_name = $setting['name'];
  | 
      
      
        | 156 | 
        
         | 
        
         | 
        	$value = $admin->get_post($setting_name);
  | 
      
      
        | 157 | 
        
            1356
         | 
        
            Luisehahne
         | 
        	$value = isset($_POST[$setting_name]) ? $value : $old_settings[$setting_name] ;
  | 
      
      
        | 158 | 
        
            1354
         | 
        
            Luisehahne
         | 
        	switch ($setting_name) {
 | 
      
      
        | 159 | 
        
         | 
        
         | 
        		case 'default_timezone':
  | 
      
      
        | 160 | 
        
         | 
        
         | 
        			$value=$value*60*60;
  | 
      
      
        | 161 | 
        
            1430
         | 
        
            Luisehahne
         | 
        			$passed = true;
  | 
      
      
        | 162 | 
        
            1354
         | 
        
            Luisehahne
         | 
        			break;
  | 
      
      
        | 163 | 
        
         | 
        
         | 
        		case 'string_dir_mode':
  | 
      
      
        | 164 | 
        
         | 
        
         | 
        			$value=$dir_mode;
  | 
      
      
        | 165 | 
        
            1430
         | 
        
            Luisehahne
         | 
        			$passed = true;
  | 
      
      
        | 166 | 
        
            1354
         | 
        
            Luisehahne
         | 
        			break;
  | 
      
      
        | 167 | 
        
         | 
        
         | 
        		case 'string_file_mode':
  | 
      
      
        | 168 | 
        
         | 
        
         | 
        			$value=$file_mode;
  | 
      
      
        | 169 | 
        
            1430
         | 
        
            Luisehahne
         | 
         			$passed = true;
  | 
      
      
        | 170 | 
        
         | 
        
         | 
        		break;
  | 
      
      
        | 171 | 
        
            1354
         | 
        
            Luisehahne
         | 
        		case 'pages_directory':
  | 
      
      
        | 172 | 
        
         | 
        
         | 
        			break;
  | 
      
      
        | 173 | 
        
         | 
        
         | 
        		default :
  | 
      
      
        | 174 | 
        
            1430
         | 
        
            Luisehahne
         | 
        		    $passed = in_array($setting_name, $allow_empty_values);
  | 
      
      
        | 175 | 
        
            1354
         | 
        
            Luisehahne
         | 
        			break;
  | 
      
      
        | 176 | 
        
         | 
        
         | 
        	}
  | 
      
      
        | 177 | 
        
         | 
        
         | 
            if (!in_array($setting_name, $allow_tags_in_fields))
  | 
      
      
        | 178 | 
        
            1348
         | 
        
            Luisehahne
         | 
            {
 | 
      
      
        | 179 | 
        
            1354
         | 
        
            Luisehahne
         | 
                $value = strip_tags($value);
  | 
      
      
        | 180 | 
        
         | 
        
         | 
            }
  | 
      
      
        | 181 | 
        
            1348
         | 
        
            Luisehahne
         | 
        
  | 
      
      
        | 182 | 
        
         | 
        
         | 
        
  | 
      
      
        | 183 | 
        
            1356
         | 
        
            Luisehahne
         | 
            if ( !in_array($value, $disallow_in_fields) && (isset($_POST[$setting_name]) || $passed == true) )
  | 
      
      
        | 184 | 
        
            1354
         | 
        
            Luisehahne
         | 
            {
 | 
      
      
        | 185 | 
        
         | 
        
         | 
                $value = trim($admin->add_slashes($value));
  | 
      
      
        | 186 | 
        
         | 
        
         | 
                $sql = 'UPDATE `'.TABLE_PREFIX.'settings` ';
  | 
      
      
        | 187 | 
        
         | 
        
         | 
                $sql .= 'SET `value` = \''.$value.'\' ';
  | 
      
      
        | 188 | 
        
         | 
        
         | 
                $sql .= 'WHERE `name` <> \'wb_version\' ';
  | 
      
      
        | 189 | 
        
         | 
        
         | 
                $sql .= 'AND `name` = \''.$setting_name.'\' ';
  | 
      
      
        | 190 | 
        
         | 
        
         | 
        
  | 
      
      
        | 191 | 
        
            1356
         | 
        
            Luisehahne
         | 
                if (!$database->query($sql))
  | 
      
      
        | 192 | 
        
            1354
         | 
        
            Luisehahne
         | 
                {
 | 
      
      
        | 193 | 
        
            1356
         | 
        
            Luisehahne
         | 
        			if($database->is_error()) {
 | 
      
      
        | 194 | 
        
            1425
         | 
        
            Luisehahne
         | 
        				$admin->print_error($database->get_error, $js_back );
  | 
      
      
        | 195 | 
        
            1356
         | 
        
            Luisehahne
         | 
        			}
  | 
      
      
        | 196 | 
        
            1354
         | 
        
            Luisehahne
         | 
                }
  | 
      
      
        | 197 | 
        
            1348
         | 
        
            Luisehahne
         | 
        	}
  | 
      
      
        | 198 | 
        
         | 
        
         | 
        }
  | 
      
      
        | 199 | 
        
         | 
        
         | 
        
  | 
      
      
        | 200 | 
        
         | 
        
         | 
        // Query current search settings in the db, then loop through them and update the db with the new value
  | 
      
      
        | 201 | 
        
         | 
        
         | 
        $sql  = 'SELECT `name`, `value` FROM `'.TABLE_PREFIX.'search` ';
  | 
      
      
        | 202 | 
        
         | 
        
         | 
        $sql .= 'WHERE `extra` = ""';
  | 
      
      
        | 203 | 
        
         | 
        
         | 
        $res_search = $database->query($sql);
  | 
      
      
        | 204 | 
        
         | 
        
         | 
        
  | 
      
      
        | 205 | 
        
         | 
        
         | 
        if($database->is_error()) {
 | 
      
      
        | 206 | 
        
            1425
         | 
        
            Luisehahne
         | 
        	$admin->print_error($database->is_error(), $js_back );
  | 
      
      
        | 207 | 
        
            1348
         | 
        
            Luisehahne
         | 
        }
  | 
      
      
        | 208 | 
        
         | 
        
         | 
        
  | 
      
      
        | 209 | 
        
         | 
        
         | 
        while($search_setting = $res_search->fetchRow())
  | 
      
      
        | 210 | 
        
         | 
        
         | 
        {
 | 
      
      
        | 211 | 
        
         | 
        
         | 
        	$old_value = $search_setting['value'];
  | 
      
      
        | 212 | 
        
         | 
        
         | 
        	$setting_name = $search_setting['name'];
  | 
      
      
        | 213 | 
        
         | 
        
         | 
        	$post_name = 'search_'.$search_setting['name'];
  | 
      
      
        | 214 | 
        
         | 
        
         | 
        
  | 
      
      
        | 215 | 
        
         | 
        
         | 
            // hold old value if post is empty
  | 
      
      
        | 216 | 
        
         | 
        
         | 
            // check search template
  | 
      
      
        | 217 | 
        
         | 
        
         | 
            $value = ( ($admin->get_post($post_name) == '') && ($setting_name != 'template') ) ? $old_value : $admin->get_post($post_name);
  | 
      
      
        | 218 | 
        
         | 
        
         | 
            // $value =  ( ($admin->get_post($post_name) == '') && ($setting_name == 'template') ) ? DEFAULT_TEMPLATE : $admin->get_post($post_name);
  | 
      
      
        | 219 | 
        
         | 
        
         | 
            if(isset($value))
  | 
      
      
        | 220 | 
        
         | 
        
         | 
        	{
 | 
      
      
        | 221 | 
        
         | 
        
         | 
        		$value = $admin->add_slashes($value);
  | 
      
      
        | 222 | 
        
         | 
        
         | 
                $sql  = 'UPDATE `'.TABLE_PREFIX.'search` ';
  | 
      
      
        | 223 | 
        
         | 
        
         | 
                $sql .= 'SET `value` = "'.$value.'" ';
  | 
      
      
        | 224 | 
        
         | 
        
         | 
                $sql .= 'WHERE `name` = "'.$setting_name.'" ';
  | 
      
      
        | 225 | 
        
         | 
        
         | 
                $sql .= 'AND `extra` = ""';
  | 
      
      
        | 226 | 
        
         | 
        
         | 
        		if($database->query($sql)) {
 | 
      
      
        | 227 | 
        
         | 
        
         | 
        		}
  | 
      
      
        | 228 | 
        
         | 
        
         | 
        		$sql_info = mysql_info($database->db_handle);
  | 
      
      
        | 229 | 
        
         | 
        
         | 
            }
  | 
      
      
        | 230 | 
        
         | 
        
         | 
        }
  | 
      
      
        | 231 | 
        
         | 
        
         | 
        
  | 
      
      
        | 232 | 
        
         | 
        
         | 
        // Check if there was an error updating the db
  | 
      
      
        | 233 | 
        
         | 
        
         | 
        if($database->is_error()) {
 | 
      
      
        | 234 | 
        
            1425
         | 
        
            Luisehahne
         | 
        	$admin->print_error($database->get_error, $js_back );
  | 
      
      
        | 235 | 
        
            1348
         | 
        
            Luisehahne
         | 
        } else {
 | 
      
      
        | 236 | 
        
            1425
         | 
        
            Luisehahne
         | 
        	$admin->print_success($MESSAGE['SETTINGS']['SAVED'], $js_back );
  | 
      
      
        | 237 | 
        
            1348
         | 
        
            Luisehahne
         | 
        }
  | 
      
      
        | 238 | 
        
         | 
        
         | 
        $admin->print_footer();
  | 
      
      
        | 239 | 
        
         | 
        
         | 
        
  | 
      
      
        | 240 | 
        
            1241
         | 
        
            Luisehahne
         | 
        ?>
  |