<?php
$title = 'Link Manager';
$parent_file = 'options-general.php';

function add_magic_quotes($array) {
	foreach ($array as $k => $v) {
		if (is_array($v)) {
			$array[$k] = add_magic_quotes($v);
		} else {
			$array[$k] = addslashes($v);
		}
	}
	return $array;
}

if (!get_magic_quotes_gpc()) {
	$_GET    = add_magic_quotes($_GET);
	$_POST   = add_magic_quotes($_POST);
	$_COOKIE = add_magic_quotes($_COOKIE);
}

$wpvarstoreset = array('action','standalone', 'option_group_id');
for ($i=0; $i<count($wpvarstoreset); $i += 1) {
	$wpvar = $wpvarstoreset[$i];
	if (!isset($$wpvar)) {
		if (empty($_POST["$wpvar"])) {
			if (empty($_GET["$wpvar"])) {
				$$wpvar = '';
			} else {
				$$wpvar = $_GET["$wpvar"];
			}
		} else {
			$$wpvar = $_POST["$wpvar"];
		}
	}
}

$standalone = 0;
include_once('admin-header.php');
include('options-head.php');
?>

<div class="wrap">
	<h2><?php echo _LANG_WLM_VARIOUS_SETTINGS; ?></h2>
	<form name="form1" method="post" action="options.php">
		<input type="hidden" name="action" value="update" />
		<input type="hidden" name="page_options" value="'links_minadminlevel','links_use_adminlevels','links_rating_type','links_rating_char','links_rating_ignore_zero','links_rating_single_image','links_rating_image0','links_rating_image1','links_rating_image2','links_rating_image3','links_rating_image4','links_rating_image5','links_rating_image6','links_rating_image7','links_rating_image8','links_rating_image9','weblogs_xml_url','weblogs_cacheminutes','links_updated_date_format','links_recently_updated_prepend','links_recently_updated_append','links_recently_updated_time'">
<table width="100%" cellspacing="3" cellpadding="2" class="editform">
  <tbody>
    <tr>
      <th id="leftmark" width="60%" valign="top" scope="row"><?php echo _LANG_WLM_MINIMUM_LEVEL; ?></th>
      <td><input type="text" name="links_minadminlevel" id="links_minadminlevel" size="6" value="<?php echo get_settings('links_minadminlevel'); ?>" /></td>
    </tr>
    <tr>
      <th id="leftmark" valign="top" scope="row"><?php echo _LANG_WLM_ALL_VISIBLE; ?></th>
      <td>                    <select name="links_use_adminlevels" id="links_use_adminlevels">
                    <option value="1" <?php selected('1', get_settings('links_use_adminlevels')); ?>>true</option>
                    <option value="0" <?php selected('0', get_settings('links_use_adminlevels')); ?>>false</option>
                    </select></td>
    </tr>
    <tr>
      <th id="leftmark" scope="row"><?php echo _LANG_WLM_TYPE_RATING; ?></th>
      <td><select name="links_rating_type" id="links_rating_type">
