"
.__("The MyISAM check has been overridden. You may now use the \"consider titles\" and \"consider bodies\" relatedness criteria.")
."";
}
$yarpp_myisam = true;
if (!yarpp_get_option('myisam_override')) {
$yarpp_check_return = yarpp_myisam_check();
if ($yarpp_check_return !== true) { // if it's not *exactly* true
echo "
"
.sprintf(__("YARPP's \"consider titles\" and \"consider bodies\" relatedness criteria require your %s table to use the MyISAM storage engine, but the table seems to be using the %s engine. These two options have been disabled.",'yarpp'),$wpdb->posts,$yarpp_check_return)
." "
.sprintf(__("To restore these features, please update your %s table by executing the following SQL directive: ALTER TABLE `%s` ENGINE = MyISAM; . No data will be erased by altering the table's engine, although there are performance implications.",'yarpp'),$wpdb->posts,$wpdb->posts)
." "
.sprintf(__("If, despite this check, you are sure that %s is using the MyISAM engine, press this magic button:",'yarpp'),$wpdb->posts)
." "
.""
."
The \"consider tags\" and \"consider categories\" options require WordPress version 2.5. These two options have been disabled.
";
yarpp_set_option('categories',1);
yarpp_set_option('tags',1);
$yarpp_twopointfive = false;
}
if ($yarpp_myisam) {
if (!yarpp_enabled()) {
echo '
';
if (yarpp_activate())
_e('The YARPP database had an error but has been fixed.','yarpp');
else
_e('The YARPP database has an error which could not be fixed.','yarpp');
echo '
';
}
}
yarpp_reinforce(); // just in case, set default options, etc.
//compute $tagmap
$tagmap = array();
foreach ($wpdb->get_results("select $wpdb->terms.term_id, name from $wpdb->terms natural join $wpdb->term_taxonomy where $wpdb->term_taxonomy.taxonomy = 'category'") as $tag) {
$tagmap[$tag->term_id] = strtolower($tag->name);
}
function yarpp_mapthetag($id) {
global $tagmap;
return $tagmap[$id];
}
function yarpp_unmapthetag($name) {
global $tagmap;
$untagmap = array_flip($tagmap);
return $untagmap[$name];
}
if (isset($_POST['update_yarpp'])) {
foreach (array_keys($yarpp_value_options) as $option) {
yarpp_set_option($option,addslashes($_POST[$option]));
}
foreach (array('title','body','tags','categories') as $key) {
if (!isset($_POST[$key])) yarpp_set_option($key,1);
}
if (isset($_POST['discats'])) {
yarpp_set_option('discats',implode(',',array_keys($_POST['discats']))); // discats is different
} else {
yarpp_set_option('discats','');
}
if (isset($_POST['distags'])) {
yarpp_set_option('distags',implode(',',array_keys($_POST['distags']))); // distags is also different
} else {
yarpp_set_option('distags','');
}
//update_option('yarpp_distags',implode(',',array_map('yarpp_unmapthetag',preg_split('!\s*[;,]\s*!',strtolower($_POST['distags']))))); // distags is even more different
foreach (array_keys($yarpp_binary_options) as $option) {
(isset($_POST[$option])) ? yarpp_set_option($option,true) : yarpp_set_option($option,false);
}
echo '
".__("do not consider",'yarpp')."
".__("consider",'yarpp')."
".sprintf(__("require at least one %s in common",'yarpp'),__($type,'yarpp'))."
".sprintf(__("require more than one %s in common",'yarpp'),__($type,'yarpp'))."
";
}
function importance2($option,$desc,$type='word',$tr="
".__("do not consider",'yarpp')."
".__("consider",'yarpp')."
".__("consider with extra weight",'yarpp')."
";
}
function select($option,$desc,$type='word',$tr="
",$inputplus = '') {
echo " $tr$desc
".__("do not consider",'yarpp')."
".__("consider",'yarpp')."
".sprintf(__("require at least one %s in common",'yarpp'),__($type,'yarpp'))."
".sprintf(__("require more than one %s in common",'yarpp'),__($type,'yarpp'))."