" .__("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) ."
" ."
" ."
"; yarpp_set_option('title',1); yarpp_set_option('body',1); $yarpp_myisam = false; } } $yarpp_twopointfive = true; if (substr($wp_version,0,3) < 2.5) { echo "
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 '

Options saved!

'; } function checkbox($option,$desc,$tr=" ",$inputplus = '',$thplus='') { echo " $tr $desc$thplus "; } function textbox($option,$desc,$size=2,$tr=" ") { $value = yarpp_get_option($option,true); echo " $tr$desc "; } function importance($option,$desc,$type='word',$tr=" ",$inputplus = '') { $value = yarpp_get_option($option); // $type could be... __('word','yarpp'); __('tag','yarpp'); __('category','yarpp'); 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'))." "; } function importance2($option,$desc,$type='word',$tr=" ",$inputplus = '') { $value = yarpp_get_option($option); echo " $tr$desc ".__("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'))." "; } ?>

mitcho (Michael 芳貴 Erlewine) and based on the fabulous work of Peter Bower, Alexander Malov & Mike Lu.','yarpp');?>

get_results("select $wpdb->terms.term_id, name from $wpdb->terms natural join $wpdb->term_taxonomy where $wpdb->term_taxonomy.taxonomy = 'category' order by name") as $cat) { echo "term_id,$discats) ? ' checked="checked"': '' )." /> ";//for='discats[$cat->term_id]' it's not HTML. :( }?>
get_results("select $wpdb->terms.term_id, name from $wpdb->terms natural join $wpdb->term_taxonomy where $wpdb->term_taxonomy.taxonomy = 'post_tag' order by name") as $tag) { echo "term_id,$distags) ? ' checked="checked"': '' )." /> ";// for='distags[$tag->term_id]' }?>

previous plugins it is based on as it limits the related posts list by (1) a maximum number and (2) a match threshold.','yarpp');?> more>

",(!$yarpp_myisam?' readonly="readonly" disabled="disabled"':''))?> ",(!$yarpp_myisam?' readonly="readonly" disabled="disabled"':''))?> ",(!$yarpp_twopointfive?' readonly="readonly" disabled="disabled"':''))?> ",(!$yarpp_twopointfive?' readonly="readonly" disabled="disabled"':''))?> more>".__("When the \"Cross-relate posts and pages\" option is selected, the related_posts(), related_pages(), and related_entries() all will give the same output, returning both related pages and posts.",'yarpp').""); ?>

for your website",'yarpp');?>

".__("RELATED TITLE",'yarpp')." $i")).(yarpp_get_option('show_excerpt')?"\r\t".stripslashes(yarpp_get_option('before_post',true)).yarpp_excerpt(LOREMIPSUM,yarpp_get_option('excerpt_length')).stripslashes(yarpp_get_option('before_post',true)):'').stripslashes(yarpp_get_option('after_title',true))." "; } $democode .= stripslashes(yarpp_get_option('after_related',true)); if (yarpp_get_option('promote_yarpp')) $democode .= htmlspecialchars("\n

".__("Related posts brought to you by Yet Another Related Posts Plugin.",'yarpp')."

"); checkbox('auto_display',__("Automatically display related posts?",'yarpp')." more>".__("This option automatically displays related posts right after the content on single entry pages. If this option is off, you will need to manually insert related_posts() or variants (related_pages() and related_entries()) into your theme files.",'yarpp')."",""); ?> > 8) the match scores?",'yarpp')." more>".__("With this option on, each related entry's total 'match score' (all above the threshold, set above) are displayed after each entry title, if you are an administrator and logged in. Even if you see these values, your visitors will not.",'yarpp').""); ?> more>" .sprintf(__("This option will add the code %s. Try turning it on, updating your options, and see the code in the code example to the right. These links and donations are greatly appreciated."),"".htmlspecialchars(__("Related posts brought to you by Yet Another Related Posts Plugin.",'yarpp'))."") .""); ?>
",'',''.__("Website display code example",'yarpp').'
'.__("(Update options to reload.)",'yarpp').'
' ."
".($democode)."
/ <ol></ol> or <div></div>
/ <li></li> or <dl></dl>
",' onclick="javascript:excerpt()"'); ?> ")?>
/ <li></li> or <dl></dl>

for RSS",'yarpp');?> NEW!

".__("RELATED TITLE",'yarpp')." $i")).(yarpp_get_option('rss_show_excerpt')?"\r\t".stripslashes(yarpp_get_option('rss_before_post',true)).yarpp_excerpt(LOREMIPSUM,yarpp_get_option('rss_excerpt_length')).stripslashes(yarpp_get_option('rss_before_post',true)):'').stripslashes(yarpp_get_option('rss_after_title',true))." "; } $democode .= stripslashes(yarpp_get_option('rss_after_related',true)); if (yarpp_get_option('rss_promote_yarpp')) $democode .= htmlspecialchars("\n

".__("Related posts brought to you by Yet Another Related Posts Plugin.",'yarpp')."

"); checkbox('rss_display',__("Display related posts in feeds?",'yarpp')." more>".__("This option displays related posts at the end of each item in your RSS and Atom feeds. No template changes are needed.",'yarpp')."",""); ?> >
",' onclick="javascript:do_rss_display();"'); checkbox('rss_excerpt_display',__("Display related posts in the descriptions?",'yarpp')." more>".__("This option displays the related posts in the RSS description fields, not just the content. If your feeds are set up to only display excerpts, however, only the description field is used, so this option is required for any display at all.",'yarpp')."","
",'',''.__("RSS display code example",'yarpp').'
'.__("(Update options to reload.)",'yarpp').'
' ."
".($democode)."
")?>
/ <ol></ol> or <div></div>
/ <li></li> or <dl></dl>
",' onclick="javascript:rss_excerpt()"'); ?> ")?>
/ <li></li> or <dl></dl>
")?> more>" .sprintf(__("This option will add the code %s. Try turning it on, updating your options, and see the code in the code example to the right. These links and donations are greatly appreciated."),"".htmlspecialchars(__("Related posts brought to you by Yet Another Related Posts Plugin.",'yarpp'))."") ."","
"); ?>