<option value="number" <?php selected('number', get_settings('links_rating_type')); ?>>Number</option>
<option value="char" <?php selected('char', get_settings('links_rating_type')); ?>>Character</option>
<option value="image" <?php selected('image', get_settings('links_rating_type')); ?>>Image</option>
</select></td>
    </tr>
    <tr>
      <th id="leftmark" valign="top" scope="row"><?php echo _LANG_WLM_SET_CHAR; ?></th>
      <td><input type="text" name="links_rating_char" id="links_rating_char" size="5" value="<?php echo get_settings('links_rating_char'); ?>" /></td>
    </tr>
    <tr>
      <th id="leftmark" scope="row"><?php echo _LANG_WLM_VALUE_ZERO; ?></th>
      <td><select name="links_rating_ignore_zero" id="links_rating_ignore_zero">
                    <option value="1" <?php selected('1', get_settings('links_rating_ignore_zero')); ?>>true</option>
                    <option value="0" <?php selected('0', get_settings('links_rating_ignore_zero')); ?>>false</option>
                    </select></td>
    </tr>
    <tr>
      <th id="leftmark" scope="row"><?php echo _LANG_WLM_SAME_IMAGE; ?></th>
      <td><select name="links_rating_single_image" id="links_rating_single_image">
                    <option value="1" <?php selected('1', get_settings('links_rating_single_image')); ?>>true</option>
                    <option value="0" <?php selected('0', get_settings('links_rating_single_image')); ?>>false</option>
                    </select></td>
    </tr>
    <tr>
      <th id="leftmark" scope="row"><?php echo _LANG_WLM_RATING_I0; ?></th>
      <td><input type="text" name="links_rating_image0" id="links_rating_image0" size="40" value="<?php echo get_settings('links_rating_image0'); ?>" /></td>
    </tr>
    <tr>
      <th id="leftmark" scope="row"><?php echo _LANG_WLM_RATING_I1; ?></th>
      <td><input type="text" name="links_rating_image1" id="links_rating_image1" size="40" value="<?php echo get_settings('links_rating_image1'); ?>" /></td>
    </tr>
    <tr>
      <th id="leftmark" scope="row"><?php echo _LANG_WLM_RATING_I2; ?></th>
      <td><input type="text" name="links_rating_image2" id="links_rating_image2" size="40" value="<?php echo get_settings('links_rating_image2'); ?>" /></td>
    </tr>
    <tr>
      <th id="leftmark" scope="row"><?php echo _LANG_WLM_RATING_I3; ?></th>
      <td><input type="text" name="links_rating_image3" id="links_rating_image3" size="40" value="<?php echo get_settings('links_rating_image3'); ?>" /></td>
    </tr>
    <tr>
      <th id="leftmark" scope="row"><?php echo _LANG_WLM_RATING_I4; ?></th>
      <td><input type="text" name="links_rating_image4" id="links_rating_image4" size="40" value="<?php echo get_settings('links_rating_image4'); ?>" /></td>
    </tr>
    <tr>
      <th id="leftmark" scope="row"><?php echo _LANG_WLM_RATING_I5; ?></th>
      <td><input type="text" name="links_rating_image5" id="links_rating_image5" size="40" value="<?php echo get_settings('links_rating_image5'); ?>" /></td>
    </tr>
    <tr>
      <th id="leftmark" scope="row"><?php echo _LANG_WLM_RATING_I6; ?></th>
      <td><input type="text" name="links_rating_image6" id="links_rating_image6" size="40" value="<?php echo get_settings('links_rating_image6'); ?>" /></td>
    </tr>
    <tr>
      <th id="leftmark" scope="row"><?php echo _LANG_WLM_RATING_I7; ?></th>
      <td><input type="text" name="links_rating_image7" id="links_rating_image7" size="40" value="<?php echo get_settings('links_rating_image7'); ?>" /></td>
    </tr>
    <tr>
      <th id="leftmark" scope="row"><?php echo _LANG_WLM_RATING_I8; ?></th>
      <td><input type="text" name="links_rating_image8" id="links_rating_image8" size="40" value="<?php echo get_settings('links_rating_image8'); ?>" /></td>
    </tr>
    <tr>
      <th id="leftmark" scope="row"><?php echo _LANG_WLM_RATING_I9; ?></th>
      <td><input type="text" name="links_rating_image9" id="links_rating_image9" size="40" value="<?php echo get_settings('links_rating_image9'); ?>" /></td>
    </tr>
    <tr>
      <th id="leftmark" scope="row"><?php echo _LANG_WLM_GRAB_FROM; ?></th>
      <td><input type="text" name="weblogs_xml_url" id="weblogs_xml_url" size="40" value="<?php echo get_settings('weblogs_xml_url'); ?>" /></td>
    </tr>
    <tr>
      <th id="leftmark" scope="row"><?php echo _LANG_WLM_CACHE_MIN; ?></th>
      <td><input type="text" name="weblogs_cacheminutes" id="weblogs_cacheminutes" size="6" value="<?php echo get_settings('weblogs_cacheminutes'); ?>" /></td>
    </tr>
    <tr>
      <th id="leftmark" scope="row"><?php echo _LANG_WLM_DATE_TOOLTIP; ?></th>
      <td><input type="text" name="links_updated_date_format" id="links_updated_date_format" size="25" value="<?php echo get_settings('links_updated_date_format'); ?>" /></td>
    </tr>
    <tr>
      <th id="leftmark" scope="row"><?php echo _LANG_WLM_TXT_PREPEND; ?></th>
      <td><input type="text" name="links_recently_updated_prepend" id="links_recently_updated_prepend" size="10" value="<?php echo get_settings('links_recently_updated_prepend'); ?>" /></td>
    </tr>
    <tr>
      <th id="leftmark" scope="row"><?php echo _LANG_WLM_TXT_APPEND; ?></th>
      <td><input type="text" name="links_recently_updated_append" id="links_recently_updated_append" size="20" value="<?php echo get_settings('links_recently_updated_append'); ?>" /></td>
    </tr>
    <tr>
      <th id="leftmark" scope="row"><?php echo _LANG_WLM_MIN_UPDATED; ?></th>
      <td><input type="text" name="links_recently_updated_time" id="links_recently_updated_time" size="6" value="<?php echo get_settings('links_recently_updated_time'); ?>" /></td>
    </tr>
  </tbody>
</table>
<p class="submit"><input type="submit" name="Update" value="<?php echo _LANG_WOP_SUBMIT_TEXT; ?>"></p>
</form>
</div> 
<?php include("admin-footer.php") ?>
