Exemplo n.º 1
0
function outputSearchForm($options)
{
    global $stylepath, $usr, $error_plz, $error_locidnocoords, $error_ort, $error_noort, $error_nofulltext;
    global $default_lang, $search_all_countries, $cache_attrib_jsarray_line, $cache_attrib_img_line;
    global $lang, $language, $config;
    //simple mode (only one easy filter)
    $filters = read_file($stylepath . '/search.simple.tpl.php');
    tpl_set_var('filters', $filters, false);
    tpl_set_var('formmethod', 'get');
    // checkboxes
    if (isset($options['sort'])) {
        $bBynameChecked = $options['sort'] == 'byname';
    } else {
        $bBynameChecked = $usr['userid'] == 0;
    }
    tpl_set_var('byname_checked', $bBynameChecked == true ? ' checked="checked"' : '');
    if (isset($options['sort'])) {
        $bBydistanceChecked = $options['sort'] == 'bydistance';
    } else {
        $bBydistanceChecked = $usr['userid'] != 0;
    }
    tpl_set_var('bydistance_checked', $bBydistanceChecked == true ? ' checked="checked"' : '');
    if (isset($options['sort'])) {
        $bBycreatedChecked = $options['sort'] == 'bycreated';
    } else {
        $bBycreatedChecked = $usr['userid'] == 0;
    }
    tpl_set_var('bycreated_checked', $bBycreatedChecked == true ? ' checked="checked"' : '');
    tpl_set_var('hidopt_sort', $options['sort']);
    tpl_set_var('f_inactive_checked', $options['f_inactive'] == 1 ? ' checked="checked"' : '');
    tpl_set_var('hidopt_inactive', $options['f_inactive'] == 1 ? '1' : '0');
    tpl_set_var('f_ignored_disabled', $usr['userid'] == 0 ? ' disabled="disabled"' : '');
    if ($usr['userid'] != 0) {
        tpl_set_var('f_ignored_disabled', $options['f_ignored'] == 1 ? ' checked="checked"' : '');
    }
    tpl_set_var('hidopt_ignored', $options['f_ignored'] == 1 ? '1' : '0');
    tpl_set_var('f_userfound_disabled', $usr['userid'] == 0 ? ' disabled="disabled"' : '');
    if ($usr['userid'] != 0) {
        tpl_set_var('f_userfound_disabled', $options['f_userfound'] == 1 ? ' checked="checked"' : '');
    }
    tpl_set_var('hidopt_userfound', $options['f_userfound'] == 1 ? '1' : '0');
    tpl_set_var('f_userowner_disabled', $usr['userid'] == 0 ? ' disabled="disabled"' : '');
    if ($usr['userid'] != 0) {
        tpl_set_var('f_userowner_disabled', $options['f_userowner'] == 1 ? ' checked="checked"' : '');
    }
    tpl_set_var('hidopt_userowner', $options['f_userowner'] == 1 ? '1' : '0');
    tpl_set_var('f_watched_disabled', $usr['userid'] == 0 ? ' disabled="disabled"' : '');
    if ($usr['userid'] != 0) {
        tpl_set_var('f_watched_disabled', $options['f_watched'] == 1 ? ' checked="checked"' : '');
    }
    tpl_set_var('hidopt_watched', $options['f_watched'] == 1 ? '1' : '0');
    tpl_set_var('f_geokret_checked', $options['f_geokret'] == 1 ? ' checked="checked"' : '');
    tpl_set_var('hidopt_geokret', $options['f_geokret'] == 1 ? '1' : '0');
    if (isset($options['cacherating'])) {
        tpl_set_var('all_caches_checked', $options['cacherating'] == 0 ? ' checked="checked"' : '');
        tpl_set_var('recommended_caches_checked', $options['cacherating'] > 0 ? ' checked="checked"' : '');
        tpl_set_var('cache_min_rec', $options['cacherating'] > 0 ? $options['cacherating'] : 0);
        tpl_set_var('min_rec_caches_disabled', $options['cacherating'] == 0 ? ' disabled="disabled"' : '');
    }
    if (isset($options['cacherating'])) {
        tpl_set_var('cacherating', htmlspecialchars($options['cacherating'], ENT_COMPAT, 'UTF-8'));
    } else {
        tpl_set_var('cacherating', '');
    }
    if (isset($options['region'])) {
        tpl_set_var('region', htmlspecialchars($options['region'], ENT_COMPAT, 'UTF-8'));
    } else {
        tpl_set_var('region', '');
    }
    if (isset($options['country'])) {
        tpl_set_var('country', htmlspecialchars($options['country'], ENT_COMPAT, 'UTF-8'));
    } else {
        tpl_set_var('country', '');
    }
    if (isset($options['cachetype'])) {
        tpl_set_var('cachetype', htmlspecialchars($options['cachetype'], ENT_COMPAT, 'UTF-8'));
    } else {
        tpl_set_var('cachetype', '');
    }
    if (isset($options['cachesize_1'])) {
        tpl_set_var('cachesize_1', htmlspecialchars($options['cachesize_1'], ENT_COMPAT, 'UTF-8'));
    } else {
        tpl_set_var('cachesize_1', '');
    }
    if (isset($options['cachesize_2'])) {
        tpl_set_var('cachesize_2', htmlspecialchars($options['cachesize_2'], ENT_COMPAT, 'UTF-8'));
    } else {
        tpl_set_var('cachesize_2', '');
    }
    if (isset($options['cachesize_3'])) {
        tpl_set_var('cachesize_3', htmlspecialchars($options['cachesize_3'], ENT_COMPAT, 'UTF-8'));
    } else {
        tpl_set_var('cachesize_3', '');
    }
    if (isset($options['cachesize_4'])) {
        tpl_set_var('cachesize_4', htmlspecialchars($options['cachesize_4'], ENT_COMPAT, 'UTF-8'));
    } else {
        tpl_set_var('cachesize_4', '');
    }
    if (isset($options['cachesize_5'])) {
        tpl_set_var('cachesize_5', htmlspecialchars($options['cachesize_5'], ENT_COMPAT, 'UTF-8'));
    } else {
        tpl_set_var('cachesize_5', '');
    }
    if (isset($options['cachesize_6'])) {
        tpl_set_var('cachesize_6', htmlspecialchars($options['cachesize_6'], ENT_COMPAT, 'UTF-8'));
    } else {
        tpl_set_var('cachesize_6', '');
    }
    if (isset($options['cachesize_7'])) {
        tpl_set_var('cachesize_7', htmlspecialchars($options['cachesize_7'], ENT_COMPAT, 'UTF-8'));
    } else {
        tpl_set_var('cachesize_7', '');
    }
    if (isset($options['cachevote_1']) && isset($options['cachevote_2'])) {
        tpl_set_var('cachevote_1', htmlspecialchars($options['cachevote_1'], ENT_COMPAT, 'UTF-8'));
        tpl_set_var('cachevote_2', htmlspecialchars($options['cachevote_2'], ENT_COMPAT, 'UTF-8'));
    } else {
        tpl_set_var('cachevote_1', '');
        tpl_set_var('cachevote_2', '');
    }
    if (isset($options['cachenovote'])) {
        tpl_set_var('cachenovote', htmlspecialchars($options['cachenovote'], ENT_COMPAT, 'UTF-8'));
    } else {
        tpl_set_var('cachenovote', '');
    }
    if (isset($options['cachedifficulty_1']) && isset($options['cachedifficulty_2'])) {
        tpl_set_var('cachedifficulty_1', htmlspecialchars($options['cachedifficulty_1'], ENT_COMPAT, 'UTF-8'));
        tpl_set_var('cachedifficulty_2', htmlspecialchars($options['cachedifficulty_2'], ENT_COMPAT, 'UTF-8'));
    } else {
        tpl_set_var('cachedifficulty_1', '');
        tpl_set_var('cachedifficulty_2', '');
    }
    if (isset($options['cacheterrain_1']) && isset($options['cacheterrain_2'])) {
        tpl_set_var('cacheterrain_1', htmlspecialchars($options['cacheterrain_1'], ENT_COMPAT, 'UTF-8'));
        tpl_set_var('cacheterrain_2', htmlspecialchars($options['cacheterrain_2'], ENT_COMPAT, 'UTF-8'));
    } else {
        tpl_set_var('cacheterrain_1', '');
        tpl_set_var('cacheterrain_2', '');
    }
    // cachename
    tpl_set_var('cachename', isset($options['cachename']) ? htmlspecialchars($options['cachename'], ENT_COMPAT, 'UTF-8') : '');
    // koordinaten
    if (!isset($options['lat_h'])) {
        if ($usr !== false) {
            $rs = sql('SELECT `latitude`, `longitude` FROM `user` WHERE `user_id`=\'' . sql_escape($usr['userid']) . '\'');
            $record = sql_fetch_array($rs);
            $lon = $record['longitude'];
            $lat = $record['latitude'];
            mysql_free_result($rs);
            if ($lon < 0) {
                tpl_set_var('lonE_sel', '');
                tpl_set_var('lonW_sel', ' selected="selected"');
                $lon = -$lon;
            } else {
                tpl_set_var('lonE_sel', ' selected="selected"');
                tpl_set_var('lonW_sel', '');
            }
            if ($lat < 0) {
                tpl_set_var('latN_sel', '');
                tpl_set_var('latS_sel', ' selected="selected"');
                $lat = -$lat;
            } else {
                tpl_set_var('latN_sel', ' selected="selected"');
                tpl_set_var('latS_sel', '');
            }
            $lon_h = floor($lon);
            $lat_h = floor($lat);
            $lon_min = ($lon - $lon_h) * 60;
            $lat_min = ($lat - $lat_h) * 60;
            tpl_set_var('lat_h', $lat_h);
            tpl_set_var('lon_h', $lon_h);
            tpl_set_var('lat_min', sprintf("%02.3f", $lat_min));
            tpl_set_var('lon_min', sprintf("%02.3f", $lon_min));
        } else {
            tpl_set_var('lat_h', '00');
            tpl_set_var('lon_h', '000');
            tpl_set_var('lat_min', '00.000');
            tpl_set_var('lon_min', '00.000');
            tpl_set_var('latN_sel', ' selected="selected"');
            tpl_set_var('latS_sel', '');
            tpl_set_var('lonE_sel', ' selected="selected"');
            tpl_set_var('lonW_sel', '');
        }
    } else {
        tpl_set_var('lat_h', isset($options['lat_h']) ? $options['lat_h'] : '00');
        tpl_set_var('lon_h', isset($options['lon_h']) ? $options['lon_h'] : '000');
        tpl_set_var('lat_min', isset($options['lat_min']) ? $options['lat_min'] : '00.000');
        tpl_set_var('lon_min', isset($options['lon_min']) ? $options['lon_min'] : '00.000');
        if ($options['lonEW'] == 'W') {
            tpl_set_var('lonE_sel', '');
            tpl_set_var('lonW_sel', 'selected="selected"');
        } else {
            tpl_set_var('lonE_sel', 'selected="selected"');
            tpl_set_var('lonW_sel', '');
        }
        if ($options['latNS'] == 'S') {
            tpl_set_var('latS_sel', 'selected="selected"');
            tpl_set_var('latN_sel', '');
        } else {
            tpl_set_var('latS_sel', '');
            tpl_set_var('latN_sel', 'selected="selected"');
        }
    }
    tpl_set_var('distance', isset($options['distance']) ? $options['distance'] : 20);
    if (!isset($options['unit'])) {
        $options['unit'] = 'km';
    }
    if ($options['unit'] == 'km') {
        tpl_set_var('sel_km', 'selected="selected"');
        tpl_set_var('sel_sm', '');
        tpl_set_var('sel_nm', '');
    } else {
        if ($options['unit'] == 'sm') {
            tpl_set_var('sel_km', '');
            tpl_set_var('sel_sm', 'selected="selected"');
            tpl_set_var('sel_nm', '');
        } else {
            if ($options['unit'] == 'nm') {
                tpl_set_var('sel_km', '');
                tpl_set_var('sel_sm', '');
                tpl_set_var('sel_nm', 'selected="selected"');
            }
        }
    }
    // plz
    tpl_set_var('plz', isset($options['plz']) ? htmlspecialchars($options['plz'], ENT_COMPAT, 'UTF-8') : '');
    tpl_set_var('ort', isset($options['ort']) ? htmlspecialchars($options['ort'], ENT_COMPAT, 'UTF-8') : '');
    // owner
    tpl_set_var('owner', isset($options['owner']) ? htmlspecialchars($options['owner'], ENT_COMPAT, 'UTF-8') : '');
    // finder
    tpl_set_var('finder', isset($options['finder']) ? htmlspecialchars($options['finder'], ENT_COMPAT, 'UTF-8') : '');
    //countryoptions
    $countriesoptions = $search_all_countries;
    $rs = sql('SELECT `short` FROM `countries` WHERE `short` IN (SELECT DISTINCT `country` FROM `caches`) ');
    for ($i = 0; $i < mysql_num_rows($rs); $i++) {
        $record = sql_fetch_array($rs);
        if ($record['short'] == $options['country']) {
            $countriesoptions .= '<option value="' . htmlspecialchars($record['short'], ENT_COMPAT, 'UTF-8') . '" selected="selected">' . htmlspecialchars(tr($record['short']), ENT_COMPAT, 'UTF-8') . '</option>';
        } else {
            $countriesoptions .= '<option value="' . htmlspecialchars($record['short'], ENT_COMPAT, 'UTF-8') . '">' . htmlspecialchars(tr($record['short']), ENT_COMPAT, 'UTF-8') . '</option>';
        }
        $countriesoptions .= "\n";
    }
    tpl_set_var('countryoptions', $countriesoptions);
    //regionoptions
    $regionsoptions = '<option value="" selected="selected">' . tr('all_regions') . '</option>';
    tpl_set_var('regionoptions', $regionsoptions);
    // Typ skrzynki
    $cachetype_options = '';
    if (checkField('cache_type', $lang)) {
        $lang_db = $lang;
    } else {
        $lang_db = "en";
    }
    $rs = sql('SELECT `id`, `&1`, `icon_large` FROM `cache_type` ORDER BY `sort`', $lang_db);
    for ($i = 0; $i < mysql_num_rows($rs); $i++) {
        $record = sql_fetch_array($rs);
        /*
        if ($record['id'] == $options['cachetype'])
            $cachetype_options .= '<option value="' . htmlspecialchars($record['id'], ENT_COMPAT, 'UTF-8') . '" selected="selected">' . htmlspecialchars($record[$default_lang], ENT_COMPAT, 'UTF-8') . '</option>';
        else
            $cachetype_options .= '<option value="' . htmlspecialchars($record['id'], ENT_COMPAT, 'UTF-8') . '">' . htmlspecialchars($record[$default_lang], ENT_COMPAT, 'UTF-8') . '</option>';
        */
        $c_rec_id = $record['id'] - 1;
        $cachetype_icon = $record['icon_large'];
        //      if ($options['cachetype'][$c_rec_id] == '1') {
        //          $cachetype_options .= '<input type="checkbox" name="cachetype_' . htmlspecialchars($record['id'], ENT_COMPAT, 'UTF-8') . '" value="1" id="l_cachetype_' . htmlspecialchars($record['id'], ENT_COMPAT, 'UTF-8') . '" class="checkbox" onclick="javascript:sync_options(this)" checked="checked" /><label for="l_cachetype_' . htmlspecialchars($record['id'], ENT_COMPAT, 'UTF-8') . '">' . htmlspecialchars($record[$default_lang], ENT_COMPAT, 'UTF-8') . '</label>';
        //      } else {
        //          $cachetype_options .= '<input type="checkbox" name="cachetype_' . htmlspecialchars($record['id'], ENT_COMPAT, 'UTF-8') . '" value="1" id="l_cachetype_' . htmlspecialchars($record['id'], ENT_COMPAT, 'UTF-8') . '" class="checkbox" onclick="javascript:sync_options(this)" /><label for="l_cachetype_' . htmlspecialchars($record['id'], ENT_COMPAT, 'UTF-8') . '">' . htmlspecialchars($record[$default_lang], ENT_COMPAT, 'UTF-8') . '</label>';
        //      }
        $cachetype_icon = str_replace("mystery", "quiz", $cachetype_icon);
        // mystery is an outdated name, we use 'quiz' now :-)
        $cachetype_icon_bw = $cachetype_icon;
        $cachetype_icon = str_replace(".png", "-i.png", $cachetype_icon);
        $cachetype_icon_bw = str_replace(".png", "-i-bw.png", $cachetype_icon_bw);
        $cachetype_icon = str_replace(".gif", "-i.png", $cachetype_icon);
        $cachetype_icon_bw = str_replace(".gif", "-i-bw.png", $cachetype_icon_bw);
        $hidden_css = "position: absolute; visibility: hidden;";
        // css required to hide an image
        // this marks saved user preference for searching, if 1, the cache is by default searched
        // and thus making the colour image visibile
        if (isset($options['cachetype'][$c_rec_id]) && $options['cachetype'][$c_rec_id] == '1') {
            $icon_hidden = "";
            $icon_bw_hidden = $hidden_css;
        } else {
            $icon_hidden = $hidden_css;
            $icon_bw_hidden = "";
        }
        $hidden_css = "position: absolute; visibility: hidden;";
        $cachetype_options .= '<img id="cachetype_' . htmlspecialchars($record['id'], ENT_COMPAT, 'UTF-8') . '"    src="' . htmlspecialchars($stylepath . "/images/" . $cachetype_icon, ENT_COMPAT, 'UTF-8') . '" title="' . htmlspecialchars($record[$lang_db], ENT_COMPAT, 'UTF-8') . '" alt="' . htmlspecialchars($record[$lang_db], ENT_COMPAT, 'UTF-8') . '" onmousedown="javascript:switchCacheType(\'cachetype_' . htmlspecialchars($record['id'], ENT_COMPAT, 'UTF-8') . '\')" style="cursor: pointer;' . $icon_hidden . '" />';
        $cachetype_options .= '<img id="cachetype_' . htmlspecialchars($record['id'], ENT_COMPAT, 'UTF-8') . '_bw" src="' . htmlspecialchars($stylepath . "/images/" . $cachetype_icon_bw, ENT_COMPAT, 'UTF-8') . '" title="' . htmlspecialchars($record[$lang_db], ENT_COMPAT, 'UTF-8') . '" alt="' . htmlspecialchars($record[$lang_db], ENT_COMPAT, 'UTF-8') . '" onmousedown="javascript:switchCacheType(\'cachetype_' . htmlspecialchars($record['id'], ENT_COMPAT, 'UTF-8') . '\')" style="cursor: pointer;' . $icon_bw_hidden . '" />';
        if ($i == 2) {
            $cachetype_options .= '&nbsp;&nbsp;&nbsp;';
        }
        $cachetype_options .= "\n";
    }
    tpl_set_var('cachetype_options', $cachetype_options);
    //Rozmiar skrzynki
    $cachesize_options = '';
    if (checkField('cache_size', $lang)) {
        $lang_db = $lang;
    } else {
        $lang_db = "en";
    }
    $rs = sql('SELECT `id`, `&1` FROM `cache_size` ORDER BY `id`', $lang_db);
    for ($i = 0; $i < mysql_num_rows($rs); $i++) {
        $record = sql_fetch_array($rs);
        $cachesize_options .= '<input type="checkbox" name="cachesize_' . htmlspecialchars($record['id'], ENT_COMPAT, 'UTF-8') . '" value="1" id="l_cachesize_' . htmlspecialchars($record['id'], ENT_COMPAT, 'UTF-8') . '" class="checkbox" onclick="javascript:sync_options(this)" checked="checked" /><label for="l_cachesize_' . htmlspecialchars($record['id'], ENT_COMPAT, 'UTF-8') . '">' . htmlspecialchars($record[$lang_db], ENT_COMPAT, 'UTF-8') . '</label>';
        $cachesize_options .= "\n";
    }
    tpl_set_var('cachesize_options', $cachesize_options);
    // gpxlogLimit
    if ($options['gpxLogLimit'] == false) {
        tpl_set_var('gpxLogLimitUserChoice', 5);
    } else {
        tpl_set_var('gpxLogLimitUserChoice', $options['gpxLogLimit']);
    }
    function attr_jsline($tpl, $options, $id, $textlong, $iconlarge, $iconno, $iconundef, $category)
    {
        $line = $tpl;
        $line = mb_ereg_replace('{id}', $id, $line);
        if (array_search($id, $options['cache_attribs']) === false) {
            if (array_search($id, $options['cache_attribs_not']) === false) {
                $line = mb_ereg_replace('{state}', 0, $line);
            } else {
                $line = mb_ereg_replace('{state}', 2, $line);
            }
        } else {
            $line = mb_ereg_replace('{state}', 1, $line);
        }
        $line = mb_ereg_replace('{text_long}', addslashes($textlong), $line);
        $line = mb_ereg_replace('{icon}', $iconlarge, $line);
        $line = mb_ereg_replace('{icon_no}', $iconno, $line);
        $line = mb_ereg_replace('{icon_undef}', $iconundef, $line);
        $line = mb_ereg_replace('{category}', $category, $line);
        return $line;
    }
    function attr_image($tpl, $options, $id, $textlong, $iconlarge, $iconno, $iconundef, $category)
    {
        $line = $tpl;
        $line = mb_ereg_replace('{id}', $id, $line);
        $line = mb_ereg_replace('{text_long}', $textlong, $line);
        if (array_search($id, $options['cache_attribs']) === false) {
            if (array_search($id, $options['cache_attribs_not']) === false) {
                $line = mb_ereg_replace('{icon}', $iconundef, $line);
            } else {
                $line = mb_ereg_replace('{icon}', $iconno, $line);
            }
        } else {
            $line = mb_ereg_replace('{icon}', $iconlarge, $line);
        }
        return $line;
    }
    // cache-attributes
    $attributes_jsarray = '';
    $attributes_img = '';
    $attributesCat2_img = '';
    // select attributes depend on specified language.
    $database = new dataBase(false);
    $query = "SELECT `id`, `text_long`, `icon_large`, `icon_no`, `icon_undef`, `category` FROM `cache_attrib` WHERE `language` LIKE :1 ORDER BY `id`";
    $database->multiVariableQuery($query, strtoupper($lang));
    // if specified language is in database
    if ($database->rowCount() <= 0) {
        // if we have not specified language in db, just use english.
        $database->multiVariableQuery($query, 'EN');
    }
    $rs = $database->dbResultFetchAll();
    unset($database);
    foreach ($rs as $record) {
        // icon specified
        $line = attr_jsline($cache_attrib_jsarray_line, $options, $record['id'], $record['text_long'], $record['icon_large'], $record['icon_no'], $record['icon_undef'], $record['category']);
        if ($attributes_jsarray != '') {
            $attributes_jsarray .= ",\n";
        }
        $attributes_jsarray .= $line;
        $line = attr_image($cache_attrib_img_line, $options, $record['id'], $record['text_long'], $record['icon_large'], $record['icon_no'], $record['icon_undef'], $record['category']);
        if ($record['category'] != 1) {
            $attributesCat2_img .= $line;
        } else {
            $attributes_img .= $line;
        }
    }
    $line = attr_jsline($cache_attrib_jsarray_line, $options, "99", tr("with_password"), $config['search-attr-icons']['password'][0], $config['search-attr-icons']['password'][1], $config['search-attr-icons']['password'][2], 0);
    $attributes_jsarray .= ",\n" . $line;
    $line = attr_image($cache_attrib_img_line, $options, "99", tr("with_password"), $config['search-attr-icons']['password'][0], $config['search-attr-icons']['password'][1], $config['search-attr-icons']['password'][2], 0);
    $attributes_img .= $line;
    tpl_set_var('cache_attrib_list', $attributes_img);
    tpl_set_var('cache_attribCat2_list', $attributesCat2_img);
    tpl_set_var('attributes_jsarray', $attributes_jsarray);
    tpl_set_var('hidopt_attribs', implode(';', $options['cache_attribs']));
    tpl_set_var('hidopt_attribs_not', implode(';', $options['cache_attribs_not']));
    tpl_set_var('fulltext', '');
    tpl_set_var('ft_name_checked', 'checked="checked"');
    tpl_set_var('ft_desc_checked', '');
    tpl_set_var('ft_logs_checked', '');
    tpl_set_var('ft_pictures_checked', '');
    // fulltext options
    if ($options['searchtype'] == 'byfulltext') {
        if (!isset($options['fulltext'])) {
            $options['fulltext'] = '';
        }
        tpl_set_var('fulltext', htmlspecialchars($options['fulltext'], ENT_COMPAT, 'UTF-8'));
        if (isset($options['ft_name']) && $options['ft_name'] == 1) {
            tpl_set_var('ft_name_checked', 'checked="checked"');
        } else {
            tpl_set_var('ft_name_checked', '');
        }
        if (isset($options['ft_desc']) && $options['ft_desc'] == 1) {
            tpl_set_var('ft_desc_checked', 'checked="checked"');
        } else {
            tpl_set_var('ft_desc_checked', '');
        }
        if (isset($options['ft_logs']) && $options['ft_logs'] == 1) {
            tpl_set_var('ft_logs_checked', 'checked="checked"');
        } else {
            tpl_set_var('ft_logs_checked', '');
        }
        if (isset($options['ft_pictures']) && $options['ft_pictures'] == 1) {
            tpl_set_var('ft_pictures_checked', 'checked="checked"');
        } else {
            tpl_set_var('ft_pictures_checked', '');
        }
    }
    // errormeldungen
    tpl_set_var('ortserror', '');
    if (isset($options['error_plz'])) {
        tpl_set_var('ortserror', $error_plz);
    } else {
        if (isset($options['error_ort'])) {
            tpl_set_var('ortserror', $error_ort);
        } else {
            if (isset($options['error_locidnocoords'])) {
                tpl_set_var('ortserror', $error_locidnocoords);
            } else {
                if (isset($options['error_noort'])) {
                    tpl_set_var('ortserror', $error_noort);
                }
            }
        }
    }
    tpl_set_var('fulltexterror', isset($options['error_nofulltext']) ? $error_nofulltext : '');
    tpl_BuildTemplate();
    exit;
}
Exemplo n.º 2
0
     WHERE `language`=:1 ORDER BY `id`', $lang_attribute);
 while ($record = $database->dbResultFetch($s)) {
     // icon specified
     $line = attr_jsline($cache_attrib_jsarray_line, $options, $record['id'], $record['text_long'], $record['icon_large'], $record['icon_no'], $record['icon_undef'], $record['category']);
     if ($attributes_jsarray != '') {
         $attributes_jsarray .= ",\n";
     }
     $attributes_jsarray .= $line;
     $line = attr_image($cache_attrib_img_line, $options, $record['id'], $record['text_long'], $record['icon_large'], $record['icon_no'], $record['icon_undef'], $record['category']);
     if ($record['category'] != 1) {
         $attributesCat2_img .= $line;
     } else {
         $attributes_img .= $line;
     }
 }
 $line = attr_jsline($cache_attrib_jsarray_line, $options, "99", tr("with_password"), $config['search-attr-icons']['password'][0], $config['search-attr-icons']['password'][1], $config['search-attr-icons']['password'][2], 0);
 $attributes_jsarray .= ",\n" . $line;
 $line = attr_image($cache_attrib_img_line, $options, "99", tr("with_password"), $config['search-attr-icons']['password'][0], $config['search-attr-icons']['password'][1], $config['search-attr-icons']['password'][2], 0);
 $attributes_img .= $line;
 tpl_set_var('cache_attrib_list', $attributes_img);
 tpl_set_var('cache_attribCat2_list', $attributesCat2_img);
 tpl_set_var('attributes_jsarray', $attributes_jsarray);
 tpl_set_var('hidopt_attribs', implode(';', $options['cache_attribs']));
 tpl_set_var('hidopt_attribs_not', implode(';', $options['cache_attribs_not']));
 tpl_set_var('f_inactive_checked', $options['f_inactive'] == 1 ? ' checked="checked"' : '');
 tpl_set_var('hidopt_inactive', $options['f_inactive'] == 1 ? '1' : '0');
 tpl_set_var('f_ignored_disabled', $usr['userid'] == 0 ? ' disabled="disabled"' : '');
 if ($usr['userid'] != 0) {
     tpl_set_var('f_ignored_disabled', $options['f_ignored'] == 1 ? ' checked="checked"' : '');
 }
 tpl_set_var('hidopt_ignored', $options['f_ignored'] == 1 ? '1' : '0